From ec15269192c4fbad6a8d641564850c9c18f54cdf Mon Sep 17 00:00:00 2001 From: Alexandre Archambault Date: Mon, 23 Apr 2018 11:38:16 +0200 Subject: [PATCH] Update proguard settings, test proguarded JAR on CI (#811) --- build.sbt | 4 +++- scripts/generate-launcher.sh | 8 ++++++-- scripts/travis.sh | 17 +++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index 01ac32f7b..a8721dfa3 100644 --- a/build.sbt +++ b/build.sbt @@ -472,9 +472,11 @@ lazy val proguardedCli = Seq( proguardVersion.in(Proguard) := SharedVersions.proguard, proguardOptions.in(Proguard) ++= Seq( "-dontwarn", + "-dontoptimize", // required since the switch to scala 2.12 "-keep class coursier.cli.Coursier {\n public static void main(java.lang.String[]);\n}", "-keep class coursier.cli.IsolatedClassLoader {\n public java.lang.String[] getIsolationTargets();\n}", - "-adaptresourcefilenames **.properties" + "-adaptresourcefilenames **.properties", + """-keep class scala.Symbol { *; }""" ), javaOptions.in(Proguard, proguard) := Seq("-Xmx3172M"), artifactPath.in(Proguard) := proguardDirectory.in(Proguard).value / "coursier-standalone.jar", diff --git a/scripts/generate-launcher.sh b/scripts/generate-launcher.sh index b7fa44e53..d564ac96d 100755 --- a/scripts/generate-launcher.sh +++ b/scripts/generate-launcher.sh @@ -1,8 +1,12 @@ #!/bin/bash +# grepped and updated during releases VERSION=1.1.0-M1 +ACTUAL_VERSION="${ACTUAL_VERSION:-"$VERSION"}" CACHE_VERSION=v1 +OUTPUT="${OUTPUT:-"coursier"}" + SBTPACK_LAUNCHER="$(dirname "$0")/../cli/target/pack/bin/coursier" if [ ! -f "$SBTPACK_LAUNCHER" ]; then @@ -10,11 +14,11 @@ if [ ! -f "$SBTPACK_LAUNCHER" ]; then fi "$SBTPACK_LAUNCHER" bootstrap \ - --intransitive io.get-coursier::coursier-cli:$VERSION \ + --intransitive "io.get-coursier::coursier-cli:$ACTUAL_VERSION" \ --classifier standalone \ -J "-noverify" \ --no-default \ -r central \ -r sonatype:releases \ - -f -o coursier \ + -f -o "$OUTPUT" \ "$@" diff --git a/scripts/travis.sh b/scripts/travis.sh index 107a8e2e7..3e247e940 100755 --- a/scripts/travis.sh +++ b/scripts/travis.sh @@ -116,6 +116,23 @@ testBootstrap() { echo "Error: unexpected output from bootstrapped echo command." 1>&2 exit 1 fi + + + if echo "$OSTYPE" | grep -q darwin; then + GREP="ggrep" + else + GREP="grep" + fi + + CURRENT_VERSION="$("$GREP" -oP '(?<=")[^"]*(?&2 + exit 1 + fi fi }