aboutsummaryrefslogtreecommitdiff
path: root/spark-forge1710/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'spark-forge1710/build.gradle')
-rw-r--r--spark-forge1710/build.gradle92
1 files changed, 92 insertions, 0 deletions
diff --git a/spark-forge1710/build.gradle b/spark-forge1710/build.gradle
new file mode 100644
index 0000000..8fd166d
--- /dev/null
+++ b/spark-forge1710/build.gradle
@@ -0,0 +1,92 @@
+buildscript {
+ repositories {
+ mavenCentral()
+ maven { url = "https://maven.minecraftforge.net" }
+ }
+ dependencies {
+ classpath ('com.anatawa12.forge:ForgeGradle:1.2-1.0.+') {
+ changing = true
+ }
+ }
+}
+
+plugins {
+ id 'com.github.johnrengelman.shadow' version '7.0.0'
+}
+
+apply plugin: 'forge'
+
+// These settings allow you to choose what version of Java you want to be compatible with. Forge 1.7.10 runs on Java 6 to 8.
+sourceCompatibility = 1.8
+targetCompatibility = 1.8
+
+minecraft {
+ version = "1.7.10-10.13.4.1614-1.7.10"
+ runDir = "run"
+ mappings = 'stable_12'
+
+ replaceIn 'src/main/java/me/lucko/spark/forge/Forge1710SparkMod.java'
+ replace "@version@", project.pluginVersion
+}
+
+configurations {
+ shade
+ implementation.extendsFrom shade
+}
+
+// https://github.com/MinecraftForge/ForgeGradle/issues/627#issuecomment-533927535
+configurations.all {
+ resolutionStrategy {
+ force 'org.lwjgl.lwjgl:lwjgl-platform:2.9.4-nightly-20150209'
+ }
+}
+
+dependencies {
+ shade project(':spark-common')
+}
+
+processResources {
+ from(sourceSets.main.resources.srcDirs) {
+ include 'mcmod.info'
+ expand (
+ 'pluginVersion': project.pluginVersion,
+ 'pluginDescription': project.pluginDescription
+ )
+ }
+}
+
+jar {
+ manifest {
+ attributes 'FMLAT': 'spark_at.cfg'
+ }
+}
+
+shadowJar {
+ archiveName = 'spark-forge1710.jar'
+ configurations = [project.configurations.shade]
+
+ relocate 'okio', 'me.lucko.spark.lib.okio'
+ relocate 'okhttp3', 'me.lucko.spark.lib.okhttp3'
+ relocate 'net.kyori.adventure', 'me.lucko.spark.lib.adventure'
+ relocate 'net.kyori.examination', 'me.lucko.spark.lib.adventure.examination'
+ relocate 'net.bytebuddy', 'me.lucko.spark.lib.bytebuddy'
+ relocate 'org.tukaani.xz', 'me.lucko.spark.lib.xz'
+ relocate 'com.google.protobuf', 'me.lucko.spark.lib.protobuf'
+ relocate 'org.objectweb.asm', 'me.lucko.spark.lib.asm'
+ relocate 'one.profiler', 'me.lucko.spark.lib.asyncprofiler'
+
+ exclude 'module-info.class'
+ exclude 'META-INF/maven/**'
+ exclude 'META-INF/proguard/**'
+}
+
+reobf.reobf(shadowJar) { spec ->
+ spec.classpath = sourceSets.main.compileClasspath;
+}
+
+artifacts {
+ archives shadowJar
+ shadow shadowJar
+}
+
+build.dependsOn(shadowJar) \ No newline at end of file