-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
194 lines (183 loc) · 6.5 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
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
}
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$gradleBintrayPluginVersion"
}
}
apply plugin: 'java'
apply plugin: 'distribution'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
group 'info.picocli'
description '${rootProject.name} - Create native Windows executable command line applications with colors in Java.'
version "$projectVersion"
ext.moduleName = 'info.picocli'
sourceCompatibility = 1.6
targetCompatibility = 1.6
repositories {
jcenter()
mavenCentral()
}
dependencies {
compile "org.fusesource.jansi:jansi:$jansiVersion"
}
jar {
manifest {
attributes 'Specification-Title': 'Picocli Jansi GraalVM',
'Specification-Vendor' : 'Remko Popma',
'Specification-Version' : version,
'Implementation-Title' : 'Picocli Jansi GraalVM',
'Implementation-Vendor' : 'Remko Popma',
'Implementation-Version': version,
'Automatic-Module-Name' : 'info.picocli.jansi.graalvm'
}
}
javadoc {
destinationDir = file("build/docs/apidocs")
}
javadoc.options.addStringOption('Xdoclint:none', '-quiet')
// work around https://github.com/gradle/gradle/issues/4046
javadoc.dependsOn('copyJavadocDocFiles')
task copyJavadocDocFiles(type: Copy) {
from('src/main/java')
into 'build/docs/apidocs'
include '**/doc-files/*.*'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task testJar(type: Jar, dependsOn: compileTestJava) {
from sourceSets.test.output
classifier = 'tests'
}
task sourcesJar(type: Jar) {
from sourceSets.main.java.srcDirs
classifier = 'sources'
}
task testSourcesJar(type: Jar) {
from sourceSets.test.java.srcDirs
classifier = 'test-sources'
}
artifacts {
archives javadocJar
archives sourcesJar
archives testSourcesJar
archives testJar
archives jar
}
distributions {
main {
baseName = "$archivesBaseName-all"
contents {
from jar
from sourcesJar
from testJar
from testSourcesJar
from javadocJar
from ('LICENSE')
from ("$rootDir/RELEASE-NOTES.md")
}
}
}
ext {
bintrayUsername = System.getenv('BINTRAY_USER')
bintrayApiKey = System.getenv('BINTRAY_KEY')
mavenOssUser = System.getenv('MAVEN_OSS_USER')
mavenOssPassword = System.getenv('MAVEN_OSS_PASSWORD')
// pom configuration for MavenPublication
pomConfig = {
licenses {
license {
name "The Apache Software License, version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id "rpopma"
name "Remko Popma"
email "[email protected]"
}
}
scm {
url "https://github.com/remkop/${rootProject.name}/tree/master"
connection "scm:git:https://github.com/remkop/${rootProject.name}.git"
developerConnection "scm:git:ssh://github.com:remkop/${rootProject.name}.git"
}
}
}
ext {
bintrayPackage = "${rootProject.name}"
bintrayWebsiteUrl = "https://github.com/remkop/${rootProject.name}"
bintrayLabels = ['jansi', 'GraalVM', 'SubstrateVM', 'native image', 'picocli']
}
ext {
bintrayDryRun = false //[Default: false] Whether to run this as dry-run, without deploying
bintrayPublish = true //[Default: false] Whether version should be auto published after an upload
bintrayOverride = false //[Default: false] Whether to override version artifacts already published
mavenOssSync = true //[Default: true] Determines whether to sync the version to Maven Central.
}
bintray {
user = bintrayUsername
key = bintrayApiKey
publications = ['MyPublication']
dryRun = bintrayDryRun //[Default: false] Whether to run this as dry-run, without deploying
publish = bintrayPublish //[Default: false] Whether version should be auto published after an upload
override = bintrayOverride //[Default: false] Whether to override version artifacts already published
//Package configuration. The plugin will use the repo and name properties to check if the package already exists. In that case, there's no need to configure the other package properties (like userOrg, desc, etc).
pkg {
repo = 'picocli'
name = bintrayPackage
userOrg = 'remkop'
licenses = ['Apache-2.0']
desc = description
websiteUrl = bintrayWebsiteUrl
issueTrackerUrl = "https://github.com/remkop/${rootProject.name}/issues"
vcsUrl = "https://github.com/remkop/${rootProject.name}.git"
labels = bintrayLabels
publicDownloadNumbers = false
version {
name = "$projectVersion"
desc = description
released = new Date()
vcsTag = "v$projectVersion"
mavenCentralSync {
sync = mavenOssSync //[Default: true] Determines whether to sync the version to Maven Central.
user = mavenOssUser //OSS user token: mandatory
password = mavenOssPassword //OSS user password: mandatory
close = '1' //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually.
}
}
}
}
publishing {
publications {
MyPublication(MavenPublication) {
from components.java
artifact sourcesJar
artifact testJar
artifact testSourcesJar
artifact javadocJar
groupId 'info.picocli'
artifactId bintrayPackage
version "$projectVersion"
pom.withXml {
def root = asNode()
root.appendNode('packaging', 'jar')
root.appendNode('name', bintrayPackage)
root.appendNode('description', description)
root.appendNode('url', "https://github.com/remkop/${rootProject.name}")
root.appendNode('inceptionYear', '2019')
root.children().last() + pomConfig
}
}
}
}