-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
87 lines (75 loc) · 2.7 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
plugins {
id 'java'
id 'amalgamation-minecraft' version "2.1.0"
}
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://maven.fabricmc.net/' }
maven { url 'https://files.minecraftforge.net/maven/' }
maven {
name = "HalfOf2"
url = uri("https://storage.googleapis.com/devan-maven/")
}
}
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
def mc_vers = "1.17.1"
def mergedMappings = dependencies.create('net.fabricmc:yarn:1.17.1+build.61:mergedv2')
dependencies {
def intermediaryMinecraft = ag.map {
mappings(mergedMappings, 'official', 'intermediary')
remap(ag.mojmerged(mc_vers, true), true)
}
implementation ag.map {
mappings(mergedMappings, 'intermediary', 'named')
remap(intermediaryMinecraft, true)
/*remap("net.fabricmc.fabric-api:fabric-api:0.40.1+1.17", false) {
exclude module: 'fabric-loader'
}*/
}
implementation ag.fabricLoader("0.11.7")
implementation ag.libraries(mc_vers)
annotationProcessor("net.fabricmc:fabric-mixin-compile-extensions:0.4.3")
}
configurations {
annotationProcessor {
extendsFrom implementation
}
}
task unzip(type: Copy) {
inputs.files(ag.resolve([mergedMappings]))
from provider {
zipTree(ag.resolve([mergedMappings]).get().first())
}
into "$buildDir/unzip/"
}
compileJava {
def compilerArgs = options.compilerArgs
compilerArgs.add("-AinMapFileNamedIntermediary=$buildDir/unzip/mappings/mappings.tiny" as String)
compilerArgs.add("-AoutMapFileNamedIntermediary=$buildDir/test.tiny" as String)
// I have no idea what this does btw
compilerArgs.add("-AoutRefMapFile=${destinationDirectory.get().asFile}/test-refmap.json" as String)
compilerArgs.add("-AdefaultObfuscationEnv=named:intermediary" as String)
dependsOn tasks.unzip
}
import io.github.astrarre.amalgamation.gradle.tasks.RemapJar
task outputJar(type: RemapJar) {
from jar
}
task testDiff(type: JavaExec) {
group = "tests"
description = "Test Diff:tm:"
classpath sourceSets.main.runtimeClasspath
main = "net.fabricmc.loader.launch.knot.KnotClient"
def natives = ag.natives(mc_vers)
systemProperty("fabric.development", true)
systemProperty("fabric.gameVersion", mc_vers)
systemProperty("java.library.globalCache", natives)
systemProperty("org.lwjgl.librarypath", natives)
def assets = ag.assets(mc_vers)
args("--assetIndex", assets.assetIndex, "--assetsDir", assets.assetsDir)
workingDir("$rootDir/run")
dependsOn tasks.classes
}
// WIP: ide.ideaJava(testDiff) {}