From 5b2c8ac3370c1e6864d1b4bb5202cd0606884e3a Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 29 Dec 2018 12:22:41 -0500 Subject: [PATCH] Removed '-snapshot' based dependencies --- build.gradle | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index 6f4aa2dccc..6f9ca76040 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,5 @@ +import groovy.json.JsonSlurper + buildscript{ repositories{ mavenLocal() @@ -12,11 +14,6 @@ buildscript{ } } -//make sure snapshot Arc does not get cached -configurations.all { - resolutionStrategy.cacheChangingModulesFor 0, 'seconds' -} - allprojects{ apply plugin: "idea" @@ -29,16 +26,25 @@ allprojects{ appName = 'Mindustry' gdxVersion = '1.9.9' roboVMVersion = '2.3.0' - uCoreVersion = 'bf399460a6a3656b0ed7cfe398a72befe2b66b42' - + arcHash = null + + localArc = { + return (System.properties["release"] == null || System.properties["release"] == "false") && new File(projectDir.parent, '../Arc').exists() + } + + getArcHash = { + //get latest commit hash from gtihub since JITPack's '-snapshot' version doesn't work correctly + if(arcHash == null) arcHash = new JsonSlurper().parseText(new URL("https://api.github.com/repos/Anuken/Arc/commits/master").text)["sha"] + return arcHash + } + arcModule = { String name -> - def comp = System.properties["release"] == null || System.properties["release"] == "false" - - if(new File(projectDir.parent, '../Arc').exists() && comp){ + if(localArc()){ return project(":Arc:$name") }else{ + //skip to last submodule if(name.contains(':')) name = name.split(':').last() - return "com.github.Anuken.Arc:$name:-SNAPSHOT" + return "com.github.Anuken.Arc:$name:${getArcHash()}" } } @@ -182,7 +188,10 @@ project(":core"){ dependencies{ build.finalizedBy(finish) - + + //forces JITPack to compile arc and its submodules + if(localArc()) compile "com.github.anuken:arc:${getArcHash()}" + compile arcModule("arc-core") compile arcModule("extensions:freetype")