SHARE
TWEET

build.gradle with minifying

a guest Feb 17th, 2020 104 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. buildscript {
  2.     ext.kotlin_version = '1.3.0'
  3.     repositories {
  4.         jcenter()
  5.         maven {
  6.             name = "forge"
  7.             url = "https://files.minecraftforge.net/maven"
  8.         }
  9.         maven {
  10.             name = "SpongePowered"
  11.             url = "http://repo.spongepowered.org/maven"
  12.         }
  13.     }
  14.     dependencies {
  15.         classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
  16.         classpath "org.spongepowered:mixingradle:0.6-SNAPSHOT"
  17.         classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.4'
  18.         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  19.     }
  20. }
  21.  
  22. apply plugin: "net.minecraftforge.gradle.forge"
  23. apply plugin: "org.spongepowered.mixin"
  24. apply plugin: "com.github.johnrengelman.shadow"
  25. apply plugin: 'kotlin'
  26.  
  27. version = modVersion
  28. group = modGroup
  29. archivesBaseName = modBaseName
  30.  
  31. minecraft {
  32.     version = project.forgeVersion
  33.     runDir = "run"
  34.     mappings = project.mcpVersion
  35.     makeObfSourceJar = false
  36.     coreMod = "cookiedragon.luchadora.mixin.CoreMod"
  37. }
  38.  
  39. mixin {
  40.     defaultObfuscationEnv searge
  41.     add sourceSets.main, "mixin.luchadora.refmap.json"
  42. }
  43.  
  44. repositories {
  45.     mavenCentral()
  46.     jcenter()
  47.     maven {
  48.         name = "spongepowered-repo"
  49.         url = "http://repo.spongepowered.org/maven/"
  50.     }
  51.     maven {
  52.         url = "https://jitpack.io/"
  53.     }
  54. }
  55.  
  56. dependencies {
  57.     compile "com.mojang:brigadier:1.0.17"
  58.     compile 'com.jagrosh:DiscordIPC:0.4'
  59.     compile("org.spongepowered:mixin:0.8") {
  60.         exclude module: "launchwrapper"
  61.         exclude module: "guava"
  62.         exclude module: "gson"
  63.         exclude module: "commons-io"
  64.     }
  65.     compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  66.     compile "com.github.cookiedragon234:EventDispatcher:master-SNAPSHOT"
  67. }
  68.  
  69. processResources {
  70.     inputs.property "version", project.version
  71.     inputs.property "mcversion", project.minecraft.version
  72.  
  73.     from(sourceSets.main.resources.srcDirs) {
  74.         include "mcmod.info"
  75.         expand "version": project.version, "mcversion": project.minecraft.version
  76.     }
  77.  
  78.     from(sourceSets.main.resources.srcDirs) {
  79.         exclude "mcmod.info"
  80.     }
  81. }
  82.  
  83. jar {
  84.     manifest {
  85.         attributes(
  86.             "Main-Class": "cookiedragon.luchadora.Main",
  87.             "MixinConfigs": "mixins.luchadora.json",
  88.             "TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
  89.             "TweakOrder": 0,
  90.             "FMLCorePluginContainsFMLMod": "true",
  91.             "FMLCorePlugin": "cookiedragon.luchadora.mixin.CoreMod",
  92.             "ForceLoadAsMod": "true",
  93.         )
  94.     }
  95. }
  96.  
  97. shadowJar {
  98.     classifier = "shadow"
  99.     dependencies {
  100.         include(dependency("com.mojang:brigadier"))
  101.         include(dependency("org.spongepowered:mixin"))
  102.         include(dependency("org.jetbrains.kotlin:kotlin-stdlib"))
  103.         include(dependency("com.github.cookiedragon234:EventDispatcher"))
  104.     }
  105.     minimize {
  106.         exclude(dependency("org.spongepowered:mixin"))
  107.     }
  108. }
  109.  
  110. task clientJar(type: Jar, dependsOn: jar) {
  111.     manifest = project.tasks.jar.manifest
  112.     from(zipTree(jar.archivePath)) {
  113.         include "cookiedragon/luchadora/**"
  114.         include "assets/**"
  115.         include "*.json"
  116.         include "META-INF/**"
  117.         include "mcmod.info"
  118.     }
  119.     classifier = "client"
  120. }
  121.  
  122. task dependencyJar(type: Jar, dependsOn: shadowJar) {
  123.     from(zipTree(shadowJar.archivePath)) {
  124.         exclude "cookiedragon/luchadora/**"
  125.         exclude "mixins.luchadora.json"
  126.         exclude "mcmod.info"
  127.         exclude "assets/**"
  128.     }
  129.     classifier = "dependencies"
  130. }
  131.  
  132. task deleteNonUsed(type: Delete, dependsOn: shadowJar) {
  133.     //delete(fileTree("build/libs") {
  134.     //  exclude "$archivesBaseName-$version-dependencies.jar"
  135.     //  exclude "$archivesBaseName-$version-client.jar"
  136.     //})
  137. }
  138.  
  139. build.dependsOn(clientJar, dependencyJar, deleteNonUsed)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top