-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle
96 lines (82 loc) · 2.59 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
buildscript {
repositories {
maven { url = "http://files.minecraftforge.net/maven" }
maven { url = "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
classpath "com.wynprice.cursemaven:CurseMaven:2.1.1"
}
}
apply plugin: "net.minecraftforge.gradle.forge"
apply plugin: "com.wynprice.cursemaven"
def mod_file = getModFile("net.gegy1000.terrarium.Terrarium")
version = getModField("VERSION", mod_file)
group = "net.gegy1000"
archivesBaseName = "terrarium"
sourceCompatibility = targetCompatibility = "1.8"
minecraft {
version = "1.12.2-14.23.5.2847"
runDir = "minecraft"
mappings = "stable_39"
}
repositories {
mavenCentral()
maven { url = "https://oss.sonatype.org/content/repositories/public/" }
maven { url = "https://repo.spongepowered.org/maven/" }
maven { url = "https://maven.gegy.dev" }
maven { url = "https://www.cursemaven.com" }
maven { url = "http://mvn.topobyte.de" }
}
configurations {
embed
compile.extendsFrom(embed)
}
dependencies {
// optional dependencies
deobfCompile 'io.github.opencubicchunks:cubicchunks-api:1.12.2-0.0-SNAPSHOT'
deobfCompile 'io.github.opencubicchunks:cubicchunks:1.12.2-0.0-SNAPSHOT'
deobfCompile 'com.github.glitchfiend.biomesoplenty:BiomesOPlenty:1.12.2-7.0.1.2399:universal'
deobfCompile 'curse.maven:dynamictrees-252818:2822231'
// embedded dependencies
embed 'dev.gegy:gengen:0.1.0-SNAPSHOT'
embed 'net.gegy1000:just-now:0.1.0-SNAPSHOT'
embed 'com.vividsolutions:jts:1.13'
embed 'org.tukaani:xz-fork:1.8'
}
jar {
from configurations.embed.collect {
it.isDirectory() ? it : zipTree(it)
}
manifest {
attributes "FMLAT": "terrarium_at.cfg"
attributes "Maven-Artifact": "${project.group}:${project.archivesBaseName}:${project.version}"
attributes "Timestamp": System.currentTimeMillis()
}
}
processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
from(sourceSets.main.resources.srcDirs) {
include "mcmod.info"
expand "version": project.version, "mcversion": project.minecraft.version
}
from(sourceSets.main.resources.srcDirs) {
exclude "mcmod.info"
}
}
File getModFile(String fq_name) {
return file("src/main/java/${fq_name.replace('.', '/')}.java")
}
String getModField(String type, File mod_file) {
String field = ""
String prefix = "public static final String $type = \""
mod_file.eachLine { String s ->
s = s.trim()
if (s.startsWith(prefix)) {
s = s.substring(prefix.length(), s.length() - 2)
field = s
}
}
return field
}