-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
97 lines (76 loc) · 2.47 KB
/
build.gradle
File metadata and controls
97 lines (76 loc) · 2.47 KB
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
import org.apache.tools.ant.filters.ReplaceTokens
buildscript {
repositories {
jcenter()
maven { url "http://files.minecraftforge.net/maven" }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/groups/public/" }
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'net.minecraftforge.gradle.forge'
sourceCompatibility = targetCompatibility = '1.8'
group 'com.matt.forgehax'
version project.property('forgehax.version')
archivesBaseName = "tae-forgehax-" + project.property('forgehax.mc.version')
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
sourceSets {
schematica_api {
compileClasspath += main.compileClasspath
}
main {
compileClasspath += schematica_api.output
}
}
minecraft {
version = project.property('forgehax.forge.version')
runDir = "run"
// channel_mapping
mappings = "${project.property('forgehax.mcp.channel')}_${project.property('forgehax.mcp.mapping')}"
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.15.0'
}
jar {
manifest {
attributes(
'FMLCorePlugin': 'com.matt.forgehax.asm.ForgeHaxCoreMod',
'FMLCorePluginContainsFMLMod': 'true'
)
}
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version': project.version, 'mcversion': project.minecraft.version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
filesMatching('**/*.properties') {
it.filter ReplaceTokens, tokens: [
"forgehax.version" : project.property("forgehax.version"),
"forgehax.mc.version" : project.property("forgehax.mc.version"),
"forgehax.forge.version": project.property("forgehax.forge.version"),
"forgehax.mcp.version" : project.property("forgehax.mcp.version"),
"forgehax.mcp.channel" : project.property("forgehax.mcp.channel"),
"forgehax.mcp.mapping" : project.property("forgehax.mcp.mapping")
]
}
}