-
Notifications
You must be signed in to change notification settings - Fork 3
/
common.gradle
65 lines (54 loc) · 1.53 KB
/
common.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
/**
* Common build properties for all versions of ForgeAutoShutdown
*/
// Gradle project properties
version = "1.0.7"
group = "roycurtis.autoshutdown"
// Specifies the output jar file's prefix
archivesBaseName = "ForgeAutoShutdown"
// Specifies the working directory for ForgeGradle run configs
minecraft.runDir = "debug"
// Sets the output directory of the mod's jar file
jar.destinationDir = file '../output'
// Enforces use of Java 1.8 language level
compileJava
{
sourceCompatibility = "1.7"
targetCompatibility = "1.7"
}
// Fixes issues with debugging in IntelliJ
idea
{
module
{
outputDir = file 'classes/production/'
testOutputDir = file 'classes/test/'
}
}
// Fixes issues with µ character in source files
// From https://discuss.gradle.org/t/special-characters-in-java-string-literals-arent-interpreted-correctly/4665
tasks.withType(JavaCompile)
{
options.encoding = "UTF-8"
}
processResources
{
inputs.property "modid", project.archivesBaseName
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// Only replace properties in mcmod.info
from(sourceSets.main.resources.srcDirs)
{
include 'mcmod.info'
// replace version and mcversion
expand (
'modid' : project.archivesBaseName,
'version' : project.version,
'mcversion' : project.minecraft.version
)
}
from(sourceSets.main.resources.srcDirs)
{
exclude 'mcmod.info'
}
}