You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.6 KiB
67 lines
1.6 KiB
9 years ago
|
|
||
|
apply plugin: 'java'
|
||
|
tasks.withType(JavaCompile){
|
||
|
options.encoding = 'UTF-8'
|
||
|
}
|
||
8 years ago
|
//指定构建的jdk版本
|
||
8 years ago
|
sourceCompatibility=1.7
|
||
8 years ago
|
//指定生成jar包的版本
|
||
9 years ago
|
version='8.0'
|
||
|
|
||
9 years ago
|
def srcDir="."
|
||
|
|
||
8 years ago
|
//对生成的jar包进行重命名
|
||
9 years ago
|
|
||
|
jar{
|
||
|
baseName='fr-designer-chart'
|
||
|
}
|
||
|
|
||
|
sourceSets{
|
||
|
main{
|
||
|
java{
|
||
9 years ago
|
srcDirs=["${srcDir}/src"]
|
||
9 years ago
|
}
|
||
|
}
|
||
|
}
|
||
8 years ago
|
FileTree files =fileTree(dir:'./',include:'build.*.gradle')
|
||
9 years ago
|
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\'))
|
||
9 years ago
|
buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\'))
|
||
9 years ago
|
def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1)
|
||
|
|
||
8 years ago
|
//指定外部依赖
|
||
9 years ago
|
dependencies{
|
||
8 years ago
|
compile fileTree(dir:"../../../finereport-lib-stable/${branchName}",include:'**/*.jar')
|
||
8 years ago
|
compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")
|
||
9 years ago
|
|
||
9 years ago
|
testCompile 'junit:junit:4.12'
|
||
|
}
|
||
8 years ago
|
//将非.java 文件复制到classes文件夹下参与打包
|
||
9 years ago
|
task copyFile(type:Copy,dependsOn:compileJava){
|
||
|
copy{
|
||
9 years ago
|
from ("${srcDir}/src"){
|
||
9 years ago
|
exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html'
|
||
|
|
||
9 years ago
|
}
|
||
|
into 'build/classes/main'
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
8 years ago
|
//压缩项目中的js文件
|
||
9 years ago
|
task compressJS{
|
||
|
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){
|
||
|
classpath {
|
||
9 years ago
|
fileset(dir:'../../../finereport-lib4build-stable',includes:'**/*.jar')
|
||
9 years ago
|
}
|
||
|
}
|
||
8 years ago
|
ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false",charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){
|
||
9 years ago
|
fileset (dir:"${srcDir}/src"){
|
||
9 years ago
|
include (name:'**/*.js')
|
||
9 years ago
|
include (name:'**/*.css')
|
||
9 years ago
|
}
|
||
|
|
||
|
}
|
||
|
}
|
||
|
jar.dependsOn compressJS
|
||
|
|