|
|
@ -1,11 +1,41 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* This file was generated by the Gradle 'init' task. |
|
|
|
* This file was generated by the Gradle 'init' task. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
//打包直接执行zip命令 Gradle -> Tasks -> other -> zip |
|
|
|
dependencies { |
|
|
|
dependencies { |
|
|
|
implementation fileTree(dir: 'lib', include: ['*.jar']) |
|
|
|
implementation fileTree(dir: 'lib', include: ['*.jar']) |
|
|
|
} |
|
|
|
} |
|
|
|
task copyFile(type:Copy,dependsOn: ["build"]){ |
|
|
|
ant.importBuild("ant_build.xml") |
|
|
|
|
|
|
|
//定义ant变量 |
|
|
|
|
|
|
|
ant.projectDir = projectDir |
|
|
|
|
|
|
|
ant.references["compile.classpath"] = ant.path { |
|
|
|
|
|
|
|
fileset(dir: "lib", includes: '*.jar') |
|
|
|
|
|
|
|
fileset(dir: "$rootDir/webroot/WEB-INF/lib", includes: '*.jar') |
|
|
|
|
|
|
|
fileset(dir: ".",includes:"**/*.jar" ) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//clean -> classes -> copyFiles -> compile_javas(加密) -> preJar -> makeJar->copyFile->zip |
|
|
|
|
|
|
|
classes.dependsOn('clean') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
task copyFiles(type: Copy,dependsOn: 'classes'){ |
|
|
|
|
|
|
|
from "$buildDir/classes/java/main" |
|
|
|
|
|
|
|
from "$buildDir/resources/main" |
|
|
|
|
|
|
|
into "$projectDir/classes" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
task preJar(type:Copy,dependsOn: 'compile_javas'){ |
|
|
|
|
|
|
|
from "$projectDir/classes" |
|
|
|
|
|
|
|
into "$buildDir/classes/java/main" |
|
|
|
|
|
|
|
doLast(){ |
|
|
|
|
|
|
|
delete file("$projectDir/classes") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
task makeJar(type: Jar,dependsOn: preJar){ |
|
|
|
|
|
|
|
from fileTree(dir:"$buildDir/classes/java/main") //包含assets文件 |
|
|
|
|
|
|
|
destinationDir = file("$buildDir/libs") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
task copyFile(type: Copy,dependsOn: ["makeJar"]){ |
|
|
|
from "$buildDir/libs" |
|
|
|
from "$buildDir/libs" |
|
|
|
from "$projectDir/lib" |
|
|
|
from "$projectDir/lib" |
|
|
|
from "$projectDir/plugin.xml" |
|
|
|
from "$projectDir/plugin.xml" |
|
|
@ -20,8 +50,8 @@ task zip(type:Zip,dependsOn:["copyFile"]){ |
|
|
|
// appendix 'appendix' |
|
|
|
// appendix 'appendix' |
|
|
|
// version '0.0.1' |
|
|
|
// version '0.0.1' |
|
|
|
} |
|
|
|
} |
|
|
|
//先清理再build |
|
|
|
|
|
|
|
build.mustRunAfter clean |
|
|
|
|
|
|
|
//控制build时包含哪些文件,排除哪些文件 |
|
|
|
//控制build时包含哪些文件,排除哪些文件 |
|
|
|
processResources { |
|
|
|
processResources { |
|
|
|
// exclude everything |
|
|
|
// exclude everything |
|
|
|