Update proguard settings, test proguarded JAR on CI (#811)

This commit is contained in:
Alexandre Archambault 2018-04-23 11:38:16 +02:00 committed by GitHub
parent 05049a235d
commit ec15269192
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 3 deletions

View File

@ -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",

View File

@ -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" \
"$@"

View File

@ -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 '(?<=")[^"]*(?<!")' version.sbt)"
sbt scalaFromEnv cli/publishLocal
ACTUAL_VERSION="$CURRENT_VERSION" OUTPUT="coursier-test" scripts/generate-launcher.sh -r ivy2Local
./coursier-test bootstrap -o cs-echo-launcher io.get-coursier:echo:1.0.0
if [ "$(./cs-echo-launcher foo)" != foo ]; then
echo "Error: unexpected output from bootstrapped echo command (generated by proguarded launcher)." 1>&2
exit 1
fi
fi
}