188 Star 769 Fork 170

GVPNutz / nutz

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build.gradle 3.75 KB
一键复制 编辑 原始数据 按行查看 历史
wendal 提交于 2016-09-11 22:05 . add: 新版gradle构建脚本.
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'
group = 'org.nutz'
version = '1.r.58-rc1'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
description = "Nutz"
sourceCompatibility = 1.6
targetCompatibility = 1.6
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version:'4.8.2'
testCompile group: 'com.h2database', name: 'h2', version:'1.4.181'
testCompile group: 'commons-dbcp', name: 'commons-dbcp', version:'1.4'
testCompile group: 'org.eclipse.jetty', name: 'jetty-server', version:'7.6.18.v20150929'
testCompile group: 'org.eclipse.jetty', name: 'jetty-jsp', version:'7.6.18.v20150929'
testCompile group: 'org.postgresql', name: 'postgresql', version:'9.3-1102-jdbc4'
testCompile group: 'mysql', name: 'mysql-connector-java', version:'5.1.39'
testCompile(group: 'com.alibaba', name: 'druid', version:'1.0.25') {
exclude(module: 'jconsole')
exclude(module: 'tools')
}
testCompile group: 'org.eclipse.jetty', name: 'jetty-webapp', version:'7.6.18.v20150929'
compile(group: 'log4j', name: 'log4j', version:'1.2.17')
compile(group: 'javax.servlet', name: 'servlet-api', version:'2.5')
}
sourceSets {
main{
java.srcDir "$projectDir/src"
}
test {
java.srcDirs "$projectDir/test"
resources.srcDir "$projectDir/test-prop"
}
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.compilerArgs = ["-parameters"]
}
javadoc.options.encoding = "UTF-8"
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task androidJar(type: Jar, dependsOn: classes) {
classifier = 'android'
from sourceSets.main.output
exclude('org/nutz/repo/org/**')
exclude('org/nutz/dao/**')
exclude('org/nutz/trans/**')
exclude('org/nutz/service/**')
exclude('org/nutz/img/**')
}
task jsonJar(type: Jar, dependsOn: classes) {
classifier = 'json'
from sourceSets.main.output
exclude('org/nutz/repo/org/**')
exclude('org/nutz/dao/**')
exclude('org/nutz/trans/**')
exclude('org/nutz/service/**')
exclude('org/nutz/img/**')
exclude('org/nutz/ioc/**')
exclude('org/nutz/mvc/**')
exclude('org/nutz/aop/**')
exclude('org/nutz/http/**')
exclude('org/nutz/net/**')
exclude('org/nutz/el/**')
exclude('org/nutz/repo/**')
exclude('org/nutz/filepool/**')
exclude('org/nutz/runner/**')
exclude('org/nutz/resource/**')
exclude('org/nutz/conf/**')
exclude('*.xsd')
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
archives androidJar
archives jsonJar
}
processResources {
from ('src'){
exclude '**/*.java';
}
}
processTestResources {
from ('test'){
exclude '**/*.java';
}
}
test {
include "org/nutz/TestAll"
jvmArgs "-Dfile.encoding=utf-8"
//showStackTraces = true
testLogging {
debug {
events "started", "skipped", "failed"
exceptionFormat "full"
}
}
}
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
def Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
if (isReleaseVersion) {
ext."signing.keyId"=properties["signing.keyId"]
ext."signing.password"=properties["signing.password"]
ext."signing.secretKeyRingFile"=properties["signing.secretKeyRingFile"]
}
Java
1
https://gitee.com/nutz/nutz.git
git@gitee.com:nutz/nutz.git
nutz
nutz
nutz
a70544381eff019ab27f35057ba2764f74feae59

搜索帮助