-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.1_10_2
104 lines (89 loc) · 3.28 KB
/
build.gradle.1_10_2
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
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:2.2-SNAPSHOT'
}
}
plugins {
id "com.matthewprenger.cursegradle" version "1.0.7"
}
apply plugin: 'net.minecraftforge.gradle.forge'
ext.minecraft_version = "1.10.2"
ext.raw_version = "1.0." + System.getenv('BUILD_NUMBER')
version = minecraft_version + "_" + raw_version
group= "info.loenwind.memorybar"
archivesBaseName = "memorybar"
sourceCompatibility = 1.7
targetCompatibility = 1.7
minecraft {
version = minecraft_version + "-12.18.2.2122"
runDir = "run"
mappings = "snapshot_20160518"
}
dependencies {
}
processResources
{
// this will ensure that this task is redone when the versions change.
inputs.property "version", raw_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':raw_version, 'mcversion':project.minecraft.version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
compileJava.doFirst {
String modFile = 'build/sources/main/java/info/loenwind/memorybar/MemoryBarMod.java'
File modFileFile = new File(projectDir, modFile)
String contents = modFileFile.getText('UTF-8')
// contents = contents.replaceAll('dependencies = ".*", guiFactory', 'dependencies = "' + project.ext.dependencies + '", guiFactory')
contents = contents.replaceAll('VERSION = ".*"', 'VERSION = "' + raw_version + '"')
modFileFile.write(contents, 'UTF-8')
}
jar.doFirst {
File lang = new File(projectDir, 'build/resources/main/assets/memorybar/lang/en_us.lang')
File langtmp = new File(projectDir, 'build/resources/main/assets/memorybar/lang/tmp')
lang.renameTo(langtmp)
langtmp = new File(projectDir, 'build/resources/main/assets/memorybar/lang/tmp')
langtmp.renameTo(new File(projectDir, 'build/resources/main/assets/memorybar/lang/en_US.lang'))
}
jar {
destinationDir = file 'dist'
includeEmptyDirs = false
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
jar.doLast { task ->
ant.checksum file: task.archivePath
}
boolean dev = System.getenv("RELEASE") == null || System.getenv("RELEASE").equalsIgnoreCase("false")
tasks.curseforge.enabled = !dev && System.getenv("CURSEFORGE_KEY") != null
curseforge {
if (System.getenv("CURSEFORGE_KEY") != null) {
apiKey = System.getenv("CURSEFORGE_KEY")
}
project {
id = "256167"
changelog = System.getenv('CHANGELOG') == null || System.getenv('CHANGELOG').equals('none') ? "NA" : System.getenv('CHANGELOG')
changelogType = 'html'
releaseType = "alpha"
mainArtifact(jar) {
displayName = "Version " + raw_version + " for Minecraft " + minecraft_version
}
}
}