-
-
Notifications
You must be signed in to change notification settings - Fork 235
/
build.gradle
80 lines (69 loc) · 2.39 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
import io.izzel.arclight.gradle.tasks.UploadFilesTask
allprojects {
apply plugin: 'java'
group 'io.izzel.arclight'
version '1.0.0-SNAPSHOT'
def getGitHash = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
ext {
minecraftVersion = '1.21.1'
supportedPlatforms = ['forge', 'neoforge', 'fabric']
fabricLoaderVersion = '0.16.9'
fabricApiVersion = '0.109.0+1.21.1'
forgeVersion = '52.0.29'
neoForgeVersion = '21.1.80'
apiVersion = '1.7.3'
toolsVersion = '1.3.0'
mixinVersion = '0.8.5'
mixinToolsVersion = '1.2.4'
versionName = 'feudal-kings'
gitHash = getGitHash()
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
repositories {
maven { url = 'https://repo.spongepowered.org/maven' }
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url = 'https://maven.neoforged.net/releases' }
maven { url = 'https://files.minecraftforge.net/maven/' }
maven { url = 'https://maven.izzel.io/releases' }
maven { url = 'https://jitpack.io/' }
mavenCentral()
mavenLocal()
}
tasks.register('cleanBuild') {
doFirst {
project.file("build/libs").deleteDir()
}
}
}
jar.enabled = false
tasks.register('collect', Copy) {
destinationDir = file('build/libs')
// TODO arch loom updates from project(':bootstrap').tasks.forgeJar.outputs
from project(':bootstrap').tasks.neoforgeJar.outputs
from project(':bootstrap').tasks.fabricJar.outputs
}
def gitBranch() {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--abbrev-ref', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
tasks.register('uploadFiles', UploadFilesTask) {
mcVersion.set project.ext.minecraftVersion
version.set "${project.version}-${project.ext.gitHash}"
snapshot.set project.version.toString().endsWith("-SNAPSHOT")
gitHash.set project.ext.gitHash
branch.set gitBranch()
inputs.files tasks.collect.outputs.files
dependsOn(tasks.collect)
}