mirror of https://github.com/sbt/sbt.git
Merge pull request #603 from coursier/develop
Use custom published version of jarjar
This commit is contained in:
commit
744e6186d6
18
appveyor.yml
18
appveyor.yml
|
|
@ -14,24 +14,6 @@ install:
|
|||
- cmd: SET PATH=C:\sbt\sbt\bin;%JAVA_HOME%\bin;%PATH%
|
||||
- cmd: SET SBT_OPTS=-XX:MaxPermSize=2g -Xmx4g
|
||||
- git submodule update --init --recursive
|
||||
- ps: |
|
||||
if (!(Test-Path 'C:\Users\appveyor\.ivy2\local\sandbox\sandbox_native0.3_2.11\0.1-SNAPSHOT')) {
|
||||
iex 'git clone https://github.com/coursier/scala-native'
|
||||
Set-Location -Path scala-native
|
||||
iex 'git checkout 550bf6e37d27'
|
||||
iex 'sbt ++2.11.8 sandbox/publishLocal'
|
||||
iex 'git checkout f8088aef6981'
|
||||
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
|
||||
|
|
|
|||
13
build.sbt
13
build.sbt
|
|
@ -117,13 +117,14 @@ lazy val extra = project
|
|||
coursierPrefix,
|
||||
shading,
|
||||
libs ++= {
|
||||
val ver = "0.3.0-coursier-1"
|
||||
if (scalaBinaryVersion.value == "2.11")
|
||||
Seq(
|
||||
"org.scala-native" %% "tools" % ver % "shaded",
|
||||
// brought by tools, but issues in ShadingPlugin (with things published locally?) makes these not be shaded...
|
||||
"org.scala-native" %% "nir" % ver % "shaded",
|
||||
"org.scala-native" %% "util" % ver % "shaded",
|
||||
Deps.scalaNativeTools % "shaded",
|
||||
// brought by only tools, so should be automaticaly shaded,
|
||||
// but issues in ShadingPlugin (with things published locally?)
|
||||
// seem to require explicit shading...
|
||||
Deps.scalaNativeNir % "shaded",
|
||||
Deps.scalaNativeUtil % "shaded",
|
||||
Deps.fastParse % "shaded"
|
||||
)
|
||||
else
|
||||
|
|
@ -240,7 +241,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",
|
||||
|
|
@ -70,4 +48,8 @@ object Deps {
|
|||
"org.ow2.asm" % "asm-util" % "5.0.3",
|
||||
"org.slf4j" % "slf4j-api" % "1.7.25"
|
||||
)
|
||||
|
||||
def scalaNativeNir = "io.get-coursier.scala-native" %% "nir" % SharedVersions.scalaNative
|
||||
def scalaNativeTools = "io.get-coursier.scala-native" %% "tools" % SharedVersions.scalaNative
|
||||
def scalaNativeUtil = "io.get-coursier.scala-native" %% "util" % SharedVersions.scalaNative
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ object SharedVersions {
|
|||
def fastParse = "0.4.3"
|
||||
def http4s = "0.15.13a"
|
||||
def proguard = "5.3.3"
|
||||
def scalaNative = "0.3.0-coursier-1"
|
||||
def scalaz = "7.2.13"
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,33 +56,6 @@ integrationTestsRequirements() {
|
|||
launchTestRepo --port 8081
|
||||
}
|
||||
|
||||
setupCustomScalaNative() {
|
||||
if [ ! -d "$HOME/.ivy2/local/org.scala-native/tools_2.11/0.3.0-coursier-1" ]; then
|
||||
git clone https://github.com/coursier/scala-native.git
|
||||
cd scala-native
|
||||
git checkout 550bf6e37d27
|
||||
sbt ++2.11.8 sandbox/publishLocal
|
||||
git checkout f8088aef6981
|
||||
sbt ++2.11.8 nscplugin/publishLocal util/publishLocal nir/publishLocal tools/publishLocal
|
||||
cd ..
|
||||
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 ]
|
||||
}
|
||||
|
|
@ -232,7 +205,7 @@ testBootstrap() {
|
|||
testNativeBootstrap() {
|
||||
if is211; then
|
||||
sbt ++${SCALA_VERSION} cli/pack
|
||||
cli/target/pack/bin/coursier bootstrap -S -o native-test sandbox::sandbox_native0.3:0.1-SNAPSHOT
|
||||
cli/target/pack/bin/coursier bootstrap -S -o native-test io.get-coursier.scala-native::sandbox_native0.3:0.3.0-coursier-1
|
||||
if [ "$(./native-test)" != "Hello, World!" ]; then
|
||||
echo "Error: unexpected output from native test bootstrap." 1>&2
|
||||
exit 1
|
||||
|
|
@ -252,9 +225,6 @@ addPgpKeys() {
|
|||
downloadInstallSbtExtras
|
||||
setupCoursierBinDir
|
||||
|
||||
setupCustomJarjar
|
||||
setupCustomScalaNative
|
||||
|
||||
if isScalaJs; then
|
||||
jsCompile
|
||||
runJsTests
|
||||
|
|
|
|||
Loading…
Reference in New Issue