forked from TeamNightclipse/DanmakuCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
91 lines (74 loc) · 2.47 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
plugins {
id 'scala'
// Katrix: We apply these to get pretty build script
id 'java'
id 'java-library'
id 'eclipse'
id 'com.gtnewhorizons.retrofuturagradle' version '1.4.1'
id "com.github.johnrengelman.shadow" version "8.1.1"
}
version = project.mod_version
group = project.maven_group
archivesBaseName = project.archives_base_name
compileScala.scalaCompileOptions.additionalParameters = ["-Xexperimental"]
scaladoc.scalaDocOptions.additionalParameters = ["-Xexperimental"]
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
// Azul covers the most platforms for Java 8 toolchains, crucially including MacOS arm64
vendor.set(org.gradle.jvm.toolchain.JvmVendorSpec.AZUL)
}
// Generate sources and javadocs jars when building and publishing
withSourcesJar()
// withJavadocJar()
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
minecraft {
mcVersion.set('1.12.2')
// MCP Mappings
mcpMappingChannel = 'snapshot'
mcpMappingVersion = '20171003'
}
if (project.use_access_transformer.toBoolean()) {
for (File at : sourceSets.getByName("main").resources.files) {
if (at.name.toLowerCase().endsWith("_at.cfg")) {
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(at)
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(at)
}
}
}
sourceSets {
main {
scala {
srcDirs = ['src/main/scala', 'src/main/java']
}
java {
srcDirs = []
}
}
}
repositories {
maven {
// RetroFuturaGradle
name 'GTNH Maven'
url 'https://nexus.gtnewhorizons.com/repository/public/'
allowInsecureProtocol = true
mavenContent {
includeGroup 'com.gtnewhorizons'
includeGroup 'com.gtnewhorizons.retrofuturagradle'
}
}
mavenCentral() // Provide Scala
mavenLocal() // Must be last for caching to work
}
dependencies {
implementation "org.scala-lang:scala-library:2.11.4"
// impl shaped Mirror here, may cause error
implementation fileTree(dir:project.implementation_folder.toString(),includes:['*jar'])
}
tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
relocate 'shapeless', 'net.katsstuff.teamnightclipse.mirror.shade.shapeless'
}
tasks["build"].dependsOn(shadowJar)