-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathbuild.gradle
119 lines (105 loc) · 3.55 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
buildscript {
repositories {
jcenter()
maven {
name = "Forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "CurseForge"
url = "https://minecraft.curseforge.com/api/maven/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
plugins {
id 'org.ajoberstar.grgit' version '3.1.1'
}
apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
version = "${project.mc_version}-${project.mod_version}"
group = "${project.maven_group}"
archivesBaseName = "${project.mod_id}"
sourceCompatibility = targetCompatibility = '1.8'
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}
minecraft {
version = "${project.mc_version}-${project.forge_version}"
runDir = "run"
mappings = "${project.mcp_mappings}"
replace "@VERSION@", "${project.mod_version}"
}
repositories {
flatDir {
dirs 'libs'
}
maven {
name = "Mobius Repo"
url = "http://tehnut.info/maven"
}
maven {
name = "JEI"
url = "http://dvs1.progwml6.com/files/maven"
}
maven {
url = "https://minecraft.curseforge.com/api/maven/"
}
maven {
name = "ModMaven"
url = "modmaven.k-4u.nl"
}
maven {
url "https://maven.mcmoddev.com/"
}
maven {
url = 'https://maven.blamejared.com'
}
maven {
url "http://maven.tterrag.com/"
}
maven {
url "http://maven.thiakil.com/"
}
}
dependencies {
deobfCompile "mcp.mobius.waila:Hwyla:1.8.26-B41_1.12.2"
deobfProvided "mezz.jei:jei_1.12.2:4.15.0.268:api"
runtime "mezz.jei:jei_1.12.2:4.15.0.268"
deobfCompile "com.github.glitchfiend.biomesoplenty:BiomesOPlenty:1.12.2-7.0.1.2399:universal"
deobfCompile "com.azanor.baubles:Baubles:1.12-1.5.2"
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs = [
'-Xlint:deprecation', // deprecation, rawtypes, cast, unchecked, all
'-Xlint:unchecked',
]
}
task setupGithubActions(type: Exec) {
def getVersion = {
//TAG-offset-hash
def raw = grgit.describe(longDescr: true, tags:true, match: ["[1-9].[0-9].[0-9]", "[1-9][0-9].[1-9][0-9].[1-9][0-9]", "[0-9].[1-9][0-9].[1-9][0-9]", "[0-9].[0-9].[1-9][0-9]", "[0-9].[1-9][0-9].[0-9]", "[1-9][0-9].[0-9].[0-9]"])
def desc = (raw == null ? '0.0-0-unknown' : grgit.describe(longDescr: true, tags:true, match: ["[1-9].[0-9].[0-9]", "[1-9][0-9].[1-9][0-9].[1-9][0-9]", "[0-9].[1-9][0-9].[1-9][0-9]", "[0-9].[0-9].[1-9][0-9]", "[0-9].[1-9][0-9].[0-9]", "[1-9][0-9].[0-9].[0-9]"])).split('-') as List
def hash = desc.remove(desc.size() - 1)
def offset = desc.remove(desc.size() - 1)
def tag = desc.join('-')
return "${tag}.${offset}".toString() //Bake the response instead of making it dynamic
}
project.mod_version = getVersion();
version = "${project.mc_version}-${project.mod_version}";
commandLine "echo", "##[set-output name=version;]${project.version}"
}
processResources {
inputs.property "version", "${project.mod_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'
}
}