forked from kirill-grouchnikov/substance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·283 lines (235 loc) · 8.97 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
apply plugin: 'java'
apply plugin: 'maven'
group = "com.github.insubstantial.insubstantial"
version = "6.2-SNAPSHOT"
versionKey = "6.2-invincible_SNAPSHOT"
release = "internal"
timeStamp = new Date().format("MMMM d, yyyy HH:mm:ss z")
sourceCompatibility = 1.6
targetCompatibility = 1.6
task wrapper(type: Wrapper) {
gradleVersion = '0.9.2'
}
configurations {
testCompile { extendsFrom compile }
toolsCompile { extendsFrom compile }
}
sourceSets {
main
test
tools {
compileClasspath = sourceSets.main.classes + sourceSets.test.classes + configurations.toolsCompile + configurations.testCompile
}
}
repositories {
mavenRepo urls: new File(System.getProperty('user.home'), '.m2/repository').toURI().toString()
mavenCentral()
}
dependencies {
compile fileTree(dir: 'lib', includes: ['*.jar'])
compile fileTree(dir: 'lib/build', includes: ['*.jar'])
testCompile fileTree(dir: 'lib/test', includes: ['*.jar'])
compile module('net.jcip:jcip-annotations:1.0') {
transitive = false
}
// compile 'com.github.insubstantial.halberd:halberd:6.2-SNAPSHOT'
// compile 'com.github.insubstantial.plafwidget:plafwidget:6.2-SNAPSHOT'
// compile 'com.github.insubstantial.plafplugin:plafplugin:6.2-SNAPSHOT'
// testCompile 'com.jgoodies:forms:1.2.0'
// testCompile 'org.swinglabs:swingx:1.6.1'
// toolsCompile 'org.easytesting:fest-swing:1.2'
// toolsCompile 'asm:asm-all:2.2.3'
}
task augmentation(dependsOn: classes) {
description = "Performs code augmentaiton for the laf-plugin and laf-widget libraries on the substance jar classes"
doLast {
// Explode laf-plugin and laf-widget
// copy {
// from zipTree('lib/build/laf-plugin.jar')
// into sourceSets.main.classesDir
// }
// copy {
// from zipTree('lib/build/laf-widget.jar')
// into sourceSets.main.classesDir
// }
augmentClassPath = configurations.toolsCompile.asPath
ant.taskdef(name: 'delegate-augment', classname: "org.pushingpixels.lafwidget.ant.AugmentTask", classpath: augmentClassPath)
ant.taskdef(name: 'delegate-update-augment', classname: "org.pushingpixels.lafwidget.ant.AugmentUpdateTask", classpath: augmentClassPath)
ant.taskdef(name: 'laf-augment', classname: "org.pushingpixels.lafwidget.ant.AugmentMainTask", classpath: augmentClassPath)
ant.taskdef(name: 'icon-ghosting-augment', classname: "org.pushingpixels.lafwidget.ant.AugmentIconGhostingTask", classpath: augmentClassPath)
ant.taskdef(name: 'container-ghosting-augment', classname: "org.pushingpixels.lafwidget.ant.AugmentContainerGhostingTask", classpath: augmentClassPath)
verboseAugmentation = false
//LAF augmentation
//ant.'laf-augment'(verbose: verboseAugmentaiton, mainlafclassname:"org.pushingpixels.substance.api.SubstanceLookAndFeel") {
// classpathset(dir:sourceSets.main.classesDir)
// delegate(name:"ViewportUI")
//}
// Delegate augmentation
ant.'delegate-update-augment'(verbose: verboseAugmentation, pattern: ".*UI\u002Eclass") {
classpathset(dir: sourceSets.main.classesDir)
}
ant.'delegate-augment'(verbose: verboseAugmentation, pattern: ".*UI\u002Eclass") {
classpathset(dir: sourceSets.main.classesDir)
}
// Icon ghosting augmentation
ant.'icon-ghosting-augment'(verbose: verboseAugmentation) {
classpathset(dir: sourceSets.main.classesDir)
iconghosting(className: "org.pushingpixels.substance.internal.ui.SubstanceButtonUI", methodName: "paintIcon")
iconghosting(className: "org.pushingpixels.substance.internal.ui.SubstanceToggleButtonUI", methodName: "paintIcon")
}
// Container ghosting augmentation
ant.'container-ghosting-augment'(verbose: verboseAugmentation) {
classpathset(dir: sourceSets.main.classesDir)
containerghosting(className: "org.pushingpixels.substance.internal.ui.SubstanceDesktopPaneUI", toInjectAfterOriginal: "true")
containerghosting(className: "org.pushingpixels.substance.internal.ui.SubstanceMenuBarUI", toInjectAfterOriginal: "true")
containerghosting(className: "org.pushingpixels.substance.internal.ui.SubstanceMenuUI", toInjectAfterOriginal: "true")
containerghosting(className: "org.pushingpixels.substance.internal.ui.SubstancePanelUI", toInjectAfterOriginal: "true")
containerghosting(className: "org.pushingpixels.substance.internal.ui.SubstanceScrollBarUI", toInjectAfterOriginal: "true")
containerghosting(className: "org.pushingpixels.substance.internal.ui.SubstanceToolBarUI", toInjectAfterOriginal: "true")
}
}
}
jar {
dependsOn augmentation
dependsOn toolsClasses
exclude 'org/pushingpixels/lafwidget/ant/**'
from zipTree('lib/build/laf-plugin.jar')
from zipTree('lib/build/laf-widget.jar')
manifest {
attributes(
"Substance-Distribution": "Full",
"Substance-Version": versionKey,
"Substance-BuildStamp": timeStamp
)
}
}
task liteJar(type: Jar) {
dependsOn augmentation
dependsOn toolsClasses
classifier = 'lite'
from sourceSets.main.classes
exclude 'org/pushingpixels/substance/internal/contrib/randelshofer/**'
exclude 'org/pushingpixels/substance/internal/contrib/xoetrope/**'
exclude 'org/pushingpixels/substance/internal/ui/SubstanceColorChooserUI*'
exclude 'org/pushingpixels/lafwidget/ant/**'
from zipTree('lib/build/laf-plugin.jar')
from zipTree('lib/build/laf-widget.jar')
manifest {
attributes(
"Substance-Distribution": "Lite",
"Substance-Version": versionKey,
"Substance-BuildStamp": timeStamp
)
}
}
task testJar(type: Jar) {
classifier = 'tst'
from sourceSets.test.classes
manifest {
attributes(
"Substance-Version": versionKey,
"Substance-BuildStamp": timeStamp,
"Main-Class": "test.Check",
"Class-Path": "substance.jar ../lib/trident.jar ../lib/build/forms-1.2.0.jar ../lib/build/swingx.jar ../lib/build/substance-swingx.jar"
)
}
}
task testLiteJar(type: Jar) {
classifier = 'tst-lite'
from sourceSets.test.classes
manifest {
attributes(
"Substance-Version": versionKey,
"Substance-BuildStamp": timeStamp,
"Main-Class": "test.Check",
"Class-Path": "substance-lite.jar ../lib/trident.jar ../lib/build/forms-1.2.0.jar ../lib/build/swingx.jar ../lib/build/substance-swingx.jar"
)
}
}
task toolsJar(type: Jar) {
classifier = 'tools'
from sourceSets.tools.classes
manifest {
attributes(
"Substance-Version": versionKey,
"Substance-BuildStamp": timeStamp
)
}
// the annotation factory class doesn't exist, ignore it?
// doLast {
// ant.apt(srcdir:sourceSets.tools.java.srcDirs.iterator().next(), classpath:"$libsDir/$archiveName", factory:"tools.apt.", compile:false)
// }
}
task distroJar(type: Jar) {
dependsOn toolsJar, liteJar, testJar, testLiteJar, jar
classifier = 'all'
from(projectDir)
include "lib/**"
include "src/**"
include "gradle.properties"
include "build.gradle"
exclude "**/*.vsd"
}
//allSubstanceJars = [toolsJar, liteJar, testJar, testLiteJar, distroJar]
//uploadArchives.dependsOn << allSubstanceJars
//assemble.dependsOn << allSubstanceJars
task sourceJar(type: Jar) {
from sourceSets.main.java
from sourceSets.main.resources
classifier = 'src'
}
task javadocJar(type: Jar) {
from javadoc.destinationDir
classifier = 'javadoc'
}
artifacts {
archives sourceJar
archives javadocJar
archives toolsJar
archives liteJar
}
configure(install.repositories.mavenInstaller) {
pom.project {
modelVersion '4.0.0'
packaging 'jar'
name "halberd"
description "A fork of @kirilcool's substance project"
url "http://insubstantial.github.com/insubstantial"
licenses {
license {
name 'BSD License'
url 'http://www.opensource.org/licenses/bsd-license.php'
distribution 'repo'
comments "Does not cover the Xoetrope Color Wheel"
}
license {
name 'Mozilla Public License 1.1'
url 'http://www.opensource.org/licenses/mozilla1.1'
distribution 'repo'
comments "Covers the Xoetrope Color Wheel"
}
}
scm {
connection 'scm:git:[email protected]:Insubstantial/halberd.git'
developerConnection 'scm:git:[email protected]:Insubstantial/halberd.git'
url 'scm:git:[email protected]:Insubstantial/halberd.git'
}
developers {
developer {
name 'Kirill Grouchnikov'
email '[email protected]'
roles {
role 'author'
role 'developer'
}
}
developer {
name 'Danno Ferrin'
email '[email protected]'
roles {
role 'maintainer'
}
}
}
}
}