From c87bba18a2f0a95a09b6b3612447c34e46656b92 Mon Sep 17 00:00:00 2001 From: richie Date: Tue, 2 Jun 2020 18:25:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E4=BC=98=E9=9B=85=E7=9A=84=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E9=80=89=E6=8B=A9=E6=98=AF=E5=90=A6=E5=AF=B9=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E8=BF=9B=E8=A1=8C=E5=8A=A0=E5=AF=86=E4=BF=9D=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + plugin-function/build.gradle | 24 +++++++++--------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 10a7a09..4fe6b94 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ build local.properties classes/ +transform-classes/ tomcat.* \ No newline at end of file diff --git a/plugin-function/build.gradle b/plugin-function/build.gradle index 506a8af..b75b004 100644 --- a/plugin-function/build.gradle +++ b/plugin-function/build.gradle @@ -13,7 +13,7 @@ ext { /** * 是否对插件的class进行加密保护,防止反编译 */ - guard = false + guard = true def pluginInfo = getPluginInfo() pluginPre = "fine-plugin" @@ -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,27 +45,23 @@ 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") + delete file("$projectDir/transform-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