forked from AbrarSyed/SecretRoomsMod-forge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
185 lines (158 loc) · 5.85 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
// this part adds in ForgeGradle
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' }
}
apply plugin: "forge"
// stuff specific to my mod
group = 'com.github.abrarsyed'
version = "4.6.3"
archivesBaseName = 'secretroomsmod'
minecraft {
version = "1.7.2-10.12.1.1061" // grab latest forge
assetDir = "run/assets"
// replacing
replace "@CHANGE_VERSION@", "[4.6,)"
replace "@MC_VERSION@", project.minecraft.version
replace "@VERSION@", project.version
replaceIn "SecretRoomsMod.java"
}
// add some stuff to the version
// spit out the version for debugging sake
logger.lifecycle ""+version
version = "${minecraft.version}-$version.${System.getenv().BUILD_NUMBER}"
logger.lifecycle ""+version
processResources
{
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in text files, not binary ones.
from(sourceSets.main.resources.srcDirs) {
include '**/*.info'
// replace version and MCVersion
// forge version is also accessible via project.minecraftforgeVersion
// it contains the full minecraft version, including buildNumber
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else, thats not text
from(sourceSets.main.resources.srcDirs) { exclude '**/*.info' }
}
repositories {
maven { // The repo from which to get waila
name "Mobius Repo"
url "http://mobiusstrip.eu/maven"
}
maven { // the repo from which to get NEI and stuff
name 'CB Repo'
url "http://chickenbones.net/maven/"
}
}
dependencies {
// I dont have to specify NEI.. because gradle magic. aka: transitive dependency resolution
compile "mcp.mobius.waila:Waila:1.5.2a"
compile 'org.projectlombok:lombok:1.12.6'
}
// because the normal output has been made to be obfuscated
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'dev'
}
// add a source jar
task sourceJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
// add a javadoc jar
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
// some crazy stuff to make sure the chicken stuff is in the mods folder...
// because it wont work otherwise... because FML doesnt laod coremods from the classpath
task copyChicken(type: Copy, dependsOn: "extractUserDev") {
from configurations.compile
include "**/*Chicken*.jar", "**/*NotEnoughItems*.jar"
exclude "**/CodeChickenLib*" // because CCC downloads it anyways.. -_-
into file(minecraft.assetDir + "/../mods") // paralell to the assets dir
}
tasks.setupDevWorkspace.dependsOn copyChicken
tasks.setupDecompWorkspace.dependsOn copyChicken
// deployement stuff
configurations { deployerJars }
dependencies { deployerJars "org.apache.maven.wagon:wagon-ssh:2.2" }
artifacts {
archives sourceJar
archives deobfJar
archives javadocJar
}
uploadArchives {
repositories {
if (project.hasProperty("filesmaven")) {
logger.info('Publishing to forge files server')
mavenDeployer {
configuration = configurations.deployerJars
repository(url: project.filesmaven.url) {
authentication(userName: project.filesmaven.username, privateKey: project.filesmaven.key)
}
pom {
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
project {
name project.archivesBaseName
packaging 'jar'
description 'SecretRoomsMod '
url 'https://github.com/AbrarSyed/SecretRoomsMod-forge'
scm {
url 'https://github.com/AbrarSyed/SecretRoomsMod-forge'
connection 'scm:git:git://github.com/AbrarSyed/SecretRoomsMod-forge.git'
developerConnection 'scm:git:[email protected]:AbrarSyed/SecretRoomsMod-forge.git'
}
issueManagement {
system 'github'
url 'https://github.com/AbrarSyed/SecretRoomsMod-forge/issues'
}
licenses {
license {
name 'The Eclipse Public Liscence'
url 'http://www.eclipse.org/legal/epl-v10.html'
distribution 'repo'
}
}
developers {
developer {
id 'AbrarSyed'
name 'AbrarSyed'
roles { role 'developer' }
}
developer {
id 'AlexBegt'
name 'AlexBegt'
roles { role 'contributor' }
}
developer {
id 'CaptainShadows'
name 'CaptainShadows'
roles { role 'contributor' }
}
}
}
}
}
}
else
{
add project.repositories.mavenLocal()
}
}
}