mirror of https://github.com/sbt/sbt.git
Update Scala Native setup
This commit is contained in:
parent
04823219e9
commit
838e7562f5
11
.travis.yml
11
.travis.yml
|
|
@ -1,18 +1,15 @@
|
||||||
dist: trusty
|
os: linux
|
||||||
group: stable
|
|
||||||
sudo: required
|
|
||||||
|
|
||||||
env:
|
|
||||||
- SCALANATIVE_GC=boehm
|
|
||||||
|
|
||||||
language: scala
|
language: scala
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- jdk: openjdk8
|
- jdk: openjdk8
|
||||||
# - jdk: openjdk11
|
# - jdk: openjdk11
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- bash scripts/travis_setup.sh
|
- sudo apt-get update
|
||||||
|
- curl https://raw.githubusercontent.com/scala-native/scala-native/master/scripts/travis_setup.sh | bash -x
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- export JVM_OPTS="-Dfile.encoding=UTF-8 -Xmx1G -Xms1G -server -XX:ReservedCodeCacheSize=128M"
|
- export JVM_OPTS="-Dfile.encoding=UTF-8 -Xmx1G -Xms1G -server -XX:ReservedCodeCacheSize=128M"
|
||||||
|
|
|
||||||
|
|
@ -1,74 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Format C/C++ code using clang-format.
|
|
||||||
#
|
|
||||||
# To ensure reproducible formatting the script checks that clang-format
|
|
||||||
# is from the most recent version of LLVM supported by Scala Native.
|
|
||||||
#
|
|
||||||
# Usage: $0 [--test]
|
|
||||||
#
|
|
||||||
# Set CLANG_FORMAT_PATH to configure path to clang-format.
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
IFS=$'\n\t'
|
|
||||||
|
|
||||||
# The required version of clang-format.
|
|
||||||
CLANG_FORMAT_VERSION=5.0
|
|
||||||
CLANG_FORMAT_VERSION_STRING="clang-format version $CLANG_FORMAT_VERSION"
|
|
||||||
|
|
||||||
die() {
|
|
||||||
while [ "$#" -gt 0 ]; do
|
|
||||||
echo >&2 "$1"; shift
|
|
||||||
done
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
check_clang_format_version() {
|
|
||||||
cmd="$1"
|
|
||||||
[ -e "$(type -P "$cmd")" ] && \
|
|
||||||
"$cmd" --version 2> /dev/null | grep -q "$CLANG_FORMAT_VERSION_STRING"
|
|
||||||
}
|
|
||||||
|
|
||||||
clang_format=
|
|
||||||
|
|
||||||
if [ -n "${CLANG_FORMAT_PATH:-}" ]; then
|
|
||||||
check_clang_format_version "$CLANG_FORMAT_PATH" || \
|
|
||||||
die "CLANG_FORMAT_PATH does not have required version $CLANG_FORMAT_VERSION" \
|
|
||||||
"CLANG_FORMAT_PATH points to $CLANG_FORMAT_PATH"
|
|
||||||
clang_format="$CLANG_FORMAT_PATH"
|
|
||||||
else
|
|
||||||
for cmd in "clang-format-$CLANG_FORMAT_VERSION" clang-format; do
|
|
||||||
if check_clang_format_version "$cmd"; then
|
|
||||||
clang_format="$cmd"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$clang_format" ]; then
|
|
||||||
die "clang-format version $CLANG_FORMAT_VERSION not found" \
|
|
||||||
"Install LLVM version $CLANG_FORMAT_VERSION and rerun."
|
|
||||||
fi
|
|
||||||
|
|
||||||
test_mode=
|
|
||||||
|
|
||||||
while [ "$#" -gt 0 ]; do
|
|
||||||
arg="$1"
|
|
||||||
case "$arg" in
|
|
||||||
--test) test_mode=true; shift ;;
|
|
||||||
--*) die "Unknown argument: $arg" "Usage: $0 [--test]" ;;
|
|
||||||
*) break ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "$#" -gt 0 ]; then
|
|
||||||
"$clang_format" --style=file -i "$@"
|
|
||||||
else
|
|
||||||
find . -name "*.[ch]" -or -name "*.cpp" | xargs "$clang_format" --style=file -i
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$test_mode" = true ]; then
|
|
||||||
git diff --quiet --exit-code || \
|
|
||||||
die "C/C++ code formatting changes detected" \
|
|
||||||
"Run \`$0\` to reformat."
|
|
||||||
fi
|
|
||||||
1128
scripts/gyb.py
1128
scripts/gyb.py
File diff suppressed because it is too large
Load Diff
|
|
@ -1,22 +0,0 @@
|
||||||
"""
|
|
||||||
Utility that lists all non-implementation specific classes in javalib.
|
|
||||||
|
|
||||||
It must be run from the root of the Scala Native checkout.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import subprocess,os
|
|
||||||
|
|
||||||
cwd = os.getcwd()
|
|
||||||
|
|
||||||
target = cwd + "/javalib/target/scala-2.11/classes/"
|
|
||||||
|
|
||||||
paths = subprocess.check_output(["find", target, "-name", "*.nir"])
|
|
||||||
|
|
||||||
classes = sorted(list(set(
|
|
||||||
line.replace(target, "").replace(".nir", "").lstrip("/").rstrip("$").replace("/", ".")
|
|
||||||
for line in paths.split("\n")
|
|
||||||
if "$$anon" not in line and "java/" in line
|
|
||||||
)))
|
|
||||||
|
|
||||||
for cls in classes:
|
|
||||||
print("* ``{}``".format(cls))
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
HERE="`dirname $0`"
|
|
||||||
|
|
||||||
nix-shell $HERE/scala-native.nix -A clangEnv
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
sbt rebuild test-all
|
|
||||||
sbt "tools/mimaReportBinaryIssues"
|
|
||||||
sbt publishSigned
|
|
||||||
sbt "project nscplugin" ++2.11.12 publishSigned
|
|
||||||
sbt "project nscplugin" ++2.11.11 publishSigned
|
|
||||||
sbt "project nscplugin" ++2.11.8 publishSigned
|
|
||||||
sbt ^^1.0.4 sbtScalaNative/publishSigned nir/publishSigned tools/publishSigned util/publishSigned testRunner/publishSigned
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
let
|
|
||||||
pkgs = import <nixpkgs> {};
|
|
||||||
stdenv = pkgs.stdenv;
|
|
||||||
in rec {
|
|
||||||
clangEnv = stdenv.mkDerivation rec {
|
|
||||||
name = "clang-env";
|
|
||||||
shellHook = ''
|
|
||||||
alias cls=clear
|
|
||||||
'';
|
|
||||||
CLANG_PATH = pkgs.clang + "/bin/clang";
|
|
||||||
CLANGPP_PATH = pkgs.clang + "/bin/clang++";
|
|
||||||
buildInputs = with pkgs; [
|
|
||||||
stdenv
|
|
||||||
sbt
|
|
||||||
openjdk
|
|
||||||
boehmgc
|
|
||||||
libunwind
|
|
||||||
re2
|
|
||||||
clang
|
|
||||||
zlib
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# set -x
|
|
||||||
|
|
||||||
HERE="`dirname $0`"
|
|
||||||
VERSION="1.2.0"
|
|
||||||
COURSIER="$HERE/.coursier"
|
|
||||||
SCALAFMT="$HERE/.scalafmt-$VERSION"
|
|
||||||
|
|
||||||
if [ ! -f $COURSIER ]; then
|
|
||||||
curl -L -o $COURSIER https://git.io/vgvpD
|
|
||||||
chmod +x $COURSIER
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f $SCALAFMT ]; then
|
|
||||||
$COURSIER bootstrap com.geirsson:scalafmt-cli_2.11:$VERSION --main org.scalafmt.cli.Cli -o $SCALAFMT
|
|
||||||
chmod +x $SCALAFMT
|
|
||||||
fi
|
|
||||||
|
|
||||||
$SCALAFMT "$@"
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Enable strict mode and fail the script on non-zero exit code,
|
|
||||||
# unresolved variable or pipe failure.
|
|
||||||
set -euo pipefail
|
|
||||||
IFS=$'\n\t'
|
|
||||||
|
|
||||||
if [ "$(uname)" == "Darwin" ]; then
|
|
||||||
|
|
||||||
brew update
|
|
||||||
brew install sbt
|
|
||||||
brew install bdw-gc
|
|
||||||
brew link bdw-gc
|
|
||||||
brew install jq
|
|
||||||
brew install re2
|
|
||||||
brew install llvm@4
|
|
||||||
export PATH="/usr/local/opt/llvm@4/bin:$PATH"
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
sudo apt-get update
|
|
||||||
|
|
||||||
# Remove pre-bundled libunwind
|
|
||||||
sudo find /usr -name "*libunwind*" -delete
|
|
||||||
|
|
||||||
# Use pre-bundled clang
|
|
||||||
export PATH=/usr/local/clang-5.0.0/bin:$PATH
|
|
||||||
export CXX=clang++
|
|
||||||
|
|
||||||
# Install Boehm GC and libunwind
|
|
||||||
sudo apt-get install libgc-dev libunwind8-dev
|
|
||||||
|
|
||||||
# Build and install re2 from source
|
|
||||||
git clone https://code.googlesource.com/re2
|
|
||||||
pushd re2
|
|
||||||
git checkout 2017-03-01
|
|
||||||
make -j4 test
|
|
||||||
sudo make install prefix=/usr
|
|
||||||
make testinstall prefix=/usr
|
|
||||||
popd
|
|
||||||
|
|
||||||
fi
|
|
||||||
Loading…
Reference in New Issue