mirror of https://github.com/sbt/sbt.git
Use custom published version of jarjar
This commit is contained in:
parent
6d5321f8f6
commit
3271d90b26
|
|
@ -24,14 +24,6 @@ install:
|
|||
iex 'sbt ++2.11.8 nscplugin/publishLocal util/publishLocal nir/publishLocal tools/publishLocal'
|
||||
Set-Location -Path ..
|
||||
}
|
||||
- ps: |
|
||||
if (!(Test-Path 'C:\Users\appveyor\.m2\repository\org\anarres\jarjar\jarjar-core\1.0.1-coursier-SNAPSHOT')) {
|
||||
iex 'git clone https://github.com/alexarchambault/jarjar'
|
||||
Set-Location -Path jarjar
|
||||
iex 'git checkout 249c8dbb970f8'
|
||||
iex './gradlew.bat :jarjar-core:install'
|
||||
Set-Location -Path ..
|
||||
}
|
||||
build_script:
|
||||
- sbt ++2.11.11 clean compile coreJVM/publishLocal cli/publishLocal
|
||||
- sbt ++2.12.1 http-server/publishLocal
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ lazy val `sbt-shading` = project
|
|||
plugin,
|
||||
shading,
|
||||
localM2Repository, // for a possibly locally published jarjar
|
||||
libs += Deps.jarjar.value % "shaded",
|
||||
libs += Deps.jarjar % "shaded",
|
||||
// dependencies of jarjar-core - directly depending on these so that they don't get shaded
|
||||
libs ++= Deps.jarjarTransitiveDeps
|
||||
)
|
||||
|
|
|
|||
|
|
@ -40,29 +40,7 @@ object Deps {
|
|||
"org.scala-lang.modules" %% "scala-async" % version
|
||||
}
|
||||
|
||||
def jarjar = Def.setting {
|
||||
val coursierJarjarVersion = "1.0.1-coursier-SNAPSHOT"
|
||||
def coursierJarjarFoundInM2 = (file(sys.props("user.home")) / s".m2/repository/org/anarres/jarjar/jarjar-core/$coursierJarjarVersion").exists()
|
||||
|
||||
val jarjarVersion =
|
||||
if (sys.env.contains("CI") || coursierJarjarFoundInM2 || !isSnapshot.value)
|
||||
coursierJarjarVersion
|
||||
else {
|
||||
val fallback = "1.0.0"
|
||||
|
||||
// streams.value.log.warn( // "a setting cannot depend on a task"
|
||||
scala.Console.err.println(
|
||||
s"""Warning: using jarjar $fallback, which doesn't properly shade Scala JARs (classes with '$$' aren't shaded).
|
||||
|See the instructions around
|
||||
|https://github.com/coursier/coursier/blob/630a780487d662dd994ed1c3246895a22c00cf21/scripts/travis.sh#L40
|
||||
|to use a version fine with Scala JARs.""".stripMargin
|
||||
)
|
||||
|
||||
fallback
|
||||
}
|
||||
|
||||
"org.anarres.jarjar" % "jarjar-core" % jarjarVersion
|
||||
}
|
||||
def jarjar = "io.get-coursier.jarjar" % "jarjar-core" % "1.0.1-coursier-1"
|
||||
|
||||
def jarjarTransitiveDeps = Seq(
|
||||
"com.google.code.findbugs" % "jsr305" % "2.0.2",
|
||||
|
|
|
|||
|
|
@ -68,21 +68,6 @@ setupCustomScalaNative() {
|
|||
fi
|
||||
}
|
||||
|
||||
setupCustomJarjar() {
|
||||
if [ ! -d "$HOME/.m2/repository/org/anarres/jarjar/jarjar-core/$JARJAR_VERSION" ]; then
|
||||
git clone https://github.com/alexarchambault/jarjar.git
|
||||
cd jarjar
|
||||
if ! grep -q "^version=$JARJAR_VERSION\$" gradle.properties; then
|
||||
echo "Expected jarjar version not found" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
git checkout 249c8dbb970f8
|
||||
./gradlew :jarjar-core:install
|
||||
cd ..
|
||||
rm -rf jarjar
|
||||
fi
|
||||
}
|
||||
|
||||
isScalaJs() {
|
||||
[ "$SCALA_JS" = 1 ]
|
||||
}
|
||||
|
|
@ -252,7 +237,6 @@ addPgpKeys() {
|
|||
downloadInstallSbtExtras
|
||||
setupCoursierBinDir
|
||||
|
||||
setupCustomJarjar
|
||||
setupCustomScalaNative
|
||||
|
||||
if isScalaJs; then
|
||||
|
|
|
|||
Loading…
Reference in New Issue