-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
169 lines (154 loc) · 4.58 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
plugins {
id 'signing'
id 'java-library'
id 'maven-publish'
id "idea"
id "jacoco"
id 'org.jetbrains.kotlin.jvm' version '1.5.31'
}
group = 'com.seedfinding'
archivesBaseName = project.name
defaultTasks 'clean', 'test'
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
// Use maven { url "https://maven.seedfinding.com" } for releases !
maven { url "https://maven.seedfinding.com" }
}
dependencies {
implementation('com.seedfinding:mc_math:1.171.0') { transitive = false }
implementation('com.seedfinding:mc_seed:1.171.1') { transitive = false }
implementation('com.seedfinding:mc_core:1.192.1') { transitive = false }
implementation('com.seedfinding:mc_noise:1.171.1') { transitive = false }
implementation('com.seedfinding:mc_biome:1.171.1') { transitive = false }
testImplementation("org.junit.jupiter:junit-jupiter-api:${jupiterVersion}")
testImplementation("org.junit.jupiter:junit-jupiter-params:${jupiterVersion}")
testImplementation('org.junit-pioneer:junit-pioneer:1.3.8')
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${jupiterVersion}")
testRuntimeOnly('org.junit.platform:junit-platform-console:1.7.1')
}
compileJava {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
test {
useJUnitPlatform {
includeEngines("junit-jupiter")
maxHeapSize = "1G"
}
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
outputs.upToDateWhen { false }
showStandardStreams = true
showExceptions true
showCauses true
showStackTraces true
}
finalizedBy(jacocoTestReport)
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = "$project.name"
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = "$project.name"
description = 'A dead simple library to simulate Minecraft terrain in pure Java'
url = 'https://java.seedfinding.com/mcterrain'
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'hube12'
name = 'Neil'
}
developer {
id = 'kaptainwutax'
name = 'KaptainWutax'
}
}
scm {
connection = 'scm:git:https://github.com/SeedFinding/mc_terrain_java.git'
developerConnection = 'scm:git:ssh://github.com/SeedFinding/mc_terrain_java.git'
url = 'https://github.com/SeedFinding/mc_terrain_java'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://nexus.seedfinding.com/service/rest/repository/browse/maven-seedfinding/com/seedfinding/mc_terrain/"
def snapshotsRepoUrl = "https://nexus.seedfinding.com/service/rest/repository/browse/maven-seedfinding-snapshots/com/seedfinding/mc_terrain/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
signing {
if (signing.getSignatory() == null) {
System.err.println("Missing configuration driven signing key, defaulting to in memory.")
def signingKeyId = findProperty("signingKeyId")
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
if (signingKey == null || signingKey == null || signingPassword == null) {
System.err.println("Missing in memory signing key, defaulting to agent.")
useGpgCmd()
def s= signing.getSignatory()
// if (signing.getSignatory() == null || signing.getSignatory().getKeyId() == null) {
// System.err.println("Missing GPG agent.")
// gradle.taskGraph.whenReady { taskGraph ->
// tasks.findAll { t ->
// if (t.name == "signArchives") {
// t.enabled(false)
// System.err.println("No GPG signing agent, in memory or configuration driven GPG key were found, you can not use the sign method !")
// }
// }
// }
// }
} else {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
}
}
gradle.taskGraph.whenReady { taskGraph ->
tasks.findAll { t ->
if (t.name == "signArchives") {
if (t.enabled) {
t.doLast {
println "Signing was a success, congrats !"
}
}
}
}
}
sign publishing.publications.mavenJava
}