-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
240 lines (190 loc) · 5.32 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
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.9.0'
}
}
if(project.hasProperty('ossrhUser') && project.hasProperty("release")) {
apply plugin: "io.codearte.nexus-staging"
nexusStaging {
packageGroup = 'org.mini2Dx'
username = ossrhUser
password = ossrhPassword
}
}
ext {
antlrVersion = '4.7.3'
junitVersion="4.8.1"
jmockVersion="2.5.1"
}
subprojects {
apply plugin: "eclipse"
apply plugin: "idea"
tasks.eclipse.doLast {
delete ".project"
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
maven { url 'https://maven.google.com' }
}
}
def mavenProjects() {
subprojects.findAll { !it.name.contains('antlr') }
}
def projectVersion = '1.11.0';
def docProjects() {
subprojects.findAll { !it.name.contains('gradle') && !it.name.contains('antlr') }
}
configure(mavenProjects()) {
apply plugin: "signing"
apply plugin: "maven"
apply plugin: "java"
group = 'org.mini2Dx'
version = projectVersion
apply plugin: "java"
sourceCompatibility = 1.7
targetCompatibility = 1.7
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
tasks.withType(Test) {
systemProperty "file.encoding", "UTF-8"
}
artifacts {
archives javadocJar, sourcesJar
}
if(project.hasProperty('ossrhUser')) {
signing {
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
// POM signature
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
// Target repository
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUser, password: ossrhPassword)
}
pom.project {
name project.name
description project.description
packaging 'jar'
url 'https://github.com/mini2Dx/gettext'
scm {
connection 'scm:git:https://github.com/mini2Dx/gettext.git'
developerConnection 'scm:git:[email protected]:mini2Dx/gettext.git'
url 'https://github.com/mini2Dx/gettext.git'
}
licenses {
license {
name 'Apache License 2.0'
url 'https://opensource.org/licenses/Apache-2.0'
distribution 'repo'
}
}
developers {
developer {
id = 'tomcashman'
name = 'Thomas Cashman'
email = '[email protected]'
}
}
}
}
}
}
}
}
project(":gettext-antlr") {
apply plugin: 'antlr'
description = 'ANTLR4 grammar for GNU gettext'
sourceCompatibility = 1.7
targetCompatibility = 1.7
dependencies {
antlr "com.tunnelvisionlabs:antlr4:$antlrVersion"
}
generateGrammarSource {
arguments += ["-package", "org.mini2Dx.gettext.antlr"]
}
}
project(":gettext-lib") {
description = 'Library for using GNU gettext'
task copyAntlrSourcesToProject(type: Copy, dependsOn: project(":gettext-antlr").compileJava) {
from "$projectDir/../gettext-antlr/build/generated-src/antlr/main/"
into "$projectDir/src/main/java/org/mini2Dx/gettext/antlr/"
}
dependencies {
compile "com.tunnelvisionlabs:antlr4-runtime:$antlrVersion"
testCompile "junit:junit:$junitVersion"
testCompile "org.jmock:jmock-legacy:$jmockVersion"
testCompile "org.jmock:jmock-junit4:$jmockVersion"
}
compileJava.dependsOn copyAntlrSourcesToProject
}
project(":gettext-xlsx") {
description = 'Library to convert .po files to/from xlsx'
dependencies {
compile project(":gettext-lib")
compile "org.apache.poi:poi-ooxml:4.1.2"
testCompile "junit:junit:$junitVersion"
testCompile "org.jmock:jmock-legacy:$jmockVersion"
testCompile "org.jmock:jmock-junit4:$jmockVersion"
}
if(!project.version.contains("SNAPSHOT")) {
task docs(type: Javadoc) {
failOnError = false
title = 'gettext'
source docProjects().collect {p -> p.sourceSets.main.allJava }
classpath = files(docProjects().collect {p -> p.sourceSets.main.compileClasspath})
destinationDir = rootProject.file("docs/javadoc/${projectVersion}")
}
}
}
project(":gettext-extractor") {
apply plugin: 'antlr'
apply plugin: 'application'
description = "Extracts .pot files from source files"
application {
mainClassName = 'org.mini2Dx.gettext.extractor.Main'
}
dependencies {
compile project(":gettext-lib")
compile "com.tunnelvisionlabs:antlr4-runtime:$antlrVersion"
antlr "com.tunnelvisionlabs:antlr4:$antlrVersion"
testCompile "junit:junit:$junitVersion"
testCompile gradleTestKit()
}
generateGrammarSource {
arguments += ["-package", "org.mini2Dx.gettext.extractor.antlr"]
}
}
project(":gettext-gradle-plugin") {
apply plugin: 'groovy'
apply plugin: 'antlr'
description = 'Gradle plugin for generating .pot files from source files'
dependencies {
compile gradleApi()
compile localGroovy()
compile project(":gettext-lib")
compile project(":gettext-extractor")
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.10.3'
}