-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
247 lines (216 loc) · 7.69 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.61'
id 'com.jfrog.bintray' version '1.8.4'
id 'maven'
id 'org.jetbrains.dokka' version '0.9.18'
id 'org.ajoberstar.git-publish' version '2.1.1'
id 'com.github.johnrengelman.shadow' version '5.0.0'
}
group 'br.com.gamemods'
version '3.1.0-SNAPSHOT'
sourceSets.main.java.srcDirs = ["src/main/kotlin"]
sourceSets.test.java.srcDirs = ["src/test/kotlin"]
sourceCompatibility = 1.8
targetCompatibility = sourceCompatibility
repositories {
jcenter()
maven { url 'https://hub.spigotmc.org/nexus/content/groups/public/' }
maven { url 'https://dl.bintray.com/orangy/maven' }
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-reflect'
implementation group: 'net.md-5', name: 'bungeecord-chat', version: '1.15-SNAPSHOT'
compile 'br.com.gamemods:region-manipulator:2.0.0'
implementation 'org.jetbrains.kotlinx:kotlinx-cli-jvm:0.1.0-dev-4'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
install {
repositories.mavenInstaller {
pom.project {
packaging 'jar'
groupId project.group
artifactId 'java2nukkit-world-converter'
version project.version
name project.name
description "Converts worlds from Minecraft 1.14+ Java Edition to the newest Nukkit MCA file format"
url "https://github.com/GameModsBR/Java2Nukkit-World-Converter"
inceptionYear '2019'
licenses {
license {
name 'MIT'
url 'https://raw.githubusercontent.com/GameModsBR/Java2Nukkit-World-Converter/master/LICENSE'
distribution 'repo'
}
}
developers {
developer {
id = 'joserobjr'
name = 'José Roberto de Araújo Júnior'
email = '[email protected]'
}
}
scm {
connection "https://github.com/GameModsBR/Java2Nukkit-World-Converter.git"
developerConnection "https://github.com/GameModsBR/Java2Nukkit-World-Converter.git"
url "https://github.com/GameModsBR/Java2Nukkit-World-Converter"
}
}
}
}
if (!ext.has('gamemodsBintrayUser')) {
ext.gamemodsBintrayUser = ""
}
if (!ext.has('gamemodsBintrayApiKey')) {
ext.gamemodsBintrayApiKey = ""
}
bintray {
user = "$gamemodsBintrayUser"
key = "$gamemodsBintrayApiKey"
configurations = ['archives']
pkg {
repo = 'GameMods'
name = 'Java2Nukkit-World-Converter'
userOrg = 'gamemods'
licenses = ['MIT']
vcsUrl = 'https://github.com/GameModsBR/Java2Nukkit-World-Converter.git'
websiteUrl = 'https://github.com/GameModsBR/Java2Nukkit-World-Converter'
//publish = false
version {
name = project.version
desc = "Java2Nukkit-World-Converter version ${project.version}"
//released = new Date()
vcsTag = "v${project.version}"
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
//passphrase = '123' //Optional. The passphrase for GPG signing'
}
}
}
}
jar {
from file("$projectDir/LICENSE")
}
task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = 'javadoc'
outputDirectory = "$buildDir/javadoc"
}
task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
archiveClassifier.set('javadoc')
from dokkaJavadoc.outputDirectory
from file("$projectDir/LICENSE")
from file("$projectDir/README.md")
from file("$projectDir/CHANGELOG.md")
from file("$projectDir/REPLACEMENTS.md")
from file("$projectDir/MISSING_FEATURES.md")
// options.encoding = 'UTF-8'
}
task dokkaKdoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = 'gfm'
outputDirectory = "$buildDir/kdoc"
}
import java.nio.file.Files
import java.nio.file.Paths
import java.nio.file.StandardCopyOption
task createReadmeFiles(dependsOn: dokkaKdoc) {
doFirst {
Files.walk(Paths.get(dokkaKdoc.outputDirectory))
.filter { it.getFileName().toString().toLowerCase() == "index.md" }
.forEach {
try {
Files.copy(it, it.resolveSibling("README.md"), StandardCopyOption.REPLACE_EXISTING)
} catch (Throwable e) {
throw new RuntimeException(e)
}
}
}
}
task createIndexMd(type: Copy) {
from file("$projectDir/README.md")
into "$buildDir/pages"
rename 'README.md', 'index.md'
}
task sourcesJar(type: Jar) {
from sourceSets.main.java.srcDirs
from file("$projectDir/build.gradle")
from file("$projectDir/gradle.properties")
from file("$projectDir/settings.gradle")
from file("$projectDir/LICENSE")
from file("$projectDir/README.md")
from file("$projectDir/CHANGELOG.md")
from file("$projectDir/REPLACEMENTS.md")
from file("$projectDir/MISSING_FEATURES.md")
archiveClassifier.set('sources')
}
artifacts {
archives sourcesJar
}
// dokka will fail to build the javadoc jar on newest java versions
// https://github.com/Kotlin/dokka/issues/294
if (JavaVersion.current().majorVersion == "8") {
artifacts {
archives javadocJar
}
dokka {
packageOptions {
prefix = "br.com.gamemods.j2nwc.internal"
suppress = true
}
}
if (ext.has('org.ajoberstar.grgit.auth.username')) {
System.setProperty('org.ajoberstar.grgit.auth.username', ext['org.ajoberstar.grgit.auth.username'].toString())
System.setProperty('org.ajoberstar.grgit.auth.password', ext['org.ajoberstar.grgit.auth.password'].toString())
}
gitPublish {
// where to publish to (repo must exist)
repoUri = 'https://github.com/GameModsBR/Java2Nukkit-World-Converter.git'
// where to fetch from prior to fetching from the remote (i.e. a local repo to save time)
referenceRepoUri = file("$projectDir/gh-pages").toURI().toString()
// branch will be created if it doesn't exist
branch = 'gh-pages'
// generally, you don't need to touch this
repoDir = file("$buildDir/gh-pages-repo") // defaults to $buildDir/gitPublish
// what to publish, this is a standard CopySpec
contents {
from("$buildDir/javadoc") {
into 'javadoc'
}
from("$buildDir/kdoc") {
into 'kdoc'
}
from "$buildDir/pages"
from 'src/pages'
from 'README.md'
from 'MISSING_FEATURES.md'
from 'REPLACEMENTS.md'
from 'CHANGELOG.md'
}
// what to keep in the existing branch (include=keep)
preserve {
include '1.0.0/**'
exclude '1.0.0/temp.txt'
}
// message used when committing changes
commitMessage = 'Github Pages update' // defaults to 'Generated by gradle-git-publish'
}
}
gitPublishCopy.dependsOn dokkaJavadoc
gitPublishCopy.dependsOn createReadmeFiles
gitPublishCopy.dependsOn createIndexMd
shadowJar {
archiveClassifier.set('cli')
manifest {
attributes 'Main-Class': 'br.com.gamemods.j2nwc.WorldConverterCLI'
}
from file("$projectDir/README.md")
from file("$projectDir/CHANGELOG.md")
from file("$projectDir/REPLACEMENTS.md")
from file("$projectDir/MISSING_FEATURES.md")
}
build.finalizedBy shadowJar