-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
executable file
·106 lines (92 loc) · 2.94 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
buildscript {
repositories {
maven {
url groupUrl
// url "http://dl.bintray.com/eddgrant/maven"
}
}
dependencies {
classpath "io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE"
// classpath 'com.eddgrant:maven-password-decrypter:0.0.4'
classpath 'de.aaschmid:gradle-cpd-plugin:1.0'
}
}
//ext.mpd = new com.eddgrant.mpd.MavenPasswordDecrypter()
apply from: 'gradle/common.gradle'
apply from: 'gradle/mavenauth.gradle'
subprojects {
sourceSets {
main.java.srcDirs = ["src/main/java"]
main.resources.srcDirs = ["src/main/resources"]
test.java.srcDirs = ["src/test/java"]
// test.java.excludes = ["**/*IT.*"]
test.resources.srcDirs = ["src/test/resources"]
integTest.java.srcDirs = ["src/integTest/java"]
// integTest.java.includes = ["**/*IT.*"]
integTest.resources.srcDirs = ["src/integTest/resources"]
}
task integTest(type: Test) {
testClassesDir = sourceSets.integTest.output.classesDir
classpath = sourceSets.integTest.runtimeClasspath
reports {
html.enabled true
html.destination "${buildDir}/reports/integTests"
// html.stylesheet resources.text.fromFile('config/xsl/findbugs-custom.xsl')
}
}
// check.dependsOn integTest
plugins.withType(JavaBasePlugin) { // <- just required if 'java' plugin is applied within subproject
check.dependsOn(integTest)
}
dependencyManagement {
imports {
mavenBom "com.zxy:zxy-commons-bom:${commonsBomVersion}"
}
}
dependencies {
integTestCompile sourceSets.main.output
integTestCompile configurations.testCompile
integTestCompile sourceSets.test.output
integTestRuntime configurations.testRuntime
}
/*jar {
into("META-INF/maven/$project.group/$project.archivesBaseName") {
from new File(project.buildDir, 'publications/maven')
rename "pom-default.xml", "pom.xml"
}
}*/
}
// 将子项目中的几个项目优先级提升
evaluationDependsOn(':zxy-commons-findbugs')
evaluationDependsOn(':zxy-commons-test')
publishing {
repositories {
maven {
credentials {
username user
password pwd
}
/*if(user == '' || pwd == '') {
throw new NullPointerException("Username or password is empty!")
}*/
if (version.endsWith('-SNAPSHOT')){
url "${snapshotsUrl}"
} else {
url "${releaseUrl}"
}
// url "file:///Developer/repo"
}
}
publications {
mavenCustom(MavenPublication) {
from components.java
withXml(pom)
}
}
}
//[Test, Pmd, Checkstyle].each {
//[Test, Pmd].each {
// tasks.withType(it) {
// task -> enabled = !gradle.startParameter.taskNames.contains('releaseJar') && !gradle.startParameter.taskNames.contains('packDeployJar')
// }
//}