-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
131 lines (114 loc) · 3.45 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
plugins {
id 'java'
id 'idea'
id 'amalgamation-minecraft' version "1.0.1.0"
id 'maven-publish'
}
group 'org.example'
version '1.0.0'
repositories {
mavenCentral()
maven {
url 'https://maven.fabricmc.net/'
}
}
def intermediate = ag.map {
mappings(ag.intermediary(minecraft_version))
inputGlobal(ag.mojmerged(minecraft_version))
}
def map = "net.fabricmc:yarn:${yarn_mappings}:v2"
def mappedMc
def fapi
//def rei
def floader = ag.fabricLoader(loader_version)
ag.map {
mappings(map, 'intermediary', 'named')
mappedMc = inputGlobal(intermediate)
fapi = inputLocal("net.fabricmc.fabric-api:fabric-api:${fabric_version}") {exclude module: 'fabric-loader'}
//rei = inputLocal("me.shedaniel:RoughlyEnoughItems-fabric:7.0.346") {exclude group: "net.fabricmc.fabric-api"exclude module: 'fabric-loader'}
}
configurations {
excluded {}
implementation.extendsFrom(excluded)
}
sourceSets {
test {
compileClasspath += main.output + main.compileClasspath
runtimeClasspath += main.compileClasspath
}
}
dependencies {
excluded mappedMc
implementation fapi
// implementation rei
excluded ag.libraries(minecraft_version)
excluded floader
excluded map
}
jar {
from "$rootProject.projectDir/LICENSE"
}
task remapJar(type: RemapJar) {
group = "build"
with jar
classpath = sourceSets.main.compileClasspath
remapAw()
useExperimentalMixinRemapper()
mappings(map, 'named', 'intermediary')
}
task remapSourcesJar(type: RemapSourcesJar) {
group = "build"
classifier = 'sources'
from sourceSets.main.allSource
classpath = sourceSets.main.compileClasspath
mappings(map, 'named', 'intermediary')
}
task runClient(type: JavaExec) {
group = "Minecraft"
description = "runs minecraft"
classpath sourceSets.main.runtimeClasspath
main = "net.fabricmc.loader.launch.knot.KnotClient"
def natives = ag.natives(minecraft_version)
systemProperty("fabric.development", true)
systemProperty("fabric.gameVersion", minecraft_version)
systemProperty("java.library.globalCache", natives)
systemProperty("org.lwjgl.librarypath", natives)
def assets = ag.assets(minecraft_version)
args("--assetIndex", assets.getAssetIndex(), "--assetsDir", assets.getAssetsDir())
workingDir("$rootDir/run")
dependsOn tasks.classes
}
ag.idea().java(runClient) {
it.setJvmVersion("17")
it.overrideClasspath(project, sourceSets.main)
it.excludeDependency(tasks.classes)
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = "$project.name"
from components.java
setArtifacts([]) // overwrite default artifacts
ag.excludeConfiguration(it, configurations.excluded)
ag.fixPom(it)
artifact(remapJar) {
builtBy remapJar
}
artifact(remapSourcesJar) {
builtBy remapSourcesJar
}
}
}
repositories {
maven {
def mavenUrl = project.hasProperty('maven_url') ? project.property('maven_url') : ""
url mavenUrl
if (mavenUrl.startsWith("http")) {
credentials {
username project.hasProperty('maven_username') ? project.property('maven_username') : ""
password project.hasProperty('maven_password') ? project.property('maven_password') : ""
}
}
}
}
}