forked from phantamanta44/libnine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
107 lines (86 loc) · 2.46 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
buildscript {
repositories {
mavenCentral()
maven { url = "https://maven.minecraftforge.net/" }
}
dependencies {
classpath group: "net.minecraftforge.gradle", name: "ForgeGradle", version: "5.1.+"
}
}
apply plugin: "java"
apply plugin: "net.minecraftforge.gradle"
apply plugin: 'maven-publish'
version = '1.2.3jr'
group = 'io.github.phantamanta44.libnine'
archivesBaseName = 'libnine-1.12.2'
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
compileJava {
sourceCompatibility = "8"
targetCompatibility = "8"
}
repositories {
maven {
url = "https://maven.minecraftforge.net/"
}
}
dependencies {
minecraft "net.minecraftforge:forge:1.12.2-14.23.5.2860"
}
minecraft {
mappings channel: "stable", version: "39-1.12"
accessTransformer = file('src/main/resources/META-INF/libnine_at.cfg')
runs {
"client" {
workingDirectory file("./run")
mods { "${project.name}" { source sourceSets.main } }
}
"server" {
workingDirectory file("./run/server")
mods { "${project.name}" { source sourceSets.main } }
}
}
}
processResources {
inputs.property "version", project.version
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
filesMatching("mcmod.info") {
expand "version": project.version,
"mcVersion": "1.12",
"modId": "libnine",
"modVersion": "1.2.3jr"
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
rename 'libnine_at.cfg', 'META-INF/libnine_at.cfg'
}
//When Forge 1.12 loads mods from a directory that's been put on the classpath, it expects to find resources in the same directory.
//Default Gradle behavior puts resources in ./build/resources/main instead of ./build/classes/main/java. Let's change that.
sourceSets.all { it.output.resourcesDir = it.output.classesDirs.getFiles().iterator().next() }
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
classifier = 'sources'
}
jar {
manifest {
attributes 'FMLAT': 'libnine_at.cfg'
}
}
artifacts {
archives deobfJar
archives sourcesJar
}
publishing {
publications {
all(MavenPublication) {
artifact jar
artifact deobfJar
artifact sourcesJar
artifactId = archivesBaseName
}
}
}