-
Notifications
You must be signed in to change notification settings - Fork 184
/
build.gradle
172 lines (145 loc) · 4.76 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
buildscript {
repositories {
mavenCentral()
}
dependencyLocking {
lockAllConfigurations()
}
}
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'jacoco'
id 'de.undercouch.download' version 'latest.release'
id 'me.champeau.gradle.jmh' version 'latest.release'
}
group = "de.bwaldvogel"
version = '2.44'
java {
sourceCompatibility = '11'
targetCompatibility = '11'
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs.addAll(['-Xlint:all', '-Werror'])
}
jar {
manifest {
attributes 'Implementation-Title': project.name, 'Implementation-Version': archiveVersion
}
}
task sourceJar(type: Jar) {
archiveClassifier = "sources"
from sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = "javadoc"
from javadoc.destinationDir
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = project.group
artifactId = project.name
version = project.version
pom {
name = project.name
description = 'Java port of Liblinear'
url = 'https://github.com/bwaldvogel/liblinear'
inceptionYear = '2008'
licenses {
license {
name = 'The BSD License'
url = 'http://www.opensource.org/licenses/bsd-license.php'
distribution = 'repo'
}
}
developers {
developer {
id = 'bwaldvogel'
name = 'Benedikt Waldvogel'
email = '[email protected]'
}
}
scm {
url = '[email protected]:bwaldvogel/liblinear.git'
connection = 'scm:git:[email protected]:bwaldvogel/liblinear.git'
developerConnection = 'scm:git:[email protected]:bwaldvogel/liblinear.git'
}
}
from components.java
artifact sourceJar
artifact javadocJar
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
}
}
repositories {
maven {
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
credentials {
username = project.hasProperty('nexusUsername') ? project.property('nexusUsername') : System.getenv('NEXUS_USERNAME')
password = project.hasProperty('nexusPassword') ? project.property('nexusPassword') : System.getenv('NEXUS_PASSWORD')
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications.mavenJava
}
repositories {
mavenCentral()
}
jacocoTestReport {
reports {
html.required = true
xml.required = true
csv.required = false
}
dependsOn test
}
apply from: 'datasets.gradle'
test.dependsOn downloadAndVerifyDatasets
test {
useJUnitPlatform()
maxHeapSize = "256m"
}
wrapper {
gradleVersion = "8.12"
distributionType = Wrapper.DistributionType.ALL
}
jmh {
include = ['de\\.bwaldvogel\\.liblinear\\.LinearBenchmark.*']
jvmArgs = ["-Ddataset.directory=" + projectDir + "/src/test/datasets"]
}
tasks.named('jmh').configure {
dependsOn downloadAndVerifyRcv1
}
dependencies {
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: 'latest.release'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: 'latest.release'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: 'latest.release'
testImplementation group: 'org.slf4j', name: 'slf4j-api', version: 'latest.release'
testImplementation group: 'org.assertj', name: 'assertj-core', version: 'latest.release'
testImplementation group: 'org.mockito', name: 'mockito-core', version: 'latest.release'
testImplementation group: 'nl.jqno.equalsverifier', name: 'equalsverifier', version: 'latest.release'
testRuntimeOnly group: 'ch.qos.logback', name: 'logback-classic', version: 'latest.release'
jmh group: 'org.apache.commons', name: 'commons-compress', version: 'latest.release'
jmh 'org.openjdk.jmh:jmh-generator-annprocess:latest.release' // for IntelliJ
components.all { ComponentMetadataDetails details ->
if (details.id.version =~ /(?i).+(-|\.)(CANDIDATE|RC|BETA|ALPHA|PR|M\d+).*/) {
details.status = 'milestone'
}
}
}
dependencyLocking {
lockAllConfigurations()
}