forked from ForestryMC/Binnie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
169 lines (147 loc) · 5.13 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 {
name = "forge"
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: "se.bjurr.gitchangelog.git-changelog-gradle-plugin"
apply plugin: 'idea'
apply plugin: 'maven'
allprojects {
apply plugin: 'net.minecraftforge.gradle.forge'
version = version_major + '.' + version_minor + '.' + version_patch
if (System.getenv("BUILD_NUMBER") != null) {
version = version + "." + System.getenv("BUILD_NUMBER")
}
minecraft {
version = mcversion + "-" + forgeversion
mappings = mcp_mappings
runDir = "run"
replace '@VERSION@', project.version
}
group = "binnie" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
compileJava {
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
maven {
name = "jei"
url "http://dvs1.progwml6.com/files/maven"
}
maven {
name = "ic2, forestry"
url = "http://maven.ic2.player.to/"
}
maven {
name = "CurseForge"
url = "https://minecraft.curseforge.com/api/maven/"
}
maven {
name "Jared"
url "http://maven.blamejared.com/"
}
}
dependencies {
deobfCompile("net.sengir.forestry:forestry_${forestry_mcversion}:${forestry_version}") {
transitive = false
}
deobfProvided "mezz.jei:jei_${jei_mcversion}:${jei_version}:api"
runtime "mezz.jei:jei_${jei_mcversion}:${jei_version}"
runtime "jei-bees:jeibees:${jeibees_version}:mc${jeibees_mcversion}"
deobfProvided "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
runtime "net.industrial-craft:industrialcraft-2:${ic2_version}"
deobfProvided "CraftTweaker2:CraftTweaker2-API:${crafttweaker_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'
// 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'
}
}
// prevent java 8's strict doclint for javadocs from failing builds
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
def mainProjects = [':core', ':core-api', ':botany', ':botany-api', ':design', ':design-api', ':extrabees', ':extratrees', 'extratrees-api', ':genetics', 'genetics-api']
.collect{ subproject -> project(subproject) }
mainProjects.each { subproject -> evaluationDependsOn( subproject.path ) }
jar.dependsOn mainProjects.tasks['classes']
jar {
mainProjects.each { subproject ->
from subproject.sourceSets.main.output.classesDirs
from subproject.sourceSets.api.output.classesDirs
from subproject.sourceSets.main.output.resourcesDir
from subproject.sourceSets.api.output.resourcesDir
}
}
task sourcesJar(type: Jar, dependsOn: mainProjects.tasks['classes']) {
classifier = 'sources'
mainProjects.each { subproject ->
from(subproject.sourceSets.main.allSource) {
exclude 'assets'
exclude 'mcmod.info'
}
from(subproject.sourceSets.api.allSource)
}
}
task copyJars(type: Copy) {
from mainProjects.collect { it.tasks.withType(Jar) }
into "$buildDir/libs"
}
artifacts {
archives sourcesJar
}
uploadArchives {
repositories {
if (project.hasProperty('mavenDir')) {
mavenDeployer {
repository(url: "file://" + mavenDir)
}
} else {
println 'Archives upload disabled, mavenDir in gradle.properties is missing.'
}
}
}
task makeChangelog(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
filePath = "changelog.html"
untaggedName = "Current release ${project.version}"
fromCommit = "dbc5c1a564c39e4a9c042411d1bdbe450985ce2c"
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 = 'alpha'
relations {
requiredLibrary 'forestry'
}
}
}
afterEvaluate {
tasks.curseforge223525.dependsOn.add(makeChangelog)
}