-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
176 lines (130 loc) · 3.83 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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}
description 'Java Implementation of Shin Ichi Minato\'s Zero-Suppressed BDDs'
group 'de.sayayi.lib'
version '0.2.2'
layout.buildDirectory = '.build'
def jetbrainsAnnotationsVersion = '[24.0,26.1)'
def junitVersion = '5.11.+'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}
javadoc {
// javadoc 8 has various problems -> use javadoc 17
javadocTool = javaToolchains.javadocToolFor {
languageVersion = JavaLanguageVersion.of(17)
}
}
test {
useJUnitPlatform()
}
repositories {
mavenCentral()
}
dependencies {
// java
compileOnlyApi "org.jetbrains:annotations:${jetbrainsAnnotationsVersion}"
// test
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
def resolvedJetbrainsAnnotationsVersion = configurations
.compileClasspath
.resolvedConfiguration
.resolvedArtifacts
.find { it.name == 'annotations' }
.moduleVersion.id.version
javadoc {
title "Java ZBDD Library ${version}"
(options as StandardJavadocDocletOptions).with {
linksOffline "https://javadoc.io/doc/org.jetbrains/annotations/${resolvedJetbrainsAnnotationsVersion}/",
'gradle/javadocs/jetbrains-annotations'
encoding 'UTF-8'
group('ZBDD Core API', ['de.sayayi.lib.zbdd'])
group('ZBDD Cache API (Experimental)', ['de.sayayi.lib.zbdd.cache'])
noQualifiers 'java.util', 'java.lang'
addStringOption('Xdoclint:-missing', '-quiet')
}
failOnError false
}
tasks.withType(Jar).configureEach {
reproducibleFileOrder true
manifest {
attributes(
'Implementation-Vendor': 'Jeroen Gremmen',
'Implementation-Vendor-Id': 'de.sayayi',
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Created-By': "${System.getProperty('java.version')} (${System.getProperty('java.specification.vendor')})",
'Built-Date': new Date().format('yyyy-MM-dd HH:mm:ss')
)
}
from files('LICENSE')
}
tasks.register('javadocJar', Jar) {
archiveClassifier.set('javadoc')
from javadoc
}
tasks.register('sourcesJar', Jar) {
dependsOn classes
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
publishing {
publications {
create('maven', MavenPublication) {
from components.java
artifact javadocJar
artifact sourcesJar
pom {
name = 'Java ZBDD Library'
description = "Java Implementation of Shin Ichi Minato's Zero-Suppressed BDDs"
url = 'https://github.com/jgremmen/zbdd'
inceptionYear = '2021'
licenses {
license {
name = 'Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0'
distribution = 'repo'
}
}
developers {
developer {
id = 'jgremmen'
name = 'Jeroen Gremmen'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/jgremmen/zbdd.git'
developerConnection = 'scm:git:git://github.com/jgremmen/zbdd.git'
url = 'https://github.com/jgremmen/zbdd'
}
}
}
}
repositories {
maven {
name = 'mavenTemp'
url = layout.buildDirectory.dir('repository')
}
maven {
// maven central
url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
credentials {
username = project.findProperty('mavenCentral.username')
password = project.findProperty('mavenCentral.password')
}
}
}
}
signing {
sign publishing.publications.maven
}