-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
188 lines (161 loc) · 5.66 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
182
183
184
185
186
187
188
// For those who want the bleeding edge
buildscript {
repositories {
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
// for cursegradle
url = "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
// for cursegradle
classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.0.7"
}
}
apply plugin: 'com.matthewprenger.cursegradle'
apply plugin: 'scala'
apply plugin: 'net.minecraftforge.gradle.forge'
repositories {
mavenCentral()
jcenter()
maven {
name "ddd"
url "http://doubledoordev.net:8082/artifactory/mods"//http://box1.dmodoomsirius.me:8081/artifactory/libs-release/"
}
maven {
name "dsiriusArt"
url "http://box1.dmodoomsirius.me:8081/artifactory/libs-release/"
}
}
dependencies {
deobfCompile "temportalist.origin:Origin:${version_origin_dep}"
deobfCompile "mezz.jei:jei_${version_minecraft}:${version_jei}"
}
ext.getBuildNumber = {
if (System.getenv("BUILD_NUMBER") != null) return "${System.getenv("BUILD_NUMBER")}"
else if (project.hasProperty("bambooBuildNumber")) return project.bambooBuildNumber
else return getDate()
}
def getDate() {
def date = new Date()
def formattedDate = date.format('MM-dd-yyyy_HH-mm-ss')
return formattedDate
}
group = "${org}.${groupName}"
// java version
sourceCompatibility = 1.7
targetCompatibility = 1.7
minecraft {
version = "${version_minecraft}-${version_forge}${version_forge_b}"
runDir = "run"
mappings = "${version_mcp}"
replace "required-after:Forge", "required-after:Forge@[${version_forge},)"
replace "required-after:Origin", "required-after:origin@[${version_origin},)"
replace "@MOD_VERSION@", "${version_major}.${version_minor}.${version_patch}"
}
def createVersion() {
def branch = ""
def proc = "git rev-parse --abbrev-ref HEAD".execute()
proc.in.eachLine { line -> branch = line }
proc.err.eachLine { line -> println line }
proc.waitFor()
println("Building on branch " + branch)
def version = "${version_major}.${version_minor}.${version_patch}"
if (project.hasProperty("build_type")) {
if (build_type == "dev") version += "." + getBuildNumber()
} else if (!branch.startsWith("master"))
version += "." + getBuildNumber()
println("Bulding with version " + version)
return version
}
archivesBaseName = "${archiveName}-${project.minecraft.version}"
version = createVersion()
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'
}
}
sourceSets {
main.compileClasspath += api.compileClasspath;
main.compileClasspath += api.output;
}
task sourcesJar(type: Jar) {
from sourceSets.api.scala;
from sourceSets.main.scala;
classifier = 'sources'
}
tasks.build.dependsOn sourcesJar
apply plugin: 'maven'
apply plugin: 'maven-publish'
uploadArchives {
repositories {
// official DDD maven stuffs
if (project.hasProperty("dddUser") && project.hasProperty("dddUrl") && project.hasProperty("dddPass")) {
mavenDeployer {
repository(url: dddUrl) {
authentication(userName: dddUser, password: dddPass)
}
pom {
groupId = project.group
version = project.version
artifactId = "${archiveName}"
project {
name project.archivesBaseName
packaging 'jar'
description '${gitConfig.gitName}'
url 'https://github.com/TheTemportalist/${gitConfig.gitName}'
scm {
url 'https://github.com/TheTemportalist/${gitConfig.gitName}'
connection 'scm:git:git://github.com/TheTemportalist/${gitConfig.gitName}.git'
developerConnection 'scm:git:[email protected]:TheTemportalist/${gitConfig.gitName}.git'
}
issueManagement {
system 'github'
url 'https://github.com/TheTemportalist/${gitConfig.gitName}/issues'
}
licenses {
license {
name '${gitConfig.license}'
url 'https://github.com/TheTemportalist/${gitConfig.gitName}/blob/master/LICENSE'
distribution 'repo'
}
}
developers {
developer {
id 'TheTemportalist'
name 'TheTemportalist'
roles { role 'developer' }
}
}
}
}
}
}
}
}
idea.module.inheritOutputDirs = true
curseforge {
if (project.hasProperty("tempCurseAPI"))
apiKey = tempCurseAPI
project {
id = curseID
releaseType = curseBuildType
changelog = "Update recipe filter for compatibility with JEI"
addGameVersion version_minecraft
addArtifact sourcesJar
relations {
requiredLibrary 'origin'
}
}
}