From 55cd02be036af2dae74c8b8d66cdfd4df3feab53 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sat, 26 Sep 2020 06:38:51 -0400 Subject: [PATCH 1/2] Fix fetching of RT Export Previously it was depending on the side effect of export repo. This doesn't work when we don't construct offline installer. --- build.sbt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 4c39051e5..d05577998 100755 --- a/build.sbt +++ b/build.sbt @@ -59,6 +59,7 @@ val windowsBuildId = settingKey[Int]("build id for Windows installer") val debianBuildId = settingKey[Int]("build id for Debian") val exportRepoUsingCoursier = taskKey[File]("export Maven style repository") +val rtExportUsingCoursier = taskKey[File]("Grab RT export utility") val exportRepoCsrDirectory = settingKey[File]("") val x86MacPlatform = "x86_64-apple-darwin" @@ -244,6 +245,15 @@ val root = (project in file(".")). packageName in Universal := packageName.value, // needs to be set explicitly due to a bug in native-packager version in Universal := sbtVersionToRelease, + rtExportUsingCoursier := { + val csr = + if (isWindows) (baseDirectory in LocalRootProject).value / "bin" / "coursier.bat" + else (baseDirectory in LocalRootProject).value / "bin" / "coursier" + val cache = target.value / "coursier" + s"$csr fetch --cache $cache ${colonName(java9rtexport)}".! + (cache ** "*.jar").get.head + }, + mappings in Universal := { val t = (target in Universal).value val prev = (mappings in Universal).value @@ -275,7 +285,7 @@ val root = (project in file(".")). mappings in Universal ++= { val launchJar = sbtLaunchJar.value - val rtExportJar = ((exportRepoCsrDirectory in dist).value / "org/scala-sbt/rt/java9-rt-export" / java9rtexportVersion / s"java9-rt-export-${java9rtexportVersion}.jar") + val rtExportJar = rtExportUsingCoursier.value Seq( launchJar -> "bin/sbt-launch.jar", rtExportJar -> "bin/java9-rt-export.jar" @@ -446,7 +456,6 @@ lazy val dist = (project in file("dist")) s"$csr fetch --cache $cache ${colonName(jansi)}".! s"$csr fetch --cache $cache ${colonName(scala212Compiler)}".! s"$csr fetch --cache $cache ${colonName(scala212Xml)}".! - s"$csr fetch --cache $cache ${colonName(java9rtexport)}".! val mavenCache = cache / "https" / "repo1.maven.org" / "maven2" val compilerBridgeVer = IO.listFiles(mavenCache / "org" / "scala-sbt" / "compiler-bridge_2.12", DirectoryFilter).toList.headOption compilerBridgeVer match { From 0e459fc9f3f8cd5fd2ef9e2f362ea45075517156 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sat, 26 Sep 2020 07:13:49 -0400 Subject: [PATCH 2/2] Resolve Coursier first? --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 0fe2a3dea..7d8675b1a 100755 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,7 @@ matrix: - curl https://piccolo.link/sbt-$SBT_VER.zip -L --output /tmp/sbt.zip - unzip /tmp/sbt.zip -d $HOME/sbt - export PATH="$HOME/sbt/sbt/bin:$PATH" + - bin/coursier.bat resolve script: - sbt -Dsbt.build.version=$SBT_VER universal:packageBin universal:stage integrationTest/test - cd citest @@ -45,6 +46,7 @@ matrix: - curl https://piccolo.link/sbt-$SBT_VER.zip -L --output /tmp/sbt.zip - unzip /tmp/sbt.zip -d $HOME/sbt - export PATH="$HOME/sbt/sbt/bin:$PATH" + - bin/coursier resolve script: - sbt -Dsbt.build.version=$SBT_VER universal:packageBin universal:stage integrationTest/test - cd citest && ./test.sh @@ -73,6 +75,7 @@ install: - curl https://piccolo.link/sbt-$SBT_VER.zip -L --output /tmp/sbt.zip - unzip /tmp/sbt.zip -d $HOME/sbt - export PATH="$HOME/sbt/sbt/bin:$PATH" + - bin/coursier resolve cache: directories: