-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
86 lines (69 loc) · 2.08 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
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT"
}
}
// Ensure that we're using UTF-8.
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
apply plugin: "idea"
idea {
module {
// For some reason this is necessary for IDEA 2014 workspaces to recognize assets
inheritOutputDirs = true
}
}
apply plugin: "net.minecraftforge.gradle.forge"
repositories {
}
// Define properties file
ext.configFile = file "build.properties"
configFile.withReader {
// Load config. It shall from now be referenced as simply config or project.config
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
version = config.minecraft_version + "-" + config.mod_version
group = "org.halvors.nuclearphysics"
archivesBaseName = "nuclearphysics"
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
minecraft {
version = config.minecraft_version + "-" + config.forge_version
runDir = "eclipse"
mappings = config.mcp_mappings
// Replace version in Reference.java
replace "@version", config.mod_version
}
dependencies {
}
processResources {
// This will ensure that this task is redone when this versions change.
inputs.property "mod_version", config.mod_version
inputs.property "minecraft_version", config.minecraft_version
inputs.property "forge_version", config.forge_version
// Replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include "mcmod.info"
// Replace version and minecraft_version
expand "version" : config.mod_version,
"minecraft_version" : config.minecraft_version
}
// Copy everything else
from(sourceSets.main.resources.srcDirs) {
exclude "mcmod.info"
}
}