|
|
@ -3,19 +3,19 @@ apply plugin: 'java' |
|
|
|
tasks.withType(JavaCompile){ |
|
|
|
tasks.withType(JavaCompile){ |
|
|
|
options.encoding = 'UTF-8' |
|
|
|
options.encoding = 'UTF-8' |
|
|
|
} |
|
|
|
} |
|
|
|
//指定构建的jdk版本 |
|
|
|
//指定构建的jdk版本 |
|
|
|
sourceCompatibility=1.8 |
|
|
|
sourceCompatibility=1.8 |
|
|
|
//指定生成的jar包版本 |
|
|
|
//指定生成的jar包版本 |
|
|
|
version='8.0' |
|
|
|
version='8.0' |
|
|
|
|
|
|
|
|
|
|
|
def srcDir="." |
|
|
|
def srcDir="." |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//指明生成jar包的名字 |
|
|
|
//指明生成jar包的名字 |
|
|
|
jar{ |
|
|
|
jar{ |
|
|
|
baseName='fr-designer-report' |
|
|
|
baseName='fr-designer-report' |
|
|
|
} |
|
|
|
} |
|
|
|
//源码所在位置 |
|
|
|
//源码所在位置 |
|
|
|
sourceSets{ |
|
|
|
sourceSets{ |
|
|
|
main{ |
|
|
|
main{ |
|
|
|
java{ |
|
|
|
java{ |
|
|
@ -25,20 +25,20 @@ sourceSets{ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//获取什么分支名 |
|
|
|
//获取什么分支名 |
|
|
|
FileTree files =fileTree(dir:'./',include:'build.gradle') |
|
|
|
FileTree files =fileTree(dir:'./',include:'build.gradle') |
|
|
|
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\')) |
|
|
|
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\')) |
|
|
|
buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\')) |
|
|
|
buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\')) |
|
|
|
def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) |
|
|
|
def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) |
|
|
|
//声明外部依赖 |
|
|
|
//声明外部依赖 |
|
|
|
dependencies{ |
|
|
|
dependencies{ |
|
|
|
compile fileTree(dir:'../../../finereport-lib-stable',include:'**/*.jar') |
|
|
|
compile fileTree(dir:'../../../finereport-lib-stable',include:'**/*.jar') |
|
|
|
compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")//,exclude:"finereport-design-stable/${branchName}/build/libs/*.jar") |
|
|
|
compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") |
|
|
|
|
|
|
|
|
|
|
|
testCompile 'junit:junit:4.12' |
|
|
|
testCompile 'junit:junit:4.12' |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//指明无法编译文件所在路径 |
|
|
|
//指明无法编译文件所在路径 |
|
|
|
def dataContent ={def dir -> |
|
|
|
def dataContent ={def dir -> |
|
|
|
copySpec{ |
|
|
|
copySpec{ |
|
|
|
from ("${dir}"){ |
|
|
|
from ("${dir}"){ |
|
|
@ -47,7 +47,7 @@ def dataContent ={def dir -> |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//将非.java文件复制到classes文件夹下 参与打包 |
|
|
|
//将非.java文件复制到classes文件夹下 参与打包 |
|
|
|
task copyFile(type:Copy,dependsOn:compileJava){ |
|
|
|
task copyFile(type:Copy,dependsOn:compileJava){ |
|
|
|
copy{ |
|
|
|
copy{ |
|
|
|
with dataContent.call("${srcDir}/src") |
|
|
|
with dataContent.call("${srcDir}/src") |
|
|
@ -58,7 +58,7 @@ task copyFile(type:Copy,dependsOn:compileJava){ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//压缩项目中的js文件 |
|
|
|
//压缩项目中的js文件 |
|
|
|
task compressJS{ |
|
|
|
task compressJS{ |
|
|
|
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ |
|
|
|
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ |
|
|
|
classpath { |
|
|
|
classpath { |
|
|
|