-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
180 lines (157 loc) · 5.27 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
import java.time.Year
/*
Gradle build script for decimal-java.
Uploading archives:
publish -PcredentialsPassphrase=<credentials password>
*/
plugins {
id 'java-library'
id 'nu.studer.credentials' version '3.0'
id 'maven-publish'
id 'signing'
}
group 'org.firebirdsql'
version '2.0.1-SNAPSHOT'
ext.'signing.password' = credentials.forKey('signing.password')
ext.ossrhPassword = credentials.forKey('ossrhPassword')
ext.isReleaseVersion = provider {
!version.endsWith("SNAPSHOT")
}
dependencies {
testImplementation platform(testLibs.junit.bom)
}
java {
withJavadocJar()
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
testing {
suites {
configureEach {
useJUnitJupiter()
dependencies {
implementation.bundle(testLibs.bundles.junit)
}
targets {
configureEach {
testTask.configure {
testLogging {
events "passed", "skipped", "failed"
}
systemProperty 'file.encoding', 'UTF-8'
}
}
}
}
}
}
sourceSets {
tools {
java {
}
}
test {
java {
compileClasspath += tools.output
runtimeClasspath += tools.output
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
tasks.withType(Jar).configureEach {
// General manifest info
manifest {
def buildYear = Year.now().toString()
attributes(
'Created-By': "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
'Bundle-License': 'MIT',
'SPDX-License-Identifier': 'MIT',
'SPDX-FileCopyrightText': "2017-$buildYear Firebird development team and individual contributors"
)
}
}
tasks.named("jar", Jar) {
// Info specific to main jar
manifest {
attributes(
'Implementation-Title': project.name,
'Implementation-Version': project.version
)
}
}
tasks.named('javadoc', Javadoc).configure {
options.author()
options.windowTitle = "decimal-java API"
options.docTitle = 'decimal-java'
options.bottom = "Copyright © 2017-${new Date().format("yyyy")} Firebird development team and individual contributors. All rights reserved."
options.addBooleanOption('html5', true)
options.addBooleanOption('Xdoclint:none', true)
}
publishing {
publications {
// Main maven artifact
mavenJava(MavenPublication) {
from components.java
pom {
name = 'decimal-java'
packaging = 'jar'
description = 'A library to convert java.math.BigDecimal to and from ' +
'IEEE-754r (IEEE-754-2008) decimal byte representations.'
url = 'https://github.com/FirebirdSQL/decimal-java'
inceptionYear = '2017'
licenses {
license {
name = 'The MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'mrotteveel'
name = 'Mark Rotteveel'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:https://github.com/FirebirdSQL/decimal-java.git'
developerConnection = 'scm:git:[email protected]:FirebirdSQL/decimal-java.git'
url = 'https://github.com/FirebirdSQL/decimal-java'
}
mailingLists {
mailingList {
name = 'firebird-java'
subscribe = '[email protected]'
unsubscribe = '[email protected]'
post = '[email protected]'
archive = 'https://groups.google.com/g/firebird-java'
otherArchives = ['http://fb-list-archive.s3-website-eu-west-1.amazonaws.com/firebird-java/index.html']
}
}
}
}
}
repositories {
maven {
url = project.isReleaseVersion.get() ? project.releaseRepository : project.snapshotRepository
credentials {
username = findProperty('ossrhUsername') ?: null
password = findProperty('ossrhPassword') ?: null
}
}
}
}
tasks.withType(PublishToMavenRepository).each {
it.doFirst {
if (findProperty('ossrhUsername') == null || findProperty('ossrhPassword') == null) {
throw new RuntimeException('No credentials for publishing, make sure to specify the properties ' +
'credentialsPassphrase, or ossrhUsername and ossrhPassword. See devdoc/publish.md for details.')
}
}
}
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask(':publish') }
sign publishing.publications.mavenJava
}