This repository has been archived by the owner on May 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
189 lines (164 loc) · 5.88 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
181
182
183
184
185
186
187
188
189
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
buildscript {
repositories {
jcenter()
maven { url 'https://plugins.gradle.org/m2/' }
mavenCentral()
}
dependencies {
classpath group: 'org.jetbrains.kotlin', name: 'kotlin-gradle-plugin', version: '1.3.72'
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.5.31"
}
}
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
id 'io.codearte.nexus-staging' version '0.20.0'
id "de.marcphilipp.nexus-publish" version '0.2.0'
}
repositories {
mavenCentral()
mavenLocal()
jcenter()
}
nexusStaging {
packageGroup = "com.github.shynixn"
username = project.hasProperty("ossrhUsername") ? project.findProperty("ossrhUsername") : System.getenv('SONATYPE_USERNAME')
password = project.hasProperty("ossrhPassword") ? project.findProperty("ossrhPassword") : System.getenv('SONATYPE_PASSWORD')
delayBetweenRetriesInMillis = 10000
numberOfRetries = 100
}
allprojects {
apply plugin: 'jacoco'
apply plugin: 'org.jetbrains.dokka'
}
tasks.register("printVersion") {
println(this.subprojects.getAt(0).version)
}
subprojects {
group 'com.github.shynixn.structureblocklib'
version '2.13.0'
apply plugin: 'kotlin-platform-jvm'
apply plugin: 'signing'
apply plugin: 'maven-publish'
apply plugin: 'java-library'
apply plugin: "de.marcphilipp.nexus-publish"
sourceCompatibility = 1.8
targetCompatibility = 1.8
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = false
}
}
test {
useJUnitPlatform()
testLogging.showStandardStreams = true
failFast = true
testLogging {
events(TestLogEvent.FAILED, TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.STARTED)
displayGranularity = 0
showExceptions = true
showCauses = true
showStackTraces = true
exceptionFormat = TestExceptionFormat.FULL
}
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
classifier = 'sources'
}
tasks.named("dokkaHtml") {
outputDirectory = file("$buildDir/javadoc")
}
task javadocJar(type: Jar, dependsOn: dokkaHtml) {
from javadoc
classifier = 'javadoc'
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'StructureBlockLib'
description = 'StructureBlockLib is a bukkit implementation for handling structures on spigot server.'
url = 'https://github.com/Shynixn/StructureBlockLib'
licenses {
license {
name = 'MIT License'
url = 'http://www.opensource.org/licenses/mit-license.php'
}
}
developers {
developer {
name = 'Shynixn'
url = 'https://github.com/Shynixn'
}
}
contributors {
contributor {
name = 'HielkePlugins'
url = 'https://github.com/HielkePlugins'
}
}
scm {
connection = 'scm:git:git://github.com/Shynixn/StructureBlockLib.git'
developerConnection = 'scm:git:ssh://github.com:Shynixn/StructureBlockLib.git'
url = 'http://github.com/Shynixn/StructureBlockLib.git/tree/master'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = project.hasProperty("ossrhUsername") ? project.findProperty("ossrhUsername") : System.getenv('SONATYPE_USERNAME')
password = project.hasProperty("ossrhPassword") ? project.findProperty("ossrhPassword") : System.getenv('SONATYPE_PASSWORD')
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
repositories {
mavenCentral()
mavenLocal()
jcenter()
}
dependencies {
testCompile 'org.jetbrains.kotlin:kotlin-test'
testCompile 'org.jetbrains.kotlin:kotlin-test-junit'
testCompile 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testCompile 'org.mockito:mockito-core:3.7.7'
testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
}
}
gradle.taskGraph.whenReady { taskGraph ->
if (project.findProperty("signing.keyId") == null) {
ext."signing.keyId" = System.getenv('SIGNING_KEY_ID')
ext."signing.password" = System.getenv('SIGNING_KEY_PASSWORD')
ext."signing.secretKeyRingFile" = System.getenv('SIGNING_KEY_FILE')
}
}
task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
}
task generateJavaDocPages(type: org.jetbrains.dokka.gradle.DokkaTask) {
dokkaSourceSets {
named("main") {
outputDirectory = file("docs/apidocs")
sourceRoots.from(file("structureblocklib-api/src/main/java"))
sourceRoots.from(file("structureblocklib-bukkit-api/src/main/java"))
}
}
}