-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
91 lines (80 loc) · 2.93 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
//
// Example Module gradle build script. This script uses ForgeGradle and the
// LiteLoader plugin to provide an easy-to-use development and test environment
// for Macros modules.
//
// You do not need to edit this script, all customisable values can be assigned
// via the gradle.properties file. However you may wish to add your own custom
// build logic to this file where necessary.
//
buildscript {
repositories {
mavenCentral()
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
// Read the versions out of the macros version string
ext {
assert macros ==~ /^.+_for_.*$/ : "Macros version specifier was invalid"
modVersion = macros.split("_for_")[0]
mcVersion = macros.split("_for_")[1]
}
// Use LiteLoader environment
apply plugin: 'net.minecraftforge.gradle.liteloader'
// Configure minecraft environment based on properties
minecraft {
version = project.mcVersion
mappings = project.mappings
runDir = "run"
}
// Configure macros repository, this is where the API and dev jars will be
// downloaded from, do not alter this section
repositories {
maven {
name = 'mumfrey'
url = 'http://repo.mumfrey.com/content/repositories/macros'
}
}
// Depend on macros of the specified version (API is acquired via the dev POM)
dependencies {
deobfCompile "net.eq2online:macrosdev:$modVersion"
compile files("libs/module_documentorAPI-0.1-26.1-0.15.4-mc1.12.1.jar")
}
afterEvaluate {
// Configure eclipse run configurations with the necessary JVM arguments to
// inject the project classes into macros at runtime
makeEclipseCleanRunClient {
arguments = ""
jvmArguments = "-Dmacros.modules=" + modules.split(",").collect{mod -> "$basePackage.$mod"}.join(',')
}
// Get the resolved Macros API version in order to decorate the jar
def deobfResolved = configurations.deobfCompile.resolvedConfiguration.resolvedArtifacts
def apiVersion = deobfResolved.findAll({it.name == "macrosapi"})[0].moduleVersion.id.version
// Set the jar name up with the required prefix, and append information
// about the API and Macros Mod version
jar {
baseName = "module_" + archivesBaseName
classifier = "$apiVersion-$modVersion-" + jar.classifier
extension = "jar"
}
// Same for the source jar
sourceJar {
baseName = jar.baseName
classifier = jar.classifier + "-sources"
}
}
task copyJarToRun(type: Copy) {
def home = System.getenv("HOME");
from jar
into home + "/minecraft/liteloader_forge_1.12/liteconfig/common/macros/modules"
}