-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.gradle
116 lines (93 loc) · 2.7 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
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name 'OpenMods Third Party'
url 'http://repo.openmods.info/artifactory/simple/thirdparty'
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'net.thesilkminer.gradle.translationchecker:TranslationChecker:1.1'
}
}
repositories {
maven {
name "OpenMods"
url "https://repo.openmods.info/artifactory/openmods"
}
}
configurations {
mergeJars
compile {
extendsFrom mergeJars
}
}
dependencies {
mergeJars "openeye:OpenEye-protocol:1.1.1"
}
apply plugin: 'net.minecraftforge.gradle.forge'
archivesBaseName = 'OpenEye'
version = mc_ver + "-" + mod_version
ext.env = System.getenv()
if (env.BUILD_NUMBER != null) {
version += "-snapshot-" + env.BUILD_NUMBER
}
ext.in_jenkins = (env.BUILD_TAG != null) // If this works, we'll assume we're in Jenkins atleast.
def branch = null
def hash = null
def proc1 = "git rev-parse --short HEAD".execute()
proc1.in.eachLine { line -> hash = line }
proc1.err.eachLine { line -> println line }
proc1.waitFor()
if (!in_jenkins) {
def proc2 = "git rev-parse --abbrev-ref HEAD".execute()
proc2.in.eachLine { line -> branch = line }
proc2.err.eachLine { line -> println line }
proc2.waitFor()
} else { // In Jenkins
branch = env.GIT_BRANCH.minus("origin/")
}
minecraft {
version = mc_ver + "-" + forge_ver
runDir = "run"
replaceIn 'openeye/Mod.java'
replace "@VERSION@", mod_version
mappings = mcp_mappings
}
processResources {
inputs.property "version", mod_version
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version':mod_version, 'mc_version':mc_ver
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
jar {
manifest {
attributes 'FMLCorePlugin': 'openeye.CorePlugin',
'Git-Branch': branch,
'Git-Hash': hash,
'Jenkins-Build': in_jenkins
if (in_jenkins) {
attributes 'Jenkins-Tag': env.BUILD_TAG, 'Jenkins-ID': env.BUILD_ID
}
}
from configurations.mergeJars.collect { it.isDirectory() ? it : zipTree(it) }
}
task updateTranslations(type: net.thesilkminer.gradle.plugin.translationchecker.tasks.TranslationCheckTask) {
modId = "openeye"
}
task checkTranslations(type: net.thesilkminer.gradle.plugin.translationchecker.tasks.TranslationCheckTask) {
modId = "openeye"
dryRun = true
}
task wrapper (type: Wrapper) {
gradleVersion = "2.11"
}