This repository has been archived by the owner on Jan 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
82 lines (68 loc) · 1.94 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
// 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.1-SNAPSHOT'
}
}
apply plugin: "forge"
// stuff specific to my mod
group = 'com.madpcgaming.CityTech'
version = "prerelease-0.1"
archivesBaseName = 'CityTech'
// spit out the version for debugging sake
logger.lifecycle ""+version
minecraft {
version = "1.7.2-10.12.0.1025" // grab latest forge
assetDir = "run/assets"
}
// add some stuff to the version
version = "${minecraft.version}-$version.${System.getenv().BUILD_NUMBER}"
processResources
{
// replace stuff in text files, not binary ones.
from(sourceSets.main.resources.srcDirs) {
include '**/*.lang'
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 '**/*.lang'
exclude '**/*.info'
}
}
repositories {
mavenCentral()
}
// change the name of my obfuscated jar
jar {
appendix = 'universal'
}
// add a source jar
task sourceJar(type: Jar) {
from sourceSets.main.allSource
appendix = 'src'
}
// because the normal output has been made to be obfuscated
task deobfJar(type: Jar) {
from sourceSets.main.output
appendix = 'deobf'
}
artifacts {
archives sourceJar
archives deobfJar
}