This repository has been archived by the owner on Feb 18, 2021. It is now read-only.
forked from Mojang/LegacyLauncher
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
158 lines (128 loc) · 4.84 KB
/
build.gradle.kts
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
import groovy.util.Node
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
plugins {
java
id("net.minecrell.licenser") version "0.3"
`maven-publish`
}
group = "eu.mikroskeem"
version = "1.18"
description = "Minecraft LegacyLauncher - mikroskeem's fork"
val joptSimpleVersion = "5.0.4"
val asmVersion = "6.2.1"
val slf4jVersion = "1.8.0-beta2"
val checkerQualVersion = "2.5.4"
val gradleWrapperVersion = "4.6"
val lwtsVersion = "1.1.0-SNAPSHOT"
val shurikenVersion = "0.0.1-SNAPSHOT"
repositories {
mavenLocal()
mavenCentral()
maven("https://repo.wut.ee/repository/mikroskeem-repo")
maven("https://repo.spongepowered.org/maven")
}
dependencies {
compile("net.sf.jopt-simple:jopt-simple:$joptSimpleVersion")
compile("org.ow2.asm:asm:$asmVersion")
compile("org.slf4j:slf4j-api:$slf4jVersion")
compile("org.checkerframework:checker-qual:$checkerQualVersion")
testImplementation("org.spongepowered:lwts:$lwtsVersion") {
exclude(group = "net.minecraft", module = "launchwrapper")
}
testImplementation("eu.mikroskeem:shuriken.instrumentation:$shurikenVersion")
testImplementation("org.slf4j:slf4j-simple:$slf4jVersion")
}
val test by tasks.getting(Test::class) {
systemProperty("lwts.tweaker", "eu.mikroskeem.test.launchwrapper.tweaker.TestTweaker")
systemProperty("legacy.debugClassLoading", "true")
systemProperty("legacy.debugClassLoadingFiner", "true")
systemProperty("org.slf4j.simpleLogger.defaultLogLevel", "trace")
// Set working directory
workingDir = this.temporaryDir
// Show output
testLogging {
showStandardStreams = true
exceptionFormat = TestExceptionFormat.FULL
}
// Verbose
beforeTest(closureOf<Any> { logger.lifecycle("Running test: $this") })
}
license {
header = rootProject.file("etc/HEADER")
filter.include("**/*.java")
// Because org.spongepowered.asm.launch.MixinBootstrap does this:
// if(MixinBootstrap.findInStackTrace("net.minecraft.launchwrapper.Launch", "launch") > 132) {
// *we are not in pre-init some mixins may be skipped blah blah*
filter.exclude("net/minecraft/launchwrapper/Launch.java")
}
val sourcesJar by tasks.creating(Jar::class) {
classifier = "sources"
from(java.sourceSets["main"].allSource)
}
val javadoc by tasks.getting(Javadoc::class)
val javadocJar by tasks.creating(Jar::class) {
dependsOn(javadoc)
classifier = "javadoc"
from(javadoc.destinationDir)
}
val wrapper by tasks.creating(Wrapper::class) {
gradleVersion = gradleWrapperVersion
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}
publishing {
(publications) {
"maven"(MavenPublication::class) {
artifactId = "legacylauncher"
from(components["java"])
artifact(sourcesJar)
artifact(javadocJar)
pom.withXml {
builder {
"name"("LegacyLauncher")
"description"(project.description)
"url"("https://github.com/OrionMinecraft/LegacyLauncher")
"issueManagement" {
"system"("GitHub Issues")
"url"("https://github.com/OrionMinecraft/LegacyLauncher/issues")
}
"licenses" {
"license" {
"name"("MIT License")
"url"("https://opensource.org/licenses/MIT")
}
}
"developers" {
"developer" {
"id"("mikroskeem")
"name"("Mark Vainomaa")
"email"("[email protected]")
}
}
"scm" {
"connection"("scm:[email protected]:OrionMinecraft/LegacyLauncher.git")
"developerConnection"("scm:[email protected]:OrionMinecraft/LegacyLauncher.git")
"url"("https://github.com/OrionMinecraft/LegacyLauncher")
}
}
}
}
}
repositories {
mavenLocal()
if(rootProject.hasProperty("wutRepoUsername") && rootProject.hasProperty("wutRepoPassword")) {
maven {
credentials {
username = rootProject.properties["wutRepoUsername"] as String
password = rootProject.properties["wutRepoPassword"] as String
}
name = "mikroskeem-repo"
setUrl("https://repo.wut.ee/repository/mikroskeem-repo")
}
}
}
}
fun XmlProvider.builder(builder: GroovyBuilderScope.() -> Unit) {
(asNode().children().last() as Node).plus(delegateClosureOf<Any> {
withGroovyBuilder(builder)
})
}