Advertisement
Guest User

Untitled

a guest
Jul 12th, 2019
463
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 2.98 KB | None | 0 0
  1. plugins {
  2.   id 'eclipse'
  3.   id 'idea'
  4.   id 'fabric-loom' version '0.2.4-SNAPSHOT' apply false
  5.   id 'maven-publish'
  6. }
  7.  
  8. import net.fabricmc.loom.task.RunClientTask;
  9. import net.fabricmc.loom.task.RunServerTask;
  10.  
  11. configurations {
  12.   compile
  13. }
  14.  
  15. subprojects {
  16.   // https://fabricmc.net/use
  17.   String minecraft_version = '1.14.3'
  18.   String yarn_mappings = '1.14.3+build.1'
  19.   String loader_version = '0.4.8+build.155'
  20.   // https://maven.fabricmc.net/net/fabricmc/fabric
  21.   String fabric_version = '0.3.0+build.187'
  22.  
  23.   apply plugin: 'fabric-loom'
  24.   apply plugin: 'maven-publish'
  25.  
  26.   minecraft {}
  27.  
  28.   dependencies {
  29.     minecraft "com.mojang:minecraft:${minecraft_version}"
  30.     mappings "net.fabricmc:yarn:${yarn_mappings}"
  31.     modCompile "net.fabricmc:fabric-loader:${loader_version}"
  32.  
  33.     modCompile "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
  34.   }
  35.  
  36.   configurations {
  37.     compile
  38.   }
  39.  
  40.   task remapMavenJar(type: Copy, dependsOn: remapJar) {
  41.     afterEvaluate {
  42.       from("${project.buildDir}/libs/$archivesBaseName-${version}.jar")
  43.       into("${project.buildDir}/libs/")
  44.       rename { String fn -> "$archivesBaseName-${version}-maven.jar" }
  45.     }
  46.   }
  47.  
  48.   sourceCompatibility = JavaVersion.VERSION_1_8
  49.   targetCompatibility = JavaVersion.VERSION_1_8
  50.  
  51.   publishing {
  52.     publications {
  53.       mavenJava(MavenPublication) {
  54.         artifact(file("${project.buildDir}/libs/$archivesBaseName-${version}-maven.jar")) {
  55.                     builtBy remapMavenJar
  56.         }
  57.         artifact(sourcesJar) {
  58.           builtBy remapSourcesJar
  59.         }
  60.       }
  61.     }
  62.  
  63.     repositories {
  64.       mavenLocal()
  65.     }
  66.   }
  67.  
  68.   afterEvaluate {
  69.     artifacts {
  70.       compile file: file("${project.buildDir}/libs/$archivesBaseName-${version}-dev.jar"), type: "jar", builtBy: jar
  71.     }
  72.    
  73.     processResources {
  74.       inputs.property "version", project.version
  75.  
  76.       from(sourceSets.main.resources.srcDirs) {
  77.         include "fabric.mod.json"
  78.         expand "version": project.version
  79.       }
  80.  
  81.       from(sourceSets.main.resources.srcDirs) {
  82.         exclude "fabric.mod.json"
  83.       }
  84.     }
  85.   }
  86.  
  87.   jar {
  88.     from "LICENSE"
  89.   }
  90.  
  91.   tasks.withType(JavaCompile) {
  92.     options.encoding = "UTF-8"
  93.   }
  94.  
  95.   task sourcesJar(type: Jar, dependsOn: classes) {
  96.     classifier = "sources"
  97.     from sourceSets.main.allSource
  98.   }
  99. }
  100.  
  101. project(':rpgcraft') {
  102.   archivesBaseName = 'rpgcraft'
  103.   version = '0.1.0'
  104.   group = 'net.hellomouse'
  105.  
  106.   dependencies {
  107.     compileOnly 'io.github.prospector.modmenu:ModMenu:1.6.3-95'
  108.   }
  109. }
  110.  
  111. project(':inwizardry') {
  112.   archivesBaseName = 'inwizardry'
  113.   version = '0.1.0'
  114.   group = 'net.hellomouse'
  115.  
  116.   dependencies {
  117.     modCompile project(':rpgcraft')
  118.   }
  119. }
  120.  
  121. tasks.register("runClient", RunClientTask.class) {
  122.   dependsOn(":inwizardry:runClient")
  123. }
  124.  
  125. tasks.register("runServer", RunServerTask.class) {
  126.   dependsOn(":inwizardry:runServer")
  127. }
  128.  
  129. tasks.register("build") {
  130.   dependsOn(":rpgcraft:build")
  131.   dependsOn(":inwizardry:build")
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement