-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
141 lines (119 loc) · 4.2 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
buildscript {
repositories {
jcenter()
maven { url = "https://files.minecraftforge.net/maven" }
maven {
name 'OpenMods Third Party'
url 'http://repo.openmods.info/artifactory/simple/thirdparty'
}
}
dependencies {
classpath group: "net.minecraftforge.gradle", name: "ForgeGradle", version: "2.3-SNAPSHOT"
classpath group: "net.thesilkminer.gradle.translationchecker", name: "TranslationChecker", version: "1.1"
}
}
apply plugin: "net.minecraftforge.gradle.forge"
static def getGitCommit() {
def proc = "git rev-parse --short HEAD".execute()
proc.waitFor()
return proc.exitValue() ? "EINVAL(NO_GIT)" : proc.text.trim()
}
static def getBuildNumber() {
return System.env.BUILD_NUMBER? System.env.BUILD_NUMBER : System.env.TRAVIS_BUILD_NUMBER
}
static def getBuildString() {
return getBuildNumber()? "+build.${getBuildNumber()}" : ""
}
version = "${mod_version}" + getBuildString()
group = "com.aaronhowser1.dymm" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "DocumentYourModMod"
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}
minecraft {
version = "${mc_version}-${forge_version}"
runDir = "run"
mappings = "${mappings_version}"
replace "@VERSION@", project.version
replace "@FINGERPRINT@", project.findProperty('signSHA1')
}
repositories {
maven {
name = "Progwml6 maven"
url = "https://dvs1.progwml6.com/files/maven/"
}
maven {
name = "ModMaven"
url = "https://modmaven.k-4u.nl"
}
}
dependencies {
deobfProvided group: "mezz.jei", name: "jei_${mc_version}", version: "${jei_version}", classifier: "api"
runtime group: "mezz.jei", name: "jei_${mc_version}", version: "${jei_version}"
}
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'
include 'assets/dymm/documentation/_supported_versions.json'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
exclude 'assets/dymm/documentation/_supported_versions.json'
}
}
task updateTranslations(type: net.thesilkminer.gradle.plugin.translationchecker.tasks.TranslationCheckTask) {
modId = "dym"
templateFileName = "en_us.lang"
}
task checkTranslations(type: net.thesilkminer.gradle.plugin.translationchecker.tasks.TranslationCheckTask) {
modId = "dym"
dryRun = true
templateFileName = "en_us.lang"
}
task deobfJar(type: Jar, dependsOn: 'jar') {
from "build/classes/java/main"
from "build/resources/main/"
classifier "deobf"
}
task signJar(type: SignJar, dependsOn: 'reobfJar') {
onlyIf {
project.hasProperty('keystore')
}
keyStore = project.findProperty('keystore')
alias = project.findProperty('keystoreAlias')
storePass = project.findProperty('keystorePass')
keyPass = project.findProperty('keyPass')
inputFile = jar.archivePath
outputFile = jar.archivePath
}
build.dependsOn signJar
artifacts {
archives deobfJar
}
jar {
manifest {
attributes([
"Specification-Title": "Document Your Mod Mod",
"Specification-Vendor": "aaronhowser1",
"Specification-Version": "1.0.0",
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"aaronhowser1; TheSilkMiner",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"GitCommit": "" + getGitCommit(),
"BuildNumber": "" + getBuildNumber()
])
}
}
wrapper {
gradleVersion = "4.9"
distributionType = Wrapper.DistributionType.ALL
}