-
Notifications
You must be signed in to change notification settings - Fork 189
/
build.gradle
204 lines (167 loc) · 5.59 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
plugins {
id "com.github.johnrengelman.shadow" version "1.2.4"
id "com.jfrog.bintray" version "1.7"
id "co.riiid.gradle" version "0.4.2"
}
apply plugin: 'java'
apply plugin: 'maven-publish'
def projectVersion = System.getenv('PROJECT_VERSION') != null ? System.getenv('PROJECT_VERSION') : 'dev'
def projectCompilerArgs = ["-Xlint:all", "-Xlint:-processing", "-Xlint:-serial", "-Werror"]
compileJava {
options.compilerArgs = projectCompilerArgs
}
compileTestJava {
options.compilerArgs = projectCompilerArgs
}
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2" }
maven { url "http://repo.bodar.com" }
}
task javadocJar(type: Jar, dependsOn: shadowJar) {
baseName "javarepl"
version projectVersion
from javadoc
}
task sourceJar(type: Jar, dependsOn: shadowJar) {
baseName "javarepl"
version projectVersion
from sourceSets.main.allSource
}
def pomConfig = {
url 'http://www.javarepl.com'
name 'Java REPL'
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 "albertlatacz"
name "Albert Latacz"
email "[email protected]"
}
}
scm {
url '[email protected]:albertlatacz/java-repl.git'
connection 'scm:[email protected]:albertlatacz/java-repl.git'
}
}
publishing {
repositories {
jcenter()
}
publications {
shadow(MavenPublication) {
groupId 'com.javarepl'
artifactId 'javarepl'
version projectVersion
from components.shadow
artifact sourceJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
pom.withXml {
def root = asNode()
root.appendNode('description', 'Java REPL is a simple Read-Eval-Print-Loop for Java language.')
root.children().last() + pomConfig
}
}
}
}
github {
owner = 'albertlatacz'
repo = 'java-repl'
token = System.getenv('GITHUB_TOKEN') == null ? "UNSPECIFIED" : System.getenv('GITHUB_TOKEN')
tagName = projectVersion
targetCommitish = 'master'
assets = [
"build/libs/javarepl-${projectVersion}.jar",
"build/libs/javarepl-${projectVersion}-sources.jar",
"build/libs/javarepl-${projectVersion}-javadoc.jar"
]
}
bintray {
user = System.getenv("BINTRAY_USERNAME")
key = System.getenv("BINTRAY_API_KEY")
publications = ['shadow']
publish = true
pkg {
repo = 'maven'
name = 'java-repl'
desc = 'Java REPL is a simple Read-Eval-Print-Loop for Java language.'
websiteUrl = 'http://www.javarepl.com'
issueTrackerUrl = 'https://github.com/albertlatacz/java-repl/issues'
vcsUrl = 'https://github.com/albertlatacz/java-repl.git'
licenses = ['Apache-2.0']
labels = ['java', 'repl']
publicDownloadNumbers = true
githubRepo = 'albertlatacz/java-repl'
githubReleaseNotesFile = 'README.md'
version {
name = projectVersion
desc = 'Auto-releasing Java REPL v.' + projectVersion +'!'
vcsTag = projectVersion
//Optional configuration for Maven Central sync of the version
mavenCentralSync {
sync = true//[Default: true] Determines whether to sync the version to Maven Central.
user = System.getenv("MAVEN_CENTRAL_USER_TOKEN") //OSS user token: mandatory
password = System.getenv("MAVEN_CENTRAL_USER_TOKEN_PASSWORD") //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.
}
}
}
}
shadowJar {
baseName = "javarepl"
classifier = null
version = projectVersion
relocate 'com.googlecode.totallylazy', 'javarepl.internal.totallylazy'
relocate 'com.googlecode.lazyparsec', 'javarepl.internal.lazyparsec'
relocate 'com.googlecode.utterlyidle', 'javarepl.internal.utterlyidle'
relocate 'com.googlecode.yadic', 'javarepl.internal.yadic'
relocate 'jline', 'javarepl.internal.jline'
relocate 'org.mozilla', 'javarepl.internal.mozilla'
relocate 'com.yahoo', 'javarepl.internal.yahoo'
relocate 'jargs', 'javarepl.internal.jargs'
}
sourceSets {
main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['src']
}
}
test {
java {
srcDirs = ['test']
}
}
}
jar {
manifest {
attributes 'Main-Class': 'javarepl.Main'
attributes 'Specification-Title': 'java-repl'
attributes 'Specification-Version': projectVersion
attributes 'Specification-Vendor': 'Albert Latacz'
attributes 'Implementation-Title': 'java-repl'
attributes 'Implementation-Version': projectVersion
attributes 'Implementation-Vendor': 'Albert Latacz'
}
}
dependencies {
compile "com.googlecode.totallylazy:totallylazy:2.249"
compile "com.googlecode.utterlyidle:utterlyidle:2.108"
compile "com.googlecode.yadic:yadic:2.48"
compile "jline:jline:2.14.2"
testCompile "org.hamcrest:hamcrest-core:1.3"
testCompile "org.hamcrest:hamcrest-library:1.3"
testCompile "junit:junit-dep:4.8.2"
}