From e556b39f43990fe7868156262d132a542f17788f Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 5 Jun 2020 15:52:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8C=85=E8=84=9A=E6=9C=AC=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E4=B8=80=E7=82=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin-function/build.gradle | 11 ++++++----- plugin-function2/build.gradle | 31 +++++++++++++------------------ 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/plugin-function/build.gradle b/plugin-function/build.gradle index b75b004..89632b2 100644 --- a/plugin-function/build.gradle +++ b/plugin-function/build.gradle @@ -53,10 +53,6 @@ task preJar(type:Copy,dependsOn: guard ? 'compile_encrypt_javas' : 'compile_plai from "$projectDir/classes" into "$projectDir/transform-classes" include "**/*.*" - doLast(){ - delete file("$projectDir/classes") - delete file("$projectDir/transform-classes") - } } jar.dependsOn("preJar") @@ -66,6 +62,11 @@ task makeJar(type: Jar,dependsOn: preJar){ appendix pluginName version pluginVersion destinationDir = file("$buildDir/libs") + + doLast(){ + delete file("$projectDir/classes") + delete file("$projectDir/transform-classes") + } } task copyFile(type: Copy,dependsOn: ["makeJar"]){ @@ -78,7 +79,7 @@ task copyFile(type: Copy,dependsOn: ["makeJar"]){ } task zip(type:Zip,dependsOn:["copyFile"]){ - from "$buildDir/temp" + from "$buildDir/temp/plugin" destinationDir file("$buildDir/install") baseName pluginPre appendix pluginName diff --git a/plugin-function2/build.gradle b/plugin-function2/build.gradle index 506a8af..c56b872 100644 --- a/plugin-function2/build.gradle +++ b/plugin-function2/build.gradle @@ -27,12 +27,10 @@ group = 'com.fr.plugin' version = '10.0' sourceCompatibility = '8' -if (!guard) { - sourceSets { - main { - java.outputDir = file(outputPath) - output.resourcesDir = file(outputPath) - } +sourceSets { + main { + java.outputDir = file(outputPath) + output.resourcesDir = file(outputPath) } } @@ -47,31 +45,28 @@ ant.references["compile.classpath"] = ant.path { classes.dependsOn('clean') task copyFiles(type: Copy,dependsOn: 'classes'){ - if (guard) { - from "$buildDir/classes/java/main" - from "$buildDir/resources/main" - } else { - from outputPath - } + from outputPath into "$projectDir/classes" } task preJar(type:Copy,dependsOn: guard ? 'compile_encrypt_javas' : 'compile_plain_javas'){ from "$projectDir/classes" - into "$buildDir/classes/java/main" + into "$projectDir/transform-classes" include "**/*.*" - doLast(){ - delete file("$projectDir/classes") - } } jar.dependsOn("preJar") task makeJar(type: Jar,dependsOn: preJar){ - from fileTree(dir:guard ? "$buildDir/classes/java/main" : outputPath) + from fileTree(dir: "$projectDir/transform-classes") baseName pluginPre appendix pluginName version pluginVersion destinationDir = file("$buildDir/libs") + + doLast(){ + delete file("$projectDir/classes") + delete file("$projectDir/transform-classes") + } } task copyFile(type: Copy,dependsOn: ["makeJar"]){ @@ -84,7 +79,7 @@ task copyFile(type: Copy,dependsOn: ["makeJar"]){ } task zip(type:Zip,dependsOn:["copyFile"]){ - from "$buildDir/temp" + from "$buildDir/temp/plugin" destinationDir file("$buildDir/install") baseName pluginPre appendix pluginName