forked from webbukkit/DynmapForge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
89 lines (76 loc) · 2.46 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
buildscript {
repositories {
mavenCentral()
mavenLocal()
maven {
name = "forgeFS"
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'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
// define the properties file
ext.configFile = file "build.properties"
configFile.withReader {
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
version = "${config.Dynmap_version}${config.Dynmap_extversion}"
group= "us.dynmap.forge" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "Dynmap"
targetCompatibility = '1.8'
sourceCompatibility = '1.8'
ext.buildNumber = System.getenv().BUILD_NUMBER ?: "Dev"
minecraft {
version = config.minecraft_version + "-" + config.forge_version
runDir = "run"
mappings = "snapshot_nodoc_20161111"
replaceIn "Version.java"
replace "@VERSION@", config.Dynmap_version + config.Dynmap_extversion + '-' + project.ext.buildNumber
replace "@BUILD_NUMBER@", project.ext.buildNumber
}
repositories {
mavenLocal()
}
configurations {
dynmap
compile.extendsFrom dynmap
}
dependencies {
dynmap group: 'us.dynmap', name: 'DynmapCore', version: "${config.Dynmap_version}${config.DynmapCore_devversion}", ext: 'jar'
dynmap group: 'us.dynmap', name:'DynmapCoreAPI', version: "${config.Dynmap_version}${config.DynmapCore_devversion}", ext: 'jar'
}
processResources
{
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand(
version: config.Dynmap_version + config.Dynmap_extversion + '-' + project.ext.buildNumber,
mcversion: config.minecraft_version
)
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
// Move access transformer to META-INF
rename '(.+_at.cfg)', 'META-INF/$1'
}
jar {
classifier = "forge-1.11"
destinationDir = project.projectDir
from { configurations.dynmap.collect { it.isDirectory() ? it : zipTree(it) } }
manifest {
attributes 'FMLAT': 'dynmap_at.cfg'
}
}