forked from BTW-Community/CraftGuide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
153 lines (126 loc) · 3.67 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
Properties ver = new Properties()
File versionFile = new File('version.txt')
// build is to distinguish bugfix releases, as the fourth number in the mod version. Resets when any of the others increase.
ver.build = 0
// with the default values set above, now try reading the actual values
ver.load(versionFile.newDataInputStream())
buildscript {
repositories {
mavenCentral()
maven {
name = 'forge'
url = 'https://files.minecraftforge.net/maven'
}
maven {
name = 'sonatype'
url = 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
classpath 'gradle.plugin.com.matthewprenger:CurseGradle:1.0.9'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'com.matthewprenger.cursegradle'
sourceCompatibility = targetCompatibility = '1.7'
compileJava {
sourceCompatibility = targetCompatibility = '1.7'
}
String minecraft_versions = '1.9.4'
version = '1.7.1.' + ver.build
group = 'uristqwerty'
archivesBaseName = 'CraftGuide'
minecraft {
version = '1.9.4-12.17.0.1976'
runDir = 'run'
mappings = 'stable_26'
replace '@MOD_VERSION@', project.version
replaceIn 'CraftGuide_FML.java'
}
repositories {
maven {
name = 'Player\'s Repo'
url = 'http://maven.ic2.player.to/'
}
ivy {
name 'BuildCraft'
artifactPattern 'https://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision](-[classifier]).[ext]'
}
}
dependencies {
deobfCompile name: 'buildcraft', version: '7.2.8', classifier: 'api'
compile 'net.industrial-craft:industrialcraft-2:2.5.8-ex19:dev'
}
task themeZip(type: Zip) {
from 'themes'
archiveName 'CraftGuideResources.zip'
destinationDir sourceSets.main.output.resourcesDir
}
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'
}
}
processResources.dependsOn themeZip
jar {
classifier = 'forge'
}
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'dev'
}
task apiJar(type: Jar) {
from (sourceSets.main.output) {
include 'uristqwerty/CraftGuide/api/**'
}
from (sourceSets.main.allJava) {
include 'uristqwerty/CraftGuide/api/**'
}
classifier = 'api'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
classifier = 'sources'
}
task publish(type: Exec) {
commandLine 'cmd', '/c', 'publish.bat', project.version, minecraft_versions
}
curseforge {
apiKey = project.curseForgeApiKey
project {
id = '75557'
releaseType = 'release' //alpha|beta|release
changelog = file('changes.txt')
addGameVersion minecraft_versions
mainArtifact jar
addArtifact deobfJar
addArtifact apiJar
addArtifact sourcesJar
}
}
publish.dependsOn build
//curseforge.dependsOn publish
artifacts {
archives deobfJar
archives apiJar
archives sourcesJar
}
build.doLast {
ver.build = '' + ((ver.build as int) + 1)
ver.store(versionFile.newWriter(), null)
}