Gradle उपयोगकर्ता
के लिए मैं जब मैं Gradle के साथ काम करने शुरू कर एक ही मुद्दा है। मैं रिमोट थ्रिफ्ट कंपाइलर (मेरी कंपनी द्वारा कस्टम) द्वारा अपने बहाव को संकलित करना चाहता हूं।
task compileThrift {
doLast {
def projectLocation = projectDir.getAbsolutePath(); // HERE is what you've been looking for.
ssh.run {
session(remotes.compilerServer) {
// Delete existing thrift file.
cleanGeneratedFiles()
new File("$projectLocation/thrift/").eachFile() { f ->
def fileName=f.getName()
if(f.absolutePath.endsWith(".thrift")){
put from: f, into: "$compilerLocation/$fileName"
}
}
execute "mkdir -p $compilerLocation/gen-java"
def compileResult = execute "bash $compilerLocation/genjar $serviceName", logging: 'stdout', pty: true
assert compileResult.contains('SUCCESSFUL')
get from: "$compilerLocation/$serviceName" + '.jar', into: "$projectLocation/libs/"
}
}
}
}
स्रोत
2018-01-30 08:05:36
दिलचस्प:
नीचे कैसे मैं अपने समस्या हल हो जाती है। यह जिस तरह से मैंने उम्मीद की वह काम नहीं करता है। लेकिन यह इस तथ्य के कारण है कि मैं गैंट से एक गैंट स्क्रिप्ट चला रहा हूं। तो कोडसोर्स वास्तव में जहां गैंट है, जहां मेरी स्क्रिप्ट नहीं है। –
मेरे लिए काम नहीं करता है। 'getClass()। securityDomain.codeSource' शून्य लौटाता है। मैं ग्रोवी 2.0.1 का उपयोग कर रहा हूँ। – quux00
ग्रोवी 1.8.5 या तो (विंडोज़ पर) – Fels