forked from JFXtras/jfxtras
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
227 lines (195 loc) · 6.37 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
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
maven {
name 'JCenter - for Gradle Shadow'
url 'http://jcenter.bintray.com/'
}
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.2'
classpath "eu.mihosoft.vrl.vlicense-header-util:VLicenseHeaderUtil:0.1-r2-SNAPSHOT"
classpath "eu.mihosoft.vrl.vlicense-header-util.gradle:vlicense-header-plugin:0.1-r2-SNAPSHOT"
classpath 'me.tatarka:gradle-retrolambda:3.2.2'
}
}
allprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'eclipse'
apply plugin: 'idea'
// apply vrl license header plugin
if (!project.plugins.findPlugin(eu.mihosoft.vrl.vlicenseheaderutil.gradle.VLicenseHeaderPlugin)) {
project.apply(plugin: eu.mihosoft.vrl.vlicenseheaderutil.gradle.VLicenseHeaderPlugin)
}
// license template (will be used as header in all Java source files)
repairHeaders.licenseHeaderText = new File(projectDir,"../license-template.txt")
repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
url "http://oss.sonatype.org/content/repositories/releases/"
}
}
signing {
sign configurations.archives
}
signArchives.onlyIf {
project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')
}
uploadArchives.onlyIf {
project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')
}
uploadArchives {
if (!project.hasProperty('sonatypeUsername') || !project.hasProperty('sonatypePassword')) {
return
}
repositories.mavenDeployer {
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2') {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots') {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
pom.project {
artifactId "${project.name}"
name "${project.name}"
url 'http://jfxtras.org'
description 'Miscellaneous components for JavaFX'
packaging 'jar'
licenses {
license {
name 'BSD'
url 'http://www.opensource.org/licenses/bsd-license.php'
distribution 'repo'
}
}
scm {
url 'scm:[email protected]:jfxtras/jfxtras.git'
connection 'scm:[email protected]:jfxtras/jfxtras.git'
developerConnection 'scm:[email protected]:jfxtras/jfxtras.git'
}
developers {
developer { name 'Tom Eugelink' }
}
}
}
}
}
project(':') {
dependencies {
compile project(':jfxtras-agenda') // just add dependencies that will cause all the rest to be added
}
apply plugin: 'com.github.johnrengelman.shadow'
// merge everything into one jar
// https://github.com/johnrengelman/shadow
shadowJar {
include(':jfxtras-*')
//transformer(AppendingTransformer) {
// resource = 'META-INF/services/jfxtras.fxml.BuilderService'
//}
//artifactAttached = false
}
artifacts {
// archives shadow.shadowJar
}
}
subprojects {
apply plugin: 'me.tatarka.retrolambda'
retrolambda {
defaultMethods true
}
//Excluding internal classes from Javadoc
javadoc {
exclude 'jfxtras/internal/*'
}
// all projects must be compatible with the java version specified here
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
// Needed until Gradle supports class-scanning for Java 8
tasks.withType(Test) {
scanForTestClasses = false
include "**/*Test.class"
include "**/*Test1.class"
exclude 'jfxtras/labs/test/JFXtrasGuiTest.class'
}
configurations {
asciidoclet
}
dependencies {
asciidoclet 'org.asciidoctor:asciidoclet:1.5.2'
}
javadoc {
options.docletpath = configurations.asciidoclet.files.asType(List)
options.doclet = 'org.asciidoctor.Asciidoclet'
}
task docJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
artifacts {
archives jar
archives docJar
archives sourcesJar
}
}
project(':jfxtras-agenda') {
dependencies {
compile project(':jfxtras-controls')
testCompile project(':jfxtras-test-support')
}
}
project(':jfxtras-common') {
dependencies {
testCompile project(':jfxtras-test-support')
}
}
project(':jfxtras-controls') {
dependencies {
compile project(':jfxtras-common')
compile project(':jfxtras-fxml')
testCompile project(':jfxtras-test-support')
}
}
project(':jfxtras-menu') {
dependencies {
compile project(':jfxtras-common')
testCompile project(':jfxtras-test-support')
}
}
project(':jfxtras-test-support') {
dependencies {
compile 'junit:junit:4.10'
compile 'org.mockito:mockito-all:1.9.5'
compile 'org.loadui:testFx:3.1.2'
}
}
task uberSourcesJar(type: Jar, dependsOn: subprojects.jar) {
archiveName = "jfxtras-all-${project.version}-sources.jar"
subprojects.each {
proj -> from {
println("Merging into uberJar: ${proj.sourcesJar.archivePath}")
zipTree(proj.sourcesJar.archivePath)
}
}
}
// TODO: _lib folder per project?
task copyToLib(type: Copy) {
into "_lib"
from project(':jfxtras-test-support').configurations.testCompile
}