-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from com-lihaoyi/add-211
Reintroduce support for Scala 2.11
- Loading branch information
Showing
5 changed files
with
129 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
- name: Run tests | ||
run: ./mill -i -j $(nproc) __.publishArtifacts __.test | ||
|
||
publish-sonatype: | ||
if: github.repository == 'com-lihaoyi/acyclic' && contains(github.ref, 'refs/tags/') | ||
needs: test | ||
runs-on: ubuntu-latest | ||
env: | ||
SONATYPE_PGP_PRIVATE_KEY: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY }} | ||
SONATYPE_PGP_PRIVATE_KEY_PASSWORD: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY_PASSWORD }} | ||
SONATYPE_USER: ${{ secrets.SONATYPE_USER }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
LANG: "en_US.UTF-8" | ||
LC_MESSAGES: "en_US.UTF-8" | ||
LC_ALL: "en_US.UTF-8" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
- name: Publish to Maven Central | ||
run: | | ||
if [[ $(git tag --points-at HEAD) != '' ]]; then | ||
echo $SONATYPE_PGP_PRIVATE_KEY | base64 --decode > gpg_key | ||
gpg --import --no-tty --batch --yes gpg_key | ||
rm gpg_key | ||
./mill -i mill.scalalib.PublishModule/publishAll \ | ||
--sonatypeCreds $SONATYPE_USER:$SONATYPE_PASSWORD \ | ||
--gpgArgs --passphrase=$SONATYPE_PGP_PRIVATE_KEY_PASSWORD,--no-tty,--pinentry-mode,loopback,--batch,--yes,-a,-b \ | ||
--publishArtifacts __.publishArtifacts \ | ||
--readTimeout 600000 \ | ||
--awaitTimeout 600000 \ | ||
--release true \ | ||
--signed true | ||
fi |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package acyclic.plugin | ||
|
||
import acyclic.file | ||
|
||
import scala.collection.{SortedSet, SortedSetLike} | ||
import scala.collection.mutable.Builder | ||
import scala.collection.generic.{CanBuildFrom, SortedSetFactory} | ||
import scala.language.implicitConversions | ||
|
||
object Compat { | ||
|
||
// from https://github.com/scala/scala-collection-compat/blob/746a7de28223812b19d0d9f68d2253e0c5f655ca/compat/src/main/scala-2.11_2.12/scala/collection/compat/CompatImpl.scala#L8-L11 | ||
private def simpleCBF[A, C](f: => Builder[A, C]): CanBuildFrom[Any, A, C] = new CanBuildFrom[Any, A, C] { | ||
def apply(from: Any): Builder[A, C] = apply() | ||
def apply(): Builder[A, C] = f | ||
} | ||
|
||
// from https://github.com/scala/scala-collection-compat/blob/746a7de28223812b19d0d9f68d2253e0c5f655ca/compat/src/main/scala-2.11_2.12/scala/collection/compat/PackageShared.scala#L46-L49 | ||
implicit def sortedSetCompanionToCBF[A: Ordering, | ||
CC[X] <: SortedSet[X] with SortedSetLike[X, CC[X]]]( | ||
fact: SortedSetFactory[CC]): CanBuildFrom[Any, A, CC[A]] = | ||
simpleCBF(fact.newBuilder[A]) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env sh | ||
|
||
# This is a wrapper script, that automatically download mill from GitHub release pages | ||
# You can give the required mill version with MILL_VERSION env variable | ||
# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION | ||
DEFAULT_MILL_VERSION=0.9.5-52-ef6d5d | ||
|
||
set -e | ||
|
||
if [ -z "$MILL_VERSION" ] ; then | ||
if [ -f ".mill-version" ] ; then | ||
MILL_VERSION="$(head -n 1 .mill-version 2> /dev/null)" | ||
elif [ -f "mill" ] && [ "$BASH_SOURCE" != "mill" ] ; then | ||
MILL_VERSION=$(grep -F "DEFAULT_MILL_VERSION=" "mill" | head -n 1 | cut -d= -f2) | ||
else | ||
MILL_VERSION=$DEFAULT_MILL_VERSION | ||
fi | ||
fi | ||
|
||
if [ "x${XDG_CACHE_HOME}" != "x" ] ; then | ||
MILL_DOWNLOAD_PATH="${XDG_CACHE_HOME}/mill/download" | ||
else | ||
MILL_DOWNLOAD_PATH="${HOME}/.cache/mill/download" | ||
fi | ||
MILL_EXEC_PATH="${MILL_DOWNLOAD_PATH}/${MILL_VERSION}" | ||
|
||
version_remainder="$MILL_VERSION" | ||
MILL_MAJOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}" | ||
MILL_MINOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}" | ||
|
||
if [ ! -x "$MILL_EXEC_PATH" ] ; then | ||
mkdir -p $MILL_DOWNLOAD_PATH | ||
if [ "$MILL_MAJOR_VERSION" -gt 0 ] || [ "$MILL_MINOR_VERSION" -ge 5 ] ; then | ||
ASSEMBLY="-assembly" | ||
fi | ||
DOWNLOAD_FILE=$MILL_EXEC_PATH-tmp-download | ||
MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION%%-*}/$MILL_VERSION${ASSEMBLY}" | ||
curl --fail -L -o "$DOWNLOAD_FILE" "$MILL_DOWNLOAD_URL" | ||
chmod +x "$DOWNLOAD_FILE" | ||
mv "$DOWNLOAD_FILE" "$MILL_EXEC_PATH" | ||
unset DOWNLOAD_FILE | ||
unset MILL_DOWNLOAD_URL | ||
fi | ||
|
||
unset MILL_DOWNLOAD_PATH | ||
unset MILL_VERSION | ||
|
||
exec $MILL_EXEC_PATH "$@" |