From 85be7d49d16b992b1e81211639b03d8ad20d20ba Mon Sep 17 00:00:00 2001 From: liunian Date: Wed, 31 Jan 2018 16:27:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 44 ++++++++++++++------------------------------ 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3ba7114..961bc1f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -61,18 +61,7 @@ android { } else { outDirectory = outputFile.parent } - println '---------------------' + fileName + '---------------------' output.outputFile = new File(outDirectory, fileName) - // jenkins打包生成二维码 -// if ("true".equals(IS_JENKINS)) { -// tasks.create(name: 'generateOR', type: Exec, overwrite: true) { -// println '---------------------generateQR------------------------' -// // 执行jenkinsQR.py,生成二维码 -// def pycmd = "python jenkinsQR.py " + BUILD_TYPE + ' ' + timeStr + ' ' + BUILD_PATH_JENKINS + ' ' + fileName -// pycmd.execute() -// println pycmd -// } -// } } } } @@ -88,24 +77,19 @@ dependencies { testCompile 'junit:junit:4.12' } -task generateQR (type: Exec) << { - if ("true".equals(IS_JENKINS)) { - println '---------------------generateQR------------------------' - // 执行jenkinsQR.py,生成二维码 - def pycmd = "python jenkinsQR.py " + BUILD_TYPE + ' ' + timeStr + ' ' + BUILD_PATH_JENKINS + ' ' + fileName - pycmd.execute() - println pycmd +// 在最后一个task后执行生成二维码胡操作 +gradle.taskGraph.whenReady { graph -> + graph.allTasks[graph.allTasks.size()-1].doLast { + println '---------------------doLast------------------------' + // jenkins打包生成二维码 + if ("true".equals(IS_JENKINS)) { + tasks.create(name: 'generateOR', type: Exec, overwrite: true) { + println '---------------------generateQR------------------------' + // 执行jenkinsQR.py,生成二维码 + def pycmd = "python jenkinsQR.py " + BUILD_TYPE + ' ' + timeStr + ' ' + BUILD_PATH_JENKINS + ' ' + fileName + pycmd.execute() + println pycmd + } + } } } - -tasks.each() { - task -> println '---------------------' + task.name + '------------------------' -} - -assemble.doFirst { - println '---------------------doFirst------------------------' -} -assemble.doLast { - println '---------------------doLast------------------------' - generateQR.execute() -}