forked from portablejim/PowerConverters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
181 lines (152 loc) · 4.53 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
181
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
}
repositories {
maven {
name = "ic2"
url = "http://maven.ic2.player.to/"
}
maven {
name = "calclavia"
url = "http://localhost/maven/"
}
maven{
name "Waila Mobius Repo"
url "http://localhost/maven/"
}
maven{
name "CB Maven FS"
url "http://chickenbones.net/maven/"
}
ivy {
url "http://www.mod-buildcraft.com/releases/BuildCraft/"
layout 'pattern', {
ivy '[revision]/[module]-[revision]-dev-ivy.xml'
artifact '[revision]/[module]-[revision]-dev(.[ext])'
}
}
}
apply plugin: 'forge'
apply plugin: 'maven'
apply plugin: 'curseforge'
// define the properties file
ext.configFile = file "build.properties"
configFile.withReader {
// read config. it shall from now on be referenced as simply config or as project.config
def prop = new Properties()
prop.load(it)
ext.config = new ConfigSlurper().parse prop
}
version = config.modVersion
group= "powercrystals.powerconverters" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "PowerConverters"
dependencies {
compile "net.industrial-craft:industrialcraft-2:${config.ic2_version}:api"
compile "com.mod-buildcraft:buildcraft:${config.buildcraft_version}:dev"
compile "dev.calclavia.resonantengine:resonant-engine:${config.resonantengine_version}:dev"
compile "mcp.mobius.waila:Waila:${config.waila_version}:dev"
}
minecraft {
version = config.minecraft_version + "-" + config.forge_version
}
String buildNumber = "unknown"
version = "${config.minecraft_version}_${config.mod_version}"
if(System.getenv("BUILD_NUMBER") != null) {
buildNumber = System.getenv("BUILD_NUMBER")
version = "${config.minecraft_version}_${config.mod_version}-jenkins.${buildNumber}"
}
processResources
{
// 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, 'buildnumber': "${System.getenv().BUILDNUMBER}"
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'dev'
}
build.dependsOn deobfJar
artifacts {
archives deobfJar
}
configurations {
deployerJars
}
uploadArchives {
dependsOn 'reobf'
repositories {
if(project.hasProperty("pushMaven")) {
logger.info("Pushing to maven repo")
mavenDeployer {
configuration = configurations.deployerJars
repository(url: "file://localhost/home/public_html/maven.jamesmckay.id.au/htdocs/")
pom {
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
packaging = 'jar'
description 'PowerConverters Mod'
}
}
}
}
}
ext.curseForgeReleaseType = null
task ('curseGeneral') << {
curse {
projectId = '229499'
if (project.hasProperty('curseForgeApiKey')) apiKey = project.curseForgeApiKey
else apiKey = 0
releaseType = curseForgeReleaseType
changelog = new File('Changelog.md').getText('utf-8').split('\n-{3,8}|\n\n')[2]
displayName = String.format('PowerConverters %s [build %s]', config.mod_version, buildNumber)
additionalArtifact deobfJar
for (String newVersion : config.compatible_versions.split(",")) {
addGameVersion newVersion
}
}.execute()
}
task setCurseAlpha << {
print('Set alpha\n')
curseForgeReleaseType = 'alpha'
}
task setCurseBeta << {
print('Set beta\n')
curseForgeReleaseType = 'beta'
}
task setCurseRelease << {
print('Set release\n')
curseForgeReleaseType = 'release'
}
task curseAlpha << {
setCurseAlpha.execute()
curseGeneral.execute()
}
task curseBeta << {
setCurseBeta.execute()
curseGeneral.execute()
}
task curseRelease << {
setCurseRelease.execute()
curseGeneral.execute()
}