-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.gradle
executable file
·129 lines (109 loc) · 3.79 KB
/
common.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
apply plugin: "maven-publish"
//apply plugin: 'nebula-aggregate-javadocs'
allprojects {
apply plugin: 'eclipse'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: "io.spring.dependency-management"
configurations.all {
resolutionStrategy {
cacheDynamicVersionsFor 0, 'seconds'
cacheChangingModulesFor 0, 'seconds'
// force 'asm:asm-all:3.3.1', 'commons-io:commons-io:1.4'
// force 'org.apache.zookeeper:zookeeper:3.4.8'
}
}
javadoc {
options {
locale = 'zh_CN'
encoding = 'UTF-8'
docFilesSubDirs = true
failOnError = false
excludeDocFilesSubDir '.git'
}
}
def javaSubprojects = rootProject.subprojects.findAll {
subproject -> subproject.plugins.hasPlugin(JavaPlugin)
}
task aggregateJavadocs(type: Javadoc) {
description = 'Aggregates Javadoc API documentation of all subprojects.'
group = JavaBasePlugin.DOCUMENTATION_GROUP
dependsOn javaSubprojects.javadoc
source javaSubprojects.javadoc.source
destinationDir rootProject.file("$rootProject.buildDir/docs/javadoc")
classpath = rootProject.files(javaSubprojects.javadoc.classpath)
options {
locale = 'zh_CN'
encoding = 'UTF-8'
docFilesSubDirs = true
failOnError = false
excludeDocFilesSubDir '.git'
}
}
task sourceJar (type : Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
jar.manifest {
attributes('Implementation-Title': name,
'Implementation-Version': version,
'Built-By': System.getProperty('user.name'),
'Built-JDK': System.getProperty('java.version'),
'Source-Compatibility': sourceCompatibility,
'Target-Compatibility': targetCompatibility)
}
sourceCompatibility = javaVersion
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
repositories {
mavenLocal()
maven {
url groupUrl
}
}
}
ext.withXml = { pom ->
pom.withXml {
// asNode().appendNode('description', 'A demonstration of Maven POM customization')
asNode().children().first() + {
resolveStrategy = Closure.DELEGATE_FIRST
name name
description "The project of zxy-commons-dependency"
url "https://github.com/zhaoxunyong/zxy-commons-bom"
inceptionYear 2016
scm {
url "https://github.com/zhaoxunyong/zxy-commons-bom.git"
connection "https://github.com/zhaoxunyong/zxy-commons-bom.git"
developerConnection "https://github.com/zhaoxunyong/zxy-commons-bom.git"
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/license/LICENSE-2.0.txt'
distribution 'repo'
comments 'A business-friendly OSS license'
}
}
organization {
name '赵训勇'
url 'https://github.com/zhaoxunyong'
}
developers {
developer {
id 'zhaoxunyong'
name 'zhaoxunyong'
email 'zhaoxunyong@qq.com'
url "https://github.com/zhaoxunyong"
// https://issues.gradle.org/browse/GRADLE-2719
organizationUrl "https://github.com/zhaoxunyong"
}
}
}
}
}
// https://docs.gradle.org/current/dsl/org.gradle.api.tasks.wrapper.Wrapper.html
// https://docs.gradle.org/current/dsl/org.gradle.api.invocation.Gradle.html
task wrapper(type: Wrapper) {
gradleVersion = '2.14'
}