-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
129 lines (115 loc) · 3.22 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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'com.github.spotbugs' version '5.0.14'
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
withSourcesJar()
withJavadocJar()
}
version = '1.2'
group = 'org.omegat'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'junit:junit:4.13.2'
}
test {
useJUnit()
// Test in headless mode with ./gradlew test -Pheadless
if (project.hasProperty('headless') || System.getenv("CI")) {
systemProperty 'java.awt.headless', 'true'
}
}
sourceSets {
main {
java {
srcDir 'src'
}
resources {
srcDir 'src'
}
}
test {
java {
srcDir 'test/src'
}
resources {
srcDir 'test/src'
srcDir 'test/data'
}
}
}
tasks.check.dependsOn(javadoc)
jar {
manifest {
attributes('Automatic-Module-Name': 'org.omegat.mnemonics')
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
spotbugsMain {
reports {
html {
required = true
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'org.omegat'
artifactId = 'lib-mnemonics'
from components.java
pom {
name = 'OmegaT'
description = 'The free translation memory tool'
url = 'https://omegat.org'
scm {
connection = "scm:git:https://github.com/omegat-org/lib-mnemonics/"
developerConnection = "scm:git:https:/github.com/omegat-org/lib-mnemonics/"
url = "https://github.com/omegat-org/lib-mnemonics/"
}
licenses {
license {
name = 'The GNU General Public License, Version 3.0'
url = 'https://www.gnu.org/licenses/licenses/gpl-3.0.html'
}
}
developers {
developer {
id = 'omegat'
name = 'OmegaT Developers'
email = '[email protected]'
}
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
if (!findProperty("signing.keyId")) {
useGpgCmd()
}
}
def sonatypeUsername = project.hasProperty("sonatypeUsername")? project.property('sonatypeUsername').toString() : System.getenv('SONATYPE_USER')
def sonatypePassword = project.hasProperty("sonatypePassword")? project.property('sonatypePassword').toString() : System.getenv('SONATYPE_PASS')
if (sonatypeUsername != null && sonatypePassword != null) {
nexusPublishing.repositories{
sonatype {
nexusUrl.set(new URI("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(new URI("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username.set(sonatypeUsername)
password.set(sonatypePassword)
}
}
}
tasks.sourcesJar {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}