-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
180 lines (123 loc) · 4.65 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
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'
classpath 'gradle.plugin.com.matthewprenger:CurseGradle:1.1.0'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'com.matthewprenger.cursegradle'
apply plugin: 'maven-publish'
apply from: 'https://raw.githubusercontent.com/MinecraftModDevelopment/Gradle-Collection/master/generic/secrets.gradle'
apply from: 'https://raw.githubusercontent.com/MinecraftModDevelopment/Gradle-Collection/master/generic/patreon.gradle'
apply from: 'https://raw.githubusercontent.com/MinecraftModDevelopment/Gradle-Collection/master/generic/markdown-git-changelog.gradle'
apply from: 'https://raw.githubusercontent.com/MinecraftModDevelopment/Gradle-Collection/master/minecraft/artifacts.gradle'
apply from: 'https://raw.githubusercontent.com/MinecraftModDevelopment/Gradle-Collection/master/minecraft/maven.gradle'
loadSecrets()
version = "${mod_version}" + getBuildNumber()
group = "${mod_group}"
archivesBaseName = "${mod_name}-${version_minecraft}"
sourceCompatibility = 1.8
targetCompatibility = 1.8
minecraft {
version = "${version_minecraft}-${version_forge}"
mappings = "${version_mcp}"
runDir = 'run'
replace '@VERSION@', project.version
replace '@FINGERPRINT@', project.findProperty('signSHA1')
replaceIn "${mod_class}.java"
}
repositories {
maven {
url 'https://maven.mcmoddev.com'
}
maven {
url 'http://tehnut.info/maven'
}
maven {
url 'http://maven.blamejared.com'
}
}
dependencies {
deobfProvided "net.darkhax.bookshelf:Bookshelf-1.12.2:${version_bookshelf}"
deobfProvided "net.darkhax.gamestages:GameStages-1.12.2:${version_gamestages}"
deobfProvided "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-${version_minetweaker}"
deobfProvided "mcp.mobius.waila:Hwyla:${version_hwyla}"
}
processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version':project.version, 'mcversion':project.minecraft.version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
from 'LICENSE'
}
String getBuildNumber() {
return System.getenv('BUILD_NUMBER') ? System.getenv('BUILD_NUMBER') : System.getenv('TRAVIS_BUILD_NUMBER') ? System.getenv('TRAVIS_BUILD_NUMBER') : '0';
}
//Shuts up javadoc failures
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
curseforge {
apiKey = findProperty('curse_auth') ?: 0
def versions = "${curse_versions}".split(', ')
project {
id = "${curse_project}"
releaseType = 'alpha'
changelog = getGitChangelog() + "\n\nHuge thanks to my supporters on [Patreon](https://www.patreon.com/Darkhax?MCChangelog?${mod_class})\n\n" + getPledgeLog()
changelogType = 'markdown'
versions.each {
addGameVersion "${it}"
}
if (project.hasProperty('curse_requirements') || project.hasProperty('curse_optionals')) {
mainArtifact(jar) {
relations {
if (project.hasProperty('curse_requirements')) {
def requirements = "${curse_requirements}".split(', ')
requirements.each {
requiredLibrary "${it}"
}
}
if (project.hasProperty('curse_optionals')) {
def optionals = "${curse_optionals}".split(', ')
optionals.each {
optionalLibrary "${it}"
}
}
}
}
}
addArtifact(sourcesJar)
addArtifact(javadocJar)
addArtifact(deobfJar)
}
}
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('keyStoreKeyPass')
inputFile = jar.archivePath
outputFile = jar.archivePath
}
build.dependsOn signJar