forked from tterrag1098/WAILAPlugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
116 lines (93 loc) · 2.99 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
buildscript {
repositories {
mavenCentral()
maven { url = "http://files.minecraftforge.net/maven" }
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
classpath 'de.undercouch:gradle-download-task:1.0'
}
}
apply plugin: 'forge'
apply plugin: 'maven-publish'
apply plugin: 'curseforge'
group = 'tterrag.wailaplugins'
archivesBaseName = "WAILAPlugins"
version = "MC${minecraft_version}-${mod_version}-${System.getenv().BUILD_NUMBER}"
minecraft {
version = "${minecraft_version}-${forge_version}"
runDir = 'run'
replace "@VERSION@", project.version
replace "${toReplace}", "required-after:Forge@[${forge_version},);required-after:ttCore@[${ttCore_version},);required-after:Waila;"
replaceIn "WailaPlugins.java"
}
repositories {
maven { // ttCore
name 'tterrag Repo'
url "http://maven.tterrag.com/"
}
maven { // WAILA
name "Mobius Repo"
url "http://mobiusstrip.eu/maven"
}
maven { // CCC/NEI (for WAILA)
name 'CB Repo'
url "http://chickenbones.net/maven/"
}
}
dependencies {
compile "tterrag.core:ttCore:${ttCore_version}"
compile "mcp.mobius.waila:Waila:${WAILA_version}"
compile fileTree(dir: 'libs', include: '*.jar')
}
processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include '**/*.info'
include '**/*.properties'
// 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 '**/*.info'
exclude '**/*.properties'
}
}
jar {
}
task sourceJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
}
import de.undercouch.gradle.tasks.download.Download
task downloadZip(type: Download) {
src 'http://assets.tterrag.com/WAILAPlugins/libs.zip'
dest new File(buildDir, 'libs.zip')
onlyIfNewer true
}
task downloadLibs(dependsOn: downloadZip, type: Copy) {
from zipTree(downloadZip.dest)
into file('libs')
}
tasks.build.dependsOn sourceJar, deobfJar
tasks.sourceMainJava.dependsOn downloadLibs
tasks.eclipse.dependsOn downloadLibs
tasks.idea.dependsOn downloadLibs
curse {
dependsOn 'reobf'
onlyIf {
return project.hasProperty('curseforge_key') && System.getenv("CURSE") != null && System.getenv("CURSE").equalsIgnoreCase("true")
}
if (project.hasProperty('curseforge_key')) apiKey = project.curseforge_key
projectId = project.curse_projectId
changelog = project.hasProperty('changelog') ? project.changelog : ''
releaseType = 'beta'
}