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