Skip to content

Commit

Permalink
Merge pull request com-lihaoyi#37 from lolgab/add-scala-native
Browse files Browse the repository at this point in the history
Add support for Scala Native 0.3 and 0.4.0-M2
  • Loading branch information
lihaoyi authored Mar 3, 2020
2 parents f30d30d + 5cfdafc commit e3cfdbd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
13 changes: 13 additions & 0 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,17 @@ object pprint extends Module {
val crossScalaVersion = JsPPrintModule.this.crossScalaVersion
}
}

object native extends Cross[NativePPrintModule](
("2.11.12", "0.3.9"), ("2.11.12", "0.4.0-M2")
)
class NativePPrintModule(val crossScalaVersion: String, crossScalaNativeVersion: String)
extends PPrintMainModule with ScalaNativeModule with PPrintModule {
def offset = os.up
def scalaNativeVersion = crossScalaNativeVersion
object test extends Tests with PPrintTestModule{
def offset = os.up
val crossScalaVersion = NativePPrintModule.this.crossScalaVersion
}
}
}
19 changes: 15 additions & 4 deletions mill
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# 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.6.0-15-ee0405
DEFAULT_MILL_VERSION=0.6.1

set -e

Expand All @@ -17,13 +17,24 @@ if [ -z "$MILL_VERSION" ] ; then
fi
fi

MILL_DOWNLOAD_PATH="$HOME/.mill/download"
MILL_EXEC_PATH="${MILL_DOWNLOAD_PATH}/$MILL_VERSION"
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"
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"
Expand Down

0 comments on commit e3cfdbd

Please sign in to comment.