-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.gradle
141 lines (116 loc) · 3.54 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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.2.1'
}
import java.text.SimpleDateFormat
def globalVersion = new Version(version)
allprojects {
repositories {
mavenCentral()
jcenter()
}
apply plugin: 'idea'
configure(subprojects.findAll { new File(it.projectDir, 'src/main/java').directory }) {
apply plugin: 'java'
}
version = globalVersion
status = version.status
}
// standard setup for all Java project
subprojects {
// deploy all Java projects into Bintray JCenter
if (project.plugins.hasPlugin('java')) {
// merge Java and YAML files together in one source folder
sourceSets {
main {
resources {
srcDir 'src/main/java'
}
}
test {
resources {
srcDir 'src/test/java'
}
}
}
dependencies {
// test support
testCompile "org.slf4j:slf4j-simple:${slf4jVersion}"
testCompile "junit:junit:4.12"
}
task sourceJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
}
}
// published projects configuration
configure([project(':core'), project(':swing:swing-core'),project(':swing:swing-glazedlists')]) {
// publishing artifacts to Bintray JCenter
configurations {
published
}
// upload to JCenter
artifacts {
published sourceJar
published javadocJar
}
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven'
ext.publish = true
bintray {
// grab credentials from environment variables
user = "$System.env.BINTRAY_USER"
key = "$System.env.BINTRAY_API_KEY"
configurations = ['published', 'archives']
dryRun = false //Whether to run this as dry-run, without deploying
publish = true //If version should be auto published after an upload
pkg {
repo = 'javabuilders'
name = project.name
desc = 'Maximum productivity with minimum code via declarative UIs for Java.'
websiteUrl = 'https://github.com/jacek99/javabuilders'
issueTrackerUrl = 'https://github.com/jacek99/javabuilders/issues'
vcsUrl = 'https://github.com/jacek99/javabuilders'
licenses = ['Apache-2.0']
publicDownloadNumbers = true
}
}
}
class Version {
String originalVersion
String thisVersion
String status
Date buildTime
Version(String versionValue) {
buildTime = new Date()
originalVersion = versionValue
if (originalVersion.endsWith('-SNAPSHOT')) {
status = 'integration'
thisVersion = originalVersion.substring(0, originalVersion.length() - 'SNAPSHOT'.length()) + getTimestamp()
} else {
status = 'release'
thisVersion = versionValue
}
}
String getTimestamp() {
// Convert local file timestamp to UTC
def format = new SimpleDateFormat('yyyyMMddHHmmss')
format.setCalendar(Calendar.getInstance(TimeZone.getTimeZone('UTC')));
return format.format(buildTime)
}
String toString() {
thisVersion
}
}