-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
179 lines (149 loc) · 4.35 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'signing'
sourceCompatibility = 1.7
targetCompatibility = 1.7
group = 'org.lucidfox.jpromises'
version = '0.3.2'
wrapper {
gradleVersion = '5.3.1'
}
sourceSets {
main {
resources {
exclude '**/.keep'
}
}
gwt {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
srcDir 'src/main/gwt'
exclude '**/.keep'
}
}
}
jar {
manifest {
attributes 'Implementation-Title': 'JPromises', 'Implementation-Version': version
}
}
javadoc {
options.links("http://docs.oracle.com/javase/7/docs/api/")
options.links("http://www.gwtproject.org/javadoc/latest/")
options.links("https://developer.android.com/reference/")
options.addStringOption('tag', 'apiNote:a:API Note:')
// options.addStringOption('tag', 'implSpec:a:Implementation Requirements:')
// options.addStringOption('tag', 'implNote:a:Implementation Note:')
}
repositories {
jcenter()
}
dependencies {
compileOnly group: 'com.google.gwt', name: 'gwt-user', version: '2.7.0'
compileOnly group: 'com.google.gwt', name: 'gwt-dev', version: '2.7.0'
compileOnly group: 'com.google.android', name: 'android', version: '2.1.2'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
test {
testLogging {
events 'passed', 'skipped', 'failed'
}
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task gwtJar(type: Jar) {
baseName = "${project.name}-gwt"
from sourceSets.gwt.allSource
}
task gwtJavadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
baseName = "${project.name}-gwt"
classifier = 'javadoc'
from javadoc.destinationDir
}
task gwtSourcesJar(type: Jar) {
classifier = 'sources'
baseName = "${project.name}-gwt"
from sourceSets.gwt.allSource
}
artifacts {
archives sourcesJar
archives javadocJar
archives gwtJar
archives gwtJavadocJar
archives gwtSourcesJar
}
signing {
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: 'file:///home/maia/workspace/jpromises/jpromises/build/repo/')
addFilter('default') {artifact, file ->
artifact.name == "${project.name}"
}
addFilter('gwt') {artifact, file ->
artifact.name == "${project.name}-gwt"
}
pom('default').project {
licenses {
license {
name 'MIT License'
url 'http://www.opensource.org/licenses/mit-license.php'
distribution 'repo'
}
}
developers {
developer {
name 'Maia Everett'
email '[email protected]'
url 'https://maia.everett.one'
}
}
scm {
url 'https://github.com/Maia-Everett/jpromises'
connection 'https://github.com/Maia-Everett/jpromises.git'
developerConnection '[email protected]:Maia-Everett/jpromises.git'
}
name 'Java Library for Promises'
description 'An implementation of Promises in Java based on the JavaScript Promises/A+ specification,' +
' with adapters for AWT and GWT.'
url 'https://github.com/Maia-Everett/jpromises'
}
pom('gwt').project {
name 'Java Library for Promises - GWT module'
description 'An implementation of Promises in Java based on the JavaScript Promises/A+ specification,' +
' with adapters for AWT and GWT. This artifact contains a GWT module with packaged sources.'
url 'https://github.com/Maia-Everett/jpromises'
}
pom('gwt').model.licenses = pom('default').model.licenses
pom('gwt').model.developers = pom('default').model.developers
pom('gwt').model.scm = pom('default').model.scm
pom('gwt').withXml {
// ugh, ugly
def dependency = asNode().get('dependencies')[0].appendNode('dependency')
dependency.appendNode('groupId', 'com.google.gwt')
dependency.appendNode('artifactId', 'gwt-user')
dependency.appendNode('version', '2.7.0')
dependency.appendNode('scope', 'provided')
dependency = asNode().get('dependencies')[0].appendNode('dependency')
dependency.appendNode('groupId', "${project.group}")
dependency.appendNode('artifactId', "${project.name}")
dependency.appendNode('version', "${project.version}")
dependency.appendNode('scope', 'compile')
}
}
}
}