forked from trivago/fastutil-concurrent-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
143 lines (129 loc) · 4.21 KB
/
build.gradle
File metadata and controls
143 lines (129 loc) · 4.21 KB
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
plugins {
id "idea" // to download source- and javadoc jars
id "java-library"
id "io.freefair.lombok" version "latest.release"
id "net.ltgt.errorprone" version "latest.release"
id "com.vanniktech.maven.publish" version "latest.release"//? id 'maven-publish'
id "org.gradlex.reproducible-builds" version "latest.release"// https://github.com/gradlex-org/reproducible-builds
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
maven {
url = "https://plugins.gradle.org/m2/"
}
maven { url = "https://jitpack.io" }
}
}
tasks.withType(JavaCompile).configureEach { // ? gradle.projectsEvaluated {
options.encoding = 'UTF-8'
options.compilerArgs.addAll(['-Xlint:all,-serial', '-parameters'])
options.release.set(17)
options.deprecation = true
options.errorprone {
enabled = true
disableWarningsInGeneratedCode = true
excludedPaths = ".*/(generated|test).*/.*"
disable("UnusedVariable")
disable("MissingSummary")
disable("StringConcatToTextBlock")
errorproneArgs = ["-XepExcludedPaths:.*/test/.*"]
}
}
mavenPublishing {
pom {
name = "fastutil-concurrent-wrapper"
description = "Set of concurrent wrappers around fastutil primitive maps."
url = "https://github.com/trivago/fastutil-concurrent-wrapper"
licenses {
license {
name = "The Apache Software License, Version 2.0"
url = "https://opensource.org/licenses/Apache-2.0"
distribution = "repo"
}
}
developers {
developer {
id = "mchernyakov"
name = "Mikhail Chernyakov"
url = "https://github.com/mchernyakov"
}
developer {
id = "erdoganf"
name = "Fehim Erdogan"
url = "https://github.com/erdoganf"
}
developer {
id = "sarveswaran-m"
name = "Sarveswaran Meenakshisundaram"
url = "https://github.com/sarveswaran-m"
}
}
scm {
url = "https://github.com/magicprinc/fastutil-concurrent-wrapper"
connection = "scm:git:https://github.com/magicprinc/fastutil-concurrent-wrapper"
developerConnection = "scm:git:https://github.com/magicprinc/fastutil-concurrent-wrapper"
}
}
}
dependencies {
errorprone("com.google.errorprone:error_prone_core:latest.release")
// jmhAnnotationProcessor "com.google.errorprone:error_prone_core:2.36.0"
api('it.unimi.dsi:fastutil:latest.release')
compileOnly('org.jctools:jctools-core:latest.release')
implementation('org.jspecify:jspecify:latest.release')
// https://javadoc.io/doc/com.google.errorprone/error_prone_annotations/latest/index.html E.g: @CanIgnoreReturnValue
compileOnly("com.google.errorprone:error_prone_annotations:latest.release")
compileOnly('jakarta.validation:jakarta.validation-api:latest.release')
// TEST
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.13.+'
testImplementation 'org.junit.platform:junit-platform-launcher:1.13.+'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.13.+'
//testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.13.+'
testImplementation('org.jctools:jctools-core:latest.release')
}
test {
useJUnitPlatform()
enableAssertions = true
maxHeapSize = "2G"
workingDir project.projectDir // Set the working directory to the subproject directory, not current dir
systemProperty("user.dir", project.projectDir) // to be sure ^
println "[INFO] ${project.name}.workingDir == $workingDir"
}
testing {
suites {
test(JvmTestSuite) {
useJUnitJupiter()
}
}
}
jar {
archiveBaseName.set('fastutil-concurrent-wrapper')
}
java {
withSourcesJar()
}
// ./gradlew publish --no-daemon --no-parallel
// ./gradlew closeAndReleaseRepository
publishing {// https://docs.gradle.org/current/userguide/publishing_maven.html
repositories {
maven {
def releasesRepoUrl = "$buildDir/repos/releases"
def snapshotsRepoUrl = "$buildDir/repos/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
// publications {
// maven(MavenPublication) {
// from components.java
// suppressPomMetadataWarningsFor('runtimeElements')
// }
// }
}
lombok { version = "latest.release" }
tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
println "[INFO] ${project.group}:${project.name}:$version ⇒ ${tasks.jar.archiveFileName.get()} # JVM: ${System.getProperty("java.version")} Gradle: ${gradle.gradleVersion}"