Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
build.gradle 1.69 KB
Copy Edit Web IDE Raw Blame History
group 'com.bcs.codgen'
version '1.0.7'
/*自带插件*/
apply plugin: 'java'
sourceCompatibility = 1.6
/*UTF-8 很重要*/
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.warnings = false
}
tasks.withType(org.gradle.api.tasks.javadoc.Javadoc) {
options.encoding = 'UTF-8'
}
javadoc {
options.charSet = 'UTF-8'
}
compileJava {
options.compilerArgs << '-XDignore.symbol.file'
options.fork = true
println("$System.env.USER")
println("detected JAVA_HOME=$System.env.JAVA_HOME")
println("setting options.bootClasspath = $System.env.JAVA_HOME/jre/lib/rt.jar")
options.bootClasspath = "$System.env.JAVA_HOME/jre/lib/rt.jar"
}
repositories {
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile ('commons-lang:commons-lang:2.6')
compile ('commons-logging:commons-logging:1.2')
compile ('log4j:log4j:1.2.17')
compile ("org.freemarker:freemarker:2.3.20")
}
//依赖编译,然后打包JAR
task taskJar(type:Jar, dependsOn: compileJava) {
from 'build/classes/main'
destinationDir = file('dist')
manifest {
attributes 'Manifest-Version': version
attributes 'Created-By': 'tengen'
}
}
//生成源码jar
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
destinationDir = file('dist')
}
//生成javadoc的jar
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
destinationDir = file('dist')
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}

Comment ( 0 )

Sign in for post a comment