forked from ForestryMC/ForestryMC
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
169 lines (144 loc) · 4.25 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
buildscript {
repositories {
jcenter()
maven { url = "http://files.minecraftforge.net/maven" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath "gradle.plugin.se.bjurr.gitchangelog:git-changelog-gradle-plugin:1.47"
}
}
plugins {
id "com.matthewprenger.cursegradle" version "1.0.9"
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: "se.bjurr.gitchangelog.git-changelog-gradle-plugin"
version = version_major + '.' + version_minor + '.' + version_patch + '.' + getBuildNumber()
if (project.hasProperty('buildQualifier')) {
version = project.version + '-' + project.buildQualifier
}
group = "net.sengir.forestry" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "forestry_" + mcversion
ext.dirDest = './build/dist'
// java version
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
minecraft {
version = mcversion + "-" + forgeversion
runDir = "run"
mappings = mcp_mappings
replace '@VERSION@', project.version
replace '@BUILD_NUMBER@', getBuildNumber()
}
repositories {
maven {
url = 'http://maven.mcmoddev.com'
}
maven {
url "http://dvs1.progwml6.com/files/maven"
}
maven {
name = "ic2"
url = "http://maven.ic2.player.to/"
}
maven {
name = "Modmuss50"
url = "http://maven.modmuss50.me"
}
maven {
url = 'https://mod-buildcraft.com/maven'
}
}
dependencies {
deobfProvided "net.darkhax.tesla:Tesla-${tesla_mcversion}:${tesla_version}"
deobfProvided "mezz.jei:jei_${jei_mcversion}:${jei_version}:api"
runtimeOnly "mezz.jei:jei_${jei_mcversion}:${jei_version}"
deobfProvided "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
deobfProvided "TechReborn:TechReborn-${TR_mcversion}:${TR_version}:api"
deobfProvided "com.mod-buildcraft:buildcraft-api:${buildcraft_version}"
}
configurations {
api
compile.extendsFrom api
}
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'
exclude '**/*.md'
}
// Move access transformers to META-INF
rename '(.+_at.cfg)', 'META-INF/$1'
}
// prevent java 8's strict doclint for javadocs from failing builds
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
jar {
manifest {
attributes 'FMLAT': 'forestry_at.cfg'
}
}
task sourcesJar(type: Jar) {
from zipTree('build/retromapping/retromappedReplacedMain.jar') // Not sure if this is how Abrar designed it, but grab the remapped src
classifier = 'sources'
}
task apiJar(type: Jar) {
// TODO: when FG bug is fixed, remove allSource from the api jar.
// https://github.com/MinecraftForge/ForgeGradle/issues/369
// Gradle should be able to pull them from the -sources jar.
from sourceSets.main.allSource
from sourceSets.main.output
include 'forestry/api/**'
classifier = 'api'
}
artifacts {
archives sourcesJar
archives apiJar
}
uploadArchives {
repositories {
if (project.hasProperty('mavenDir')) {
mavenDeployer {
repository(url: "file://" + mavenDir)
}
} else {
println 'Archives upload disabled, mavenDir in gradle.properties is missing.'
}
}
}
def getBuildNumber() {
return "$System.env.BUILD_NUMBER" != "null" ? "$System.env.BUILD_NUMBER" : "0"
}
task makeChangelog(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
filePath = "changelog.html"
untaggedName = "Current release ${project.version}"
fromCommit = "5a3850c2642e535656d090d1473054d5fa8d3331"
toRef = "HEAD"
templateContent = file('changelog.mustache').getText('UTF-8')
}
curseforge {
apiKey = project.hasProperty('curseforge_apikey') ? project.curseforge_apikey : '0'
project {
id = curse_project_id
changelog = file('changelog.html')
changelogType = 'html'
releaseType = 'beta'
}
}
afterEvaluate {
tasks.curseforge59751.dependsOn.add(makeChangelog)
}