diff --git a/build.cmd b/build.cmd index 63d7b155e..3f8345816 100644 --- a/build.cmd +++ b/build.cmd @@ -1,4 +1,3 @@ -@echo off setlocal EnableDelayedExpansion where dnvm @@ -10,8 +9,10 @@ if %ERRORLEVEL% neq 0 ( ) :continue +echo *** Building dotnet *** call %~dp0scripts/bootstrap.cmd if %errorlevel% neq 0 exit /b %errorlevel% +echo *** Packaging dotnet *** call %~dp0scripts/package.cmd if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/build.sh b/build.sh index fae8425d6..80a7e6f4f 100755 --- a/build.sh +++ b/build.sh @@ -2,6 +2,8 @@ # # $1 is passed to package to enable deb or pkg packaging +set -e + SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" @@ -11,5 +13,4 @@ done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" $DIR/scripts/bootstrap.sh - $DIR/scripts/package.sh $1 diff --git a/ext/CLRHost/osx.10.10-x64/coreconsole b/ext/CLRHost/osx.10.10-x64/coreconsole deleted file mode 100755 index 582f45312..000000000 Binary files a/ext/CLRHost/osx.10.10-x64/coreconsole and /dev/null differ diff --git a/ext/CLRHost/osx.10.10-x64/corerun b/ext/CLRHost/osx.10.10-x64/corerun deleted file mode 100755 index bbadef994..000000000 Binary files a/ext/CLRHost/osx.10.10-x64/corerun and /dev/null differ diff --git a/ext/CLRHost/ubuntu.14.04-x64/coreconsole b/ext/CLRHost/ubuntu.14.04-x64/coreconsole deleted file mode 100755 index 93516a0c4..000000000 Binary files a/ext/CLRHost/ubuntu.14.04-x64/coreconsole and /dev/null differ diff --git a/ext/CLRHost/ubuntu.14.04-x64/corerun b/ext/CLRHost/ubuntu.14.04-x64/corerun deleted file mode 100755 index 85a8041bc..000000000 Binary files a/ext/CLRHost/ubuntu.14.04-x64/corerun and /dev/null differ diff --git a/ext/CLRHost/win7-x64/CoreConsole.exe b/ext/CLRHost/win7-x64/CoreConsole.exe deleted file mode 100644 index 421805d95..000000000 Binary files a/ext/CLRHost/win7-x64/CoreConsole.exe and /dev/null differ diff --git a/ext/CLRHost/win7-x64/CoreRun.exe b/ext/CLRHost/win7-x64/CoreRun.exe deleted file mode 100644 index 4577bc510..000000000 Binary files a/ext/CLRHost/win7-x64/CoreRun.exe and /dev/null differ diff --git a/ext/CoreCLR/osx.10.10-x64/System.Globalization.Native.dylib b/ext/CoreCLR/osx.10.10-x64/System.Globalization.Native.dylib new file mode 100644 index 000000000..c4ac9c4d3 Binary files /dev/null and b/ext/CoreCLR/osx.10.10-x64/System.Globalization.Native.dylib differ diff --git a/ext/CoreCLR/osx.10.10-x64/coreconsole b/ext/CoreCLR/osx.10.10-x64/coreconsole new file mode 100755 index 000000000..359d87335 Binary files /dev/null and b/ext/CoreCLR/osx.10.10-x64/coreconsole differ diff --git a/ext/CoreCLR/osx.10.10-x64/corerun b/ext/CoreCLR/osx.10.10-x64/corerun new file mode 100755 index 000000000..f9f81f432 Binary files /dev/null and b/ext/CoreCLR/osx.10.10-x64/corerun differ diff --git a/ext/CoreCLR/osx.10.10-x64/libcoreclr.dylib b/ext/CoreCLR/osx.10.10-x64/libcoreclr.dylib new file mode 100644 index 000000000..4f68dd423 Binary files /dev/null and b/ext/CoreCLR/osx.10.10-x64/libcoreclr.dylib differ diff --git a/ext/CoreCLR/osx.10.10-x64/mscorlib.dll b/ext/CoreCLR/osx.10.10-x64/mscorlib.dll new file mode 100644 index 000000000..414ca1a08 Binary files /dev/null and b/ext/CoreCLR/osx.10.10-x64/mscorlib.dll differ diff --git a/ext/CoreCLR/ubuntu.14.04-x64/System.Globalization.Native.so b/ext/CoreCLR/ubuntu.14.04-x64/System.Globalization.Native.so new file mode 100644 index 000000000..182114862 Binary files /dev/null and b/ext/CoreCLR/ubuntu.14.04-x64/System.Globalization.Native.so differ diff --git a/ext/CoreCLR/ubuntu.14.04-x64/coreconsole b/ext/CoreCLR/ubuntu.14.04-x64/coreconsole new file mode 100755 index 000000000..6a24afd66 Binary files /dev/null and b/ext/CoreCLR/ubuntu.14.04-x64/coreconsole differ diff --git a/ext/CoreCLR/ubuntu.14.04-x64/corerun b/ext/CoreCLR/ubuntu.14.04-x64/corerun new file mode 100755 index 000000000..7e003457e Binary files /dev/null and b/ext/CoreCLR/ubuntu.14.04-x64/corerun differ diff --git a/ext/CoreCLR/ubuntu.14.04-x64/libcoreclr.so b/ext/CoreCLR/ubuntu.14.04-x64/libcoreclr.so new file mode 100644 index 000000000..cbfd9a15c Binary files /dev/null and b/ext/CoreCLR/ubuntu.14.04-x64/libcoreclr.so differ diff --git a/ext/CoreCLR/ubuntu.14.04-x64/mscorlib.dll b/ext/CoreCLR/ubuntu.14.04-x64/mscorlib.dll new file mode 100644 index 000000000..ea0eca573 Binary files /dev/null and b/ext/CoreCLR/ubuntu.14.04-x64/mscorlib.dll differ diff --git a/ext/CoreCLR/win7-x64/CoreConsole.exe b/ext/CoreCLR/win7-x64/CoreConsole.exe new file mode 100644 index 000000000..71d174f3d Binary files /dev/null and b/ext/CoreCLR/win7-x64/CoreConsole.exe differ diff --git a/ext/CoreCLR/win7-x64/CoreRun.exe b/ext/CoreCLR/win7-x64/CoreRun.exe new file mode 100644 index 000000000..d1d771092 Binary files /dev/null and b/ext/CoreCLR/win7-x64/CoreRun.exe differ diff --git a/ext/CoreCLR/win7-x64/coreclr.dll b/ext/CoreCLR/win7-x64/coreclr.dll new file mode 100644 index 000000000..92a63381b Binary files /dev/null and b/ext/CoreCLR/win7-x64/coreclr.dll differ diff --git a/ext/CoreCLR/win7-x64/mscorlib.dll b/ext/CoreCLR/win7-x64/mscorlib.dll new file mode 100644 index 000000000..fe0ae5846 Binary files /dev/null and b/ext/CoreCLR/win7-x64/mscorlib.dll differ diff --git a/scripts/bootstrap.cmd b/scripts/bootstrap.cmd index c4dbe1f7b..fd70c8e16 100644 --- a/scripts/bootstrap.cmd +++ b/scripts/bootstrap.cmd @@ -11,10 +11,12 @@ set REPOROOT=%CD% popd set RID=win7-x64 +set TFM=dnxcore50 set DNX_DIR=%REPOROOT%\artifacts\%RID%\dnx set STAGE0_DIR=%REPOROOT%\artifacts\%RID%\stage0 set STAGE1_DIR=%REPOROOT%\artifacts\%RID%\stage1 set STAGE2_DIR=%REPOROOT%\artifacts\%RID%\stage2 +set START_PATH=%PATH% where dnvm >nul 2>nul if %errorlevel% == 0 goto have_dnvm @@ -29,6 +31,10 @@ set DNX_GLOBAL_HOME=%DNX_DIR% echo Installing and use-ing the latest CoreCLR x64 DNX ... call dnvm install -nonative -u latest -r coreclr -arch x64 -alias dotnet_bootstrap +pushd "%DNX_DIR%" +cd "runtimes\dnx-*" +set DNX_ROOT=%CD%\bin +popd if errorlevel 1 goto fail call dnvm use dotnet_bootstrap -r coreclr -arch x64 @@ -50,57 +56,83 @@ call %~dp0dnvm2 upgrade if errorlevel 1 goto fail echo Building stage1 dotnet.exe ... -dotnet-publish --framework dnxcore50 --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Cli" +dotnet-publish --framework %TFM% --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Cli" if errorlevel 1 goto fail echo Building stage1 dotnet-compile.exe ... -dotnet-publish --framework dnxcore50 --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Compiler" +dotnet-publish --framework %TFM% --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Compiler" if errorlevel 1 goto fail echo Building stage1 dotnet-compile-csc.exe ... -dotnet-publish --framework dnxcore50 --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Compiler.Csc" +dotnet-publish --framework %TFM% --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Compiler.Csc" if errorlevel 1 goto fail echo Building stage1 dotnet-publish.exe ... -dotnet-publish --framework dnxcore50 --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Publish" +dotnet-publish --framework %TFM% --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Publish" if errorlevel 1 goto fail echo Building stage1 dotnet-publish.exe ... -dotnet-publish --framework dnxcore50 --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Resgen" +dotnet-publish --framework %TFM% --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Resgen" if errorlevel 1 goto fail echo Re-building dotnet tools with the bootstrapped version REM This should move into a proper build script of some kind once we are bootstrapped -set PATH=%STAGE1_DIR%;%PATH% +set PATH=%STAGE1_DIR%;%START_PATH% if exist %STAGE2_DIR% rd /s /q %STAGE2_DIR% echo Building stage2 dotnet.exe ... -dotnet publish --framework dnxcore50 --runtime %RID% --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Cli" +dotnet publish --framework %TFM% --runtime %RID% --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Cli" if errorlevel 1 goto fail echo Building stage2 dotnet-compile.exe ... -dotnet publish --framework dnxcore50 --runtime %RID% --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Compiler" +dotnet publish --framework %TFM% --runtime %RID% --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Compiler" if errorlevel 1 goto fail echo Building stage2 dotnet-compile-csc.exe ... -dotnet publish --framework dnxcore50 --runtime %RID% --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Compiler.Csc" +dotnet publish --framework %TFM% --runtime %RID% --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Compiler.Csc" if errorlevel 1 goto fail echo Building stage2 dotnet-publish.exe ... -dotnet publish --framework dnxcore50 --runtime %RID% --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Publish" +dotnet publish --framework %TFM% --runtime %RID% --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Publish" if errorlevel 1 goto fail echo Building stage2 dotnet-publish.exe ... -dotnet publish --framework dnxcore50 --runtime %RID% --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Resgen" +dotnet publish --framework %TFM% --runtime %RID% --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Resgen" if errorlevel 1 goto fail +REM Copy DNX in to stage2 +xcopy /s /q %DNX_ROOT% %STAGE2_DIR%\dnx\ + +REM Clean up some things we don't need +rd /s /q %STAGE2_DIR%\dnx\lib\Microsoft.Dnx.DesignTimeHost +rd /s /q %STAGE2_DIR%\dnx\lib\Microsoft.Dnx.Project +del %STAGE2_DIR%\dnx\dnu.cmd + +REM Copy and CHMOD the dotnet-restore script +copy %~dp0dotnet-restore.cmd %STAGE2_DIR%\dotnet-restore.cmd + +# Smoke-test the output +set PATH=%STAGE2_DIR%;%START_PATH% + +del "%REPOROOT%\test\TestApp\project.lock.json" +dotnet restore "%REPOROOT%\test\TestApp" --runtime "%RID%" +dotnet publish "%REPOROOT%\test\TestApp" --framework "%TFM%" --runtime "%RID%" --output "%REPOROOT%\artifacts\%RID%\smoketest" + +"%REPOROOT%/artifacts/%RID%/smoketest/TestApp" +if errorlevel 1 goto fail + +REM Check that a compiler error is reported +dotnet compile "%REPOROOT%\test\compile\failing\SimpleCompilerError" --framework "%TFM%" +if %errorlevel% == 0 goto fail + echo Bootstrapped dotnet to %STAGE2_DIR% goto end :fail -echo Bootstrapping failed... +echo Bootstrapping failed exit /B 1 :end +exit /B 0 diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 815551e23..e1c63f09f 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -1,5 +1,12 @@ #!/usr/bin/env bash +set -e + +[ -z "$CONFIGURATION" ] && CONFIGURATION=Debug + +# TODO: Replace this with a dotnet generation +TFM=dnxcore50 + SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" @@ -9,6 +16,8 @@ done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" REPOROOT="$( cd -P "$DIR/.." && pwd )" +START_PATH=$PATH + echo "Bootstrapping dotnet.exe using DNX" if [ -z "$RID" ]; then @@ -37,71 +46,92 @@ echo "Installing stage0" # Use a sub-shell to ensure the DNVM gets cleaned up mkdir -p $STAGE0_DIR $DIR/install-stage0.sh $STAGE0_DIR $DIR/dnvm2.sh -rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi export PATH=$STAGE0_DIR/bin:$PATH -export DOTNET_CLR_HOSTS_PATH=$REPOROOT/ext/CLRHost/$RID +echo "Installing and use-ing the latest CoreCLR x64 DNX ..." +mkdir -p $DNX_DIR -if ! type dnx > /dev/null 2>&1; then - echo "Installing and use-ing the latest CoreCLR x64 DNX ..." - mkdir -p $DNX_DIR +export DNX_HOME=$DNX_DIR +export DNX_USER_HOME=$DNX_DIR +export DNX_GLOBAL_HOME=$DNX_DIR - export DNX_HOME=$DNX_DIR - export DNX_USER_HOME=$DNX_DIR - export DNX_GLOBAL_HOME=$DNX_DIR - - if ! type dnvm > /dev/null 2>&1; then - curl -o $DNX_DIR/dnvm.sh https://raw.githubusercontent.com/aspnet/Home/dev/dnvm.sh - source $DNX_DIR/dnvm.sh - fi - - dnvm install latest -u -r coreclr - rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi - - # Make sure we got a DNX - if ! type dnx > /dev/null 2>&1; then - echo "DNX is required to bootstrap stage1" 1>&2 - exit 1 - fi +if ! type dnvm > /dev/null 2>&1; then + curl -o $DNX_DIR/dnvm.sh https://raw.githubusercontent.com/aspnet/Home/dev/dnvm.sh + source $DNX_DIR/dnvm.sh fi +dnvm install latest -u -r coreclr + +# Make sure we got a DNX +if ! type dnx > /dev/null 2>&1; then + echo "DNX is required to bootstrap stage1" 1>&2 + exit 1 +fi + +DNX_ROOT=$(dirname $(which dnx)) + echo "Running 'dnu restore' to restore packages" dnu restore "$REPOROOT" --runtime osx.10.10-x64 --runtime ubuntu.14.04-x64 --runtime osx.10.11-x64 -rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi # Clean up stage1 [ -d "$STAGE1_DIR" ] && rm -Rf "$STAGE1_DIR" echo "Building basic dotnet tools using Stage 0" -dotnet publish --framework dnxcore50 --runtime $RID --output "$STAGE1_DIR" "$REPOROOT/src/Microsoft.DotNet.Cli" -rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi -dotnet publish --framework dnxcore50 --runtime $RID --output "$STAGE1_DIR" "$REPOROOT/src/Microsoft.DotNet.Tools.Compiler" -rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi -dotnet publish --framework dnxcore50 --runtime $RID --output "$STAGE1_DIR" "$REPOROOT/src/Microsoft.DotNet.Tools.Compiler.Csc" -rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi -dotnet publish --framework dnxcore50 --runtime $RID --output "$STAGE1_DIR" "$REPOROOT/src/Microsoft.DotNet.Tools.Publish" -rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi -dotnet publish --framework dnxcore50 --runtime $RID --output "$STAGE1_DIR" "$REPOROOT/src/Microsoft.DotNet.Tools.Resgen" +dotnet publish --framework "$TFM" --runtime $RID --output "$STAGE1_DIR" --configuration "$CONFIGURATION" "$REPOROOT/src/Microsoft.DotNet.Cli" +dotnet publish --framework "$TFM" --runtime $RID --output "$STAGE1_DIR" --configuration "$CONFIGURATION" "$REPOROOT/src/Microsoft.DotNet.Tools.Compiler" +dotnet publish --framework "$TFM" --runtime $RID --output "$STAGE1_DIR" --configuration "$CONFIGURATION" "$REPOROOT/src/Microsoft.DotNet.Tools.Compiler.Csc" +dotnet publish --framework "$TFM" --runtime $RID --output "$STAGE1_DIR" --configuration "$CONFIGURATION" "$REPOROOT/src/Microsoft.DotNet.Tools.Publish" +dotnet publish --framework "$TFM" --runtime $RID --output "$STAGE1_DIR" --configuration "$CONFIGURATION" "$REPOROOT/src/Microsoft.DotNet.Tools.Resgen" + +# Update stage1 with the checked-in CoreCLR +cp $REPOROOT/ext/CoreCLR/$RID/* $STAGE1_DIR # Add stage1 to the path and use it to build stage2 -export PATH=$STAGE1_DIR:$PATH +export PATH=$STAGE1_DIR:$START_PATH # Make corerun explicitly executable chmod a+x $STAGE1_DIR/corerun echo "Building stage2 dotnet using stage1 ..." -dotnet publish --framework dnxcore50 --runtime $RID --output "$STAGE2_DIR" "$REPOROOT/src/Microsoft.DotNet.Cli" -rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi -dotnet publish --framework dnxcore50 --runtime $RID --output "$STAGE2_DIR" "$REPOROOT/src/Microsoft.DotNet.Tools.Compiler" -rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi -dotnet publish --framework dnxcore50 --runtime $RID --output "$STAGE2_DIR" "$REPOROOT/src/Microsoft.DotNet.Tools.Compiler.Csc" -rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi -dotnet publish --framework dnxcore50 --runtime $RID --output "$STAGE2_DIR" "$REPOROOT/src/Microsoft.DotNet.Tools.Publish" -rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi -dotnet publish --framework dnxcore50 --runtime $RID --output "$STAGE2_DIR" "$REPOROOT/src/Microsoft.DotNet.Tools.Resgen" -rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi +dotnet publish --framework "$TFM" --runtime $RID --output "$STAGE2_DIR" --configuration "$CONFIGURATION" "$REPOROOT/src/Microsoft.DotNet.Cli" +dotnet publish --framework "$TFM" --runtime $RID --output "$STAGE2_DIR" --configuration "$CONFIGURATION" "$REPOROOT/src/Microsoft.DotNet.Tools.Compiler" +dotnet publish --framework "$TFM" --runtime $RID --output "$STAGE2_DIR" --configuration "$CONFIGURATION" "$REPOROOT/src/Microsoft.DotNet.Tools.Compiler.Csc" +dotnet publish --framework "$TFM" --runtime $RID --output "$STAGE2_DIR" --configuration "$CONFIGURATION" "$REPOROOT/src/Microsoft.DotNet.Tools.Publish" +dotnet publish --framework "$TFM" --runtime $RID --output "$STAGE2_DIR" --configuration "$CONFIGURATION" "$REPOROOT/src/Microsoft.DotNet.Tools.Resgen" # Make Stage 2 Folder Accessible -chmod -R a+r $REPOROOT \ No newline at end of file +chmod -R a+r $REPOROOT + +# Copy DNX in to stage2 +cp -R $DNX_ROOT $STAGE2_DIR/dnx + +# Clean up some things we don't need +rm -Rf $STAGE2_DIR/dnx/lib/Microsoft.Dnx.DesignTimeHost +rm -Rf $STAGE2_DIR/dnx/lib/Microsoft.Dnx.Project +rm $STAGE2_DIR/dnx/dnu + +# Copy and CHMOD the dotnet-restore script +cp $DIR/dotnet-restore.sh $STAGE2_DIR/dotnet-restore +chmod a+x $STAGE2_DIR/dotnet-restore + +# Smoke-test the output +export PATH=$STAGE2_DIR:$START_PATH + +rm "$REPOROOT/test/TestApp/project.lock.json" +dotnet restore "$REPOROOT/test/TestApp" --runtime "$RID" +dotnet publish "$REPOROOT/test/TestApp" --framework "$TFM" --runtime "$RID" --output "$REPOROOT/artifacts/$RID/smoketest" + +OUTPUT=$($REPOROOT/artifacts/$RID/smoketest/TestApp) +[ "$OUTPUT" == "This is a test app" ] || (echo "Smoke test failed!" && exit 1) + +# Check that a compiler error is reported +set +e +dotnet compile "$REPOROOT/test/compile/failing/SimpleCompilerError" --framework "$TFM" +rc=$? +if [ $rc == 0 ]; then + echo "Compiler failure test failed! The compiler did not fail to compile!" + exit 1 +fi +set -e diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh index f10e5fa34..c603974af 100755 --- a/scripts/ci_build.sh +++ b/scripts/ci_build.sh @@ -1,6 +1,23 @@ #!/usr/bin/env bash +set -e + SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +# Some things depend on HOME and it may not be set. We should fix those things, but until then, we just patch a value in +if [ -z "$HOME" ]; then + export HOME=$SCRIPT_DIR/../artifacts/home + + [ ! -d "$HOME" ] || rm -Rf $HOME + mkdir -p $HOME +fi + +# Set the build number using CI build number +BASE_VERSION=0.0.2-alpha1 +if [ ! -z "$BUILD_NUMBER" ]; then + export DOTNET_BUILD_VERSION="$BASE_VERSION-$(printf "%05d" $BUILD_NUMBER)" + echo "Building version $DOTNET_BUILD_VERSION" +fi + if [[ "$(uname)" == "Linux" ]]; then # Set Docker Container name to be unique container_name="" @@ -16,7 +33,3 @@ if [[ "$(uname)" == "Linux" ]]; then else $SCRIPT_DIR/../build.sh $@ fi - -ret_code=$? -exit $ret_code - diff --git a/scripts/dockerbuild.sh b/scripts/dockerbuild.sh index 6540a58b2..7a228464b 100755 --- a/scripts/dockerbuild.sh +++ b/scripts/dockerbuild.sh @@ -26,5 +26,3 @@ docker run --rm --sig-proxy=true \ -v $DOCKER_HOST_SHARE_DIR:/opt/code \ -e DOTNET_BUILD_VERSION=$DOTNET_BUILD_VERSION \ $DOTNET_BUILD_CONTAINER_TAG $BUILD_COMMAND $1 - - diff --git a/scripts/dotnet-restore.cmd b/scripts/dotnet-restore.cmd new file mode 100644 index 000000000..e41fd9121 --- /dev/null +++ b/scripts/dotnet-restore.cmd @@ -0,0 +1,8 @@ +@Echo OFF +SETLOCAL +SET ERRORLEVEL= + +"%~dp0dnx\dnx" "%~dp0dnx\lib\Microsoft.Dnx.Tooling\Microsoft.Dnx.Tooling.dll" restore %* + +exit /b %ERRORLEVEL% +ENDLOCAL diff --git a/scripts/dotnet-restore.sh b/scripts/dotnet-restore.sh new file mode 100644 index 000000000..297315092 --- /dev/null +++ b/scripts/dotnet-restore.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# dotnet-restore script to be copied across to the final package + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +# work around restore timeouts on Mono +[ -z "$MONO_THREADS_PER_CPU" ] && export MONO_THREADS_PER_CPU=50 + +exec "$DIR/dnx/dnx" "$DIR/dnx/lib/Microsoft.Dnx.Tooling/Microsoft.Dnx.Tooling.dll" "restore" "$@" diff --git a/scripts/package.sh b/scripts/package.sh index 2a779125c..bd913c0c5 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e + SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" diff --git a/src/Microsoft.DotNet.Cli.Utils/Command.cs b/src/Microsoft.DotNet.Cli.Utils/Command.cs index fbae4bb47..acab8ed65 100644 --- a/src/Microsoft.DotNet.Cli.Utils/Command.cs +++ b/src/Microsoft.DotNet.Cli.Utils/Command.cs @@ -142,7 +142,7 @@ namespace Microsoft.DotNet.Cli.Utils var message = $"< {FormatProcessInfo(_process.StartInfo)} exited with {exitCode} in {sw.ElapsedMilliseconds} ms."; if (exitCode == 0) { - Reporter.Output.WriteLine(message.Green().Bold()); + Reporter.Output.WriteLine(message.Green()); } else { diff --git a/src/Microsoft.DotNet.Cli.Utils/Constants.cs b/src/Microsoft.DotNet.Cli.Utils/Constants.cs index 3d86695ee..d37c508e2 100644 --- a/src/Microsoft.DotNet.Cli.Utils/Constants.cs +++ b/src/Microsoft.DotNet.Cli.Utils/Constants.cs @@ -16,7 +16,6 @@ namespace Microsoft.DotNet.Cli.Utils public static readonly string BinDirectoryName = "bin"; public static readonly string ObjDirectoryName = "obj"; - public static readonly string HostsPathEnvironmentVariable = "DOTNET_CLR_HOSTS_PATH"; - public static readonly string CSCPathEnvironmentVariable = "DOTNET_CSC_PATH"; + public static readonly string ClrPathEnvironmentVariable = "DOTNET_CLR_PATH"; } } diff --git a/src/Microsoft.DotNet.Cli.Utils/project.json b/src/Microsoft.DotNet.Cli.Utils/project.json index b6ff1d85e..88651f8a7 100644 --- a/src/Microsoft.DotNet.Cli.Utils/project.json +++ b/src/Microsoft.DotNet.Cli.Utils/project.json @@ -4,10 +4,10 @@ "shared": "**/*.cs", "dependencies": { - "System.Console": "4.0.0-beta-23419", - "System.IO.FileSystem": "4.0.1-beta-23419", - "System.Diagnostics.Process": "4.1.0-beta-23419", - "System.Runtime.InteropServices.RuntimeInformation": "4.0.0-beta-23419" + "System.Console": "4.0.0-beta-23420", + "System.IO.FileSystem": "4.0.1-beta-23420", + "System.Diagnostics.Process": "4.1.0-beta-23420", + "System.Runtime.InteropServices.RuntimeInformation": "4.0.0-beta-23420" }, "frameworks": { "dnxcore50": { } diff --git a/src/Microsoft.DotNet.Cli/project.json b/src/Microsoft.DotNet.Cli/project.json index b927627b4..071ba90d8 100644 --- a/src/Microsoft.DotNet.Cli/project.json +++ b/src/Microsoft.DotNet.Cli/project.json @@ -8,12 +8,12 @@ "dotnet": "Microsoft.DotNet.Cli" }, "dependencies": { - "Microsoft.NETCore.Runtime": "1.0.1-beta-23419", + "Microsoft.NETCore.Runtime": "1.0.1-beta-23420", - "System.Console": "4.0.0-beta-23419", - "System.Collections": "4.0.11-beta-23419", - "System.Linq": "4.0.1-beta-23419", - "System.Diagnostics.Process": "4.1.0-beta-23419", + "System.Console": "4.0.0-beta-23420", + "System.Collections": "4.0.11-beta-23420", + "System.Linq": "4.0.1-beta-23420", + "System.Diagnostics.Process": "4.1.0-beta-23420", "Microsoft.DotNet.Cli.Utils": { "type": "build", "version": "1.0.0-*" @@ -26,4 +26,4 @@ "frameworks": { "dnxcore50": { } } -} \ No newline at end of file +} diff --git a/src/Microsoft.DotNet.Tools.Compiler.Csc/project.json b/src/Microsoft.DotNet.Tools.Compiler.Csc/project.json index 37137989e..99f23fac1 100644 --- a/src/Microsoft.DotNet.Tools.Compiler.Csc/project.json +++ b/src/Microsoft.DotNet.Tools.Compiler.Csc/project.json @@ -8,14 +8,14 @@ "dotnet-compile-csc": "Microsoft.DotNet.Tools.Compiler.Csc" }, "dependencies": { - "Microsoft.NETCore.TestHost": "1.0.0-beta-23419", - "Microsoft.NETCore.Runtime": "1.0.1-beta-23419", + "Microsoft.NETCore.TestHost": "1.0.0-beta-23420", + "Microsoft.NETCore.Runtime": "1.0.1-beta-23420", - "System.Console": "4.0.0-beta-23419", - "System.Collections": "4.0.11-beta-23419", - "System.Linq": "4.0.1-beta-23419", - "System.Diagnostics.Process": "4.1.0-beta-23419", - "System.IO.FileSystem": "4.0.1-beta-23419", + "System.Console": "4.0.0-beta-23420", + "System.Collections": "4.0.11-beta-23420", + "System.Linq": "4.0.1-beta-23420", + "System.Diagnostics.Process": "4.1.0-beta-23420", + "System.IO.FileSystem": "4.0.1-beta-23420", "Microsoft.Extensions.ProjectModel": "1.0.0-*", "Microsoft.DotNet.Cli.Utils": { "type": "build", diff --git a/src/Microsoft.DotNet.Tools.Compiler/Program.cs b/src/Microsoft.DotNet.Tools.Compiler/Program.cs index 281986a3c..42e6f00f2 100644 --- a/src/Microsoft.DotNet.Tools.Compiler/Program.cs +++ b/src/Microsoft.DotNet.Tools.Compiler/Program.cs @@ -84,8 +84,6 @@ namespace Microsoft.DotNet.Tools.Compiler var diagnostics = new List(); - bool success = true; - // Collect dependency diagnostics diagnostics.AddRange(context.LibraryManager.GetAllDiagnostics()); @@ -145,16 +143,19 @@ namespace Microsoft.DotNet.Tools.Compiler configuration, context.TargetFramework.GetTwoDigitShortFolderName()); - if (!Directory.Exists(outputPath)) + if (Directory.Exists(outputPath)) { - Directory.CreateDirectory(outputPath); + Directory.Delete(outputPath, recursive: true); } - if (!Directory.Exists(intermediateOutputPath)) + if (Directory.Exists(intermediateOutputPath)) { - Directory.CreateDirectory(intermediateOutputPath); + Directory.Delete(intermediateOutputPath, recursive: true); } + Directory.CreateDirectory(outputPath); + Directory.CreateDirectory(intermediateOutputPath); + // Get compilation options var compilationOptions = context.ProjectFile.GetCompilerOptions(context.TargetFramework, configuration); var outputName = Path.Combine(outputPath, context.ProjectFile.Name + (compilationOptions.EmitEntryPoint.GetValueOrDefault() ? ".exe" : ".dll")); @@ -227,18 +228,17 @@ namespace Microsoft.DotNet.Tools.Compiler foreach (var diag in diagnostics) { - success &= diag.Severity != DiagnosticMessageSeverity.Error; PrintDiagnostic(diag); } - - success &= result.ExitCode == 0; - PrintSummary(diagnostics); + var success = result.ExitCode == 0; + + PrintSummary(success, diagnostics); return success; } - private static void PrintSummary(List diagnostics) + private static void PrintSummary(bool success, List diagnostics) { Reporter.Output.Writer.WriteLine(); diff --git a/src/Microsoft.DotNet.Tools.Compiler/project.json b/src/Microsoft.DotNet.Tools.Compiler/project.json index 60777510f..831cc75a2 100644 --- a/src/Microsoft.DotNet.Tools.Compiler/project.json +++ b/src/Microsoft.DotNet.Tools.Compiler/project.json @@ -8,14 +8,13 @@ "dotnet-compile": "Microsoft.DotNet.Tools.Compiler" }, "dependencies": { - "Microsoft.NETCore.TestHost": "1.0.0-*", - "Microsoft.NETCore.Runtime": "1.0.1-beta-23413", + "Microsoft.NETCore.Runtime": "1.0.1-beta-23420", - "System.Console": "4.0.0-beta-23419", - "System.Collections": "4.0.11-beta-23419", - "System.Linq": "4.0.1-beta-23419", - "System.Diagnostics.Process": "4.1.0-beta-23419", - "System.IO.FileSystem": "4.0.1-beta-23419", + "System.Console": "4.0.0-beta-23420", + "System.Collections": "4.0.11-beta-23420", + "System.Linq": "4.0.1-beta-23420", + "System.Diagnostics.Process": "4.1.0-beta-23420", + "System.IO.FileSystem": "4.0.1-beta-23420", "Microsoft.Extensions.ProjectModel": "1.0.0-*", "Microsoft.DotNet.Cli.Utils": { "type": "build", diff --git a/src/Microsoft.DotNet.Tools.Publish/Program.cs b/src/Microsoft.DotNet.Tools.Publish/Program.cs index a395cd218..bf0f9ae79 100644 --- a/src/Microsoft.DotNet.Tools.Publish/Program.cs +++ b/src/Microsoft.DotNet.Tools.Publish/Program.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Runtime.InteropServices; using Microsoft.Dnx.Runtime.Common.CommandLine; using Microsoft.DotNet.Cli.Utils; using Microsoft.Extensions.ProjectModel; @@ -11,6 +12,8 @@ namespace Microsoft.DotNet.Tools.Publish { public class Program { + public static readonly IEnumerable CoreCLRFileNames = GetCoreCLRFileNames(); + public static int Main(string[] args) { DebugHelper.HandleDebugSwitch(ref args); @@ -113,7 +116,7 @@ namespace Microsoft.DotNet.Tools.Publish } // Compile the project (and transitively, all it's dependencies) - var result = Command.Create("dotnet-compile", $"--framework {context.TargetFramework.DotNetFrameworkName} \"{context.ProjectFile.ProjectDirectory}\"") + var result = Command.Create("dotnet-compile", $"--framework \"{context.TargetFramework.DotNetFrameworkName}\" --configuration \"{configuration}\" \"{context.ProjectFile.ProjectDirectory}\"") .ForwardStdErr() .ForwardStdOut() .Execute(); @@ -138,7 +141,6 @@ namespace Microsoft.DotNet.Tools.Publish PublishFiles(export.NativeLibraries, outputPath); } - // Publishing for windows, TODO(anurse): Publish for Mac/Linux/etc. int exitCode; if (context.RuntimeIdentifier.StartsWith("win")) { @@ -155,30 +157,9 @@ namespace Microsoft.DotNet.Tools.Publish private static int PublishForUnix(ProjectContext context, string outputPath) { - // Locate Hosts - string hostsPath = Environment.GetEnvironmentVariable(Constants.HostsPathEnvironmentVariable); - if (string.IsNullOrEmpty(hostsPath)) - { - hostsPath = AppContext.BaseDirectory; - } - - var coreConsole = Path.Combine(hostsPath, Constants.CoreConsoleName); - if (!File.Exists(coreConsole)) - { - Reporter.Error.WriteLine($"Unable to locate {Constants.CoreConsoleName} in {coreConsole}, use {Constants.HostsPathEnvironmentVariable} to set the path to it.".Red().Bold()); - return 1; - } - - var coreRun = Path.Combine(hostsPath, Constants.CoreRunName); - if (!File.Exists(coreRun)) - { - Reporter.Error.WriteLine($"Unable to locate {Constants.CoreRunName} in {coreConsole}, use {Constants.HostsPathEnvironmentVariable} to set the path to it.".Red().Bold()); - return 1; - } - - // TEMPORARILY bring CoreConsole and CoreRun along for the ride on it's own (without renaming) - File.Copy(coreConsole, Path.Combine(outputPath, Constants.CoreConsoleName), overwrite: true); - File.Copy(coreRun, Path.Combine(outputPath, Constants.CoreRunName), overwrite: true); + CopyCoreCLR(outputPath); + var coreConsole = Path.Combine(outputPath, Constants.CoreConsoleName); + var coreRun = Path.Combine(outputPath, Constants.CoreRunName); // Use the 'command' field to generate the name var outputExe = Path.Combine(outputPath, context.ProjectFile.Name); @@ -211,30 +192,10 @@ exec ""$DIR/corerun"" ""$DIR/{context.ProjectFile.Name}.exe"" $* { return 0; } - // Locate Hosts - string hostsPath = Environment.GetEnvironmentVariable(Constants.HostsPathEnvironmentVariable); - if (string.IsNullOrEmpty(hostsPath)) - { - hostsPath = AppContext.BaseDirectory; - } - var coreConsole = Path.Combine(hostsPath, Constants.CoreConsoleName); - if (!File.Exists(coreConsole)) - { - Reporter.Error.WriteLine($"Unable to locate {Constants.CoreConsoleName} in {coreConsole}, use {Constants.HostsPathEnvironmentVariable} to set the path to it.".Red().Bold()); - return 1; - } - - var coreRun = Path.Combine(hostsPath, Constants.CoreRunName); - if (!File.Exists(coreRun)) - { - Reporter.Error.WriteLine($"Unable to locate {Constants.CoreRunName} in {coreConsole}, use {Constants.HostsPathEnvironmentVariable} to set the path to it.".Red().Bold()); - return 1; - } - - // TEMPORARILY bring CoreConsole and CoreRun along for the ride on it's own (without renaming) - File.Copy(coreConsole, Path.Combine(outputPath, Constants.CoreConsoleName), overwrite: true); - File.Copy(coreRun, Path.Combine(outputPath, Constants.CoreRunName), overwrite: true); + CopyCoreCLR(outputPath); + var coreConsole = Path.Combine(outputPath, Constants.CoreConsoleName); + var coreRun = Path.Combine(outputPath, Constants.CoreRunName); var outputExe = Path.Combine(outputPath, context.ProjectFile.Name + Constants.ExeSuffix); @@ -246,6 +207,17 @@ exec ""$DIR/corerun"" ""$DIR/{context.ProjectFile.Name}.exe"" $* return 0; } + private static void CopyCoreCLR(string outputPath) + { + // TEMPORARILY bring checked-in CoreCLR stuff along for the ride. + var clrPath = AppContext.BaseDirectory; + + foreach(var file in CoreCLRFileNames) + { + File.Copy(Path.Combine(clrPath, file), Path.Combine(outputPath, file), overwrite: true); + } + } + private static void CopyContents(ProjectContext context, string outputPath) { var sourceFiles = context.ProjectFile.Files.GetFilesForBundling(); @@ -317,5 +289,32 @@ exec ""$DIR/corerun"" ""$DIR/{context.ProjectFile.Name}.exe"" $* File.Copy(file, Path.Combine(outputPath, Path.GetFileName(file)), overwrite: true); } } + + private static IEnumerable GetCoreCLRFileNames() + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + yield return "coreclr.dll"; + yield return "CoreConsole.exe"; + yield return "CoreRun.exe"; + yield return "mscorlib.ni.dll"; + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + yield return "libcoreclr.dylib"; + yield return "coreconsole"; + yield return "corerun"; + yield return "mscorlib.dll"; + yield return "System.Globalization.Native.dylib"; + } + else + { + yield return "libcoreclr.so"; + yield return "coreconsole"; + yield return "corerun"; + yield return "mscorlib.dll"; + yield return "System.Globalization.Native.so"; + } + } } } diff --git a/src/Microsoft.DotNet.Tools.Publish/project.json b/src/Microsoft.DotNet.Tools.Publish/project.json index c0d8ddb35..266f7ef04 100644 --- a/src/Microsoft.DotNet.Tools.Publish/project.json +++ b/src/Microsoft.DotNet.Tools.Publish/project.json @@ -8,12 +8,12 @@ "dotnet-publish": "Microsoft.DotNet.Tools.Publish" }, "dependencies": { - "Microsoft.NETCore.Runtime": "1.0.1-beta-23419", - "System.Console": "4.0.0-beta-23419", - "System.Collections": "4.0.11-beta-23419", - "System.Linq": "4.0.1-beta-23419", - "System.Diagnostics.Process": "4.1.0-beta-23419", - "System.IO.FileSystem": "4.0.1-beta-23419", + "Microsoft.NETCore.Runtime": "1.0.1-beta-23420", + "System.Console": "4.0.0-beta-23420", + "System.Collections": "4.0.11-beta-23420", + "System.Linq": "4.0.1-beta-23420", + "System.Diagnostics.Process": "4.1.0-beta-23420", + "System.IO.FileSystem": "4.0.1-beta-23420", "Microsoft.Extensions.ProjectModel": "1.0.0-*", "Microsoft.DotNet.Cli.Utils": { "type": "build", @@ -23,7 +23,7 @@ "type": "build", "version": "1.0.0-rc1-15838" }, - "System.AppContext": "4.0.1-beta-23419" + "System.AppContext": "4.0.1-beta-23420" }, "frameworks": { "dnxcore50": { } diff --git a/src/Microsoft.DotNet.Tools.Resgen/project.json b/src/Microsoft.DotNet.Tools.Resgen/project.json index da64c8872..5a48963c2 100644 --- a/src/Microsoft.DotNet.Tools.Resgen/project.json +++ b/src/Microsoft.DotNet.Tools.Resgen/project.json @@ -8,13 +8,13 @@ "resgen": "Microsoft.DotNet.Tools.Resgen" }, "dependencies": { - "Microsoft.NETCore.TestHost": "1.0.0-beta-23419", - "Microsoft.NETCore.Runtime": "1.0.1-beta-23419", - "System.Console": "4.0.0-beta-23419", - "System.Collections": "4.0.11-beta-23419", - "System.Linq": "4.0.1-beta-23419", - "System.Diagnostics.Process": "4.1.0-beta-23419", - "System.IO.FileSystem": "4.0.1-beta-23419", + "Microsoft.NETCore.TestHost": "1.0.0-beta-23420", + "Microsoft.NETCore.Runtime": "1.0.1-beta-23420", + "System.Console": "4.0.0-beta-23420", + "System.Collections": "4.0.11-beta-23420", + "System.Linq": "4.0.1-beta-23420", + "System.Diagnostics.Process": "4.1.0-beta-23420", + "System.IO.FileSystem": "4.0.1-beta-23420", "Microsoft.DotNet.Cli.Utils": { "type": "build", "version": "1.0.0-*" @@ -23,8 +23,8 @@ "type": "build", "version": "1.0.0-rc1-15838" }, - "System.Xml.XDocument": "4.0.11-beta-23419", - "System.Resources.ReaderWriter": "4.0.0-beta-23419" + "System.Xml.XDocument": "4.0.11-beta-23420", + "System.Resources.ReaderWriter": "4.0.0-beta-23420" }, "frameworks": { "dnxcore50": { } diff --git a/src/Microsoft.Extensions.ProjectModel/project.json b/src/Microsoft.Extensions.ProjectModel/project.json index fc475de1e..7a241ccf5 100644 --- a/src/Microsoft.Extensions.ProjectModel/project.json +++ b/src/Microsoft.Extensions.ProjectModel/project.json @@ -2,18 +2,18 @@ "version": "1.0.0-*", "description": "Types to model a .NET Project", "dependencies": { - "Microsoft.CSharp": "4.0.1-beta-23419", - "System.Collections": "4.0.11-beta-23419", - "System.Linq": "4.0.1-beta-23419", - "System.Threading.Thread": "4.0.0-beta-23419", - "System.Runtime.Loader": "4.0.0-beta-23419", - "System.Dynamic.Runtime": "4.0.11-beta-23419", - "System.Runtime.InteropServices.RuntimeInformation": "4.0.0-beta-23419", + "Microsoft.CSharp": "4.0.1-beta-23420", + "System.Collections": "4.0.11-beta-23420", + "System.Linq": "4.0.1-beta-23420", + "System.Threading.Thread": "4.0.0-beta-23420", + "System.Runtime.Loader": "4.0.0-beta-23420", + "System.Dynamic.Runtime": "4.0.11-beta-23420", + "System.Runtime.InteropServices.RuntimeInformation": "4.0.0-beta-23420", + "System.Security.Cryptography.Algorithms": "4.0.0-beta-23420", "NuGet.Packaging": "3.2.0", - "System.Security.Cryptography.Algorithms": "4.0.0-beta-23401", - "Microsoft.Extensions.FileSystemGlobbing": "1.0.0-beta-23419", + "Microsoft.Extensions.FileSystemGlobbing": "1.0.0-beta8-*", "Microsoft.Extensions.JsonParser.Sources": { "type": "build", "version": "1.0.0-rc1-15792" diff --git a/src/clrhost/tpafile.h b/src/clrhost/tpafile.h new file mode 100644 index 000000000..18e6af293 --- /dev/null +++ b/src/clrhost/tpafile.h @@ -0,0 +1,40 @@ +#ifndef TPAFILE_H +#define TPAFILE_H + +#include + +#include "pal.h" + +struct tpaentry_t +{ + pal::string_t asset_type; + pal::string_t library_name; + pal::string_t library_version; + pal::string_t library_hash; + pal::string_t relative_path; + pal::string_t absolute_path; + pal::string_t asset_name; +}; + +class tpafile +{ +public: + static std::pair load(pal::string_t path); + + inline const std::vector& entries() { return m_entries; } + inline bool present() { return m_present; } + + void add_from(const pal::string_t& dir); + void write_tpa_list(pal::string_t& output); + void write_native_paths(std::string& output); + void set_package_paths(std::vector search_paths) { m_package_search_paths = search_paths; } + +private: + tpafile(bool present, std::vector entries) : m_present(present), m_entries(entries) {} + + bool m_present; + std::vector m_entries; + std::vector m_package_search_paths; +}; + +#endif // TPAFILE_H diff --git a/test/TestApp/Program.cs b/test/TestApp/Program.cs index b254f30dd..90141574a 100644 --- a/test/TestApp/Program.cs +++ b/test/TestApp/Program.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; namespace TestApp { diff --git a/test/TestApp/project.json b/test/TestApp/project.json index a3a5e0e11..86cbd4d15 100644 --- a/test/TestApp/project.json +++ b/test/TestApp/project.json @@ -5,9 +5,11 @@ }, "dependencies": { - "Microsoft.NETCore.ConsoleHost": "1.0.0-*", - "Microsoft.NETCore.Runtime": "1.0.0-*", - "System.Console": "4.0.0-beta-23109" + "Microsoft.NETCore.Runtime": "1.0.1-*", + "System.IO": "4.0.10-beta-23420", + "System.Console": "4.0.0-beta-23420", + "System.Runtime": "4.0.20-beta-23420", + "System.Diagnostics.Process": "4.1.0-beta-23420" }, "frameworks": { diff --git a/test/compile/failing/SimpleCompilerError/Program.cs b/test/compile/failing/SimpleCompilerError/Program.cs new file mode 100644 index 000000000..df8d4dbf3 --- /dev/null +++ b/test/compile/failing/SimpleCompilerError/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace TestApp +{ + public class Program + { + public static void Main(string[] args) + { + this will not compile! + } + } +} diff --git a/test/compile/failing/SimpleCompilerError/project.json b/test/compile/failing/SimpleCompilerError/project.json new file mode 100644 index 000000000..61a73a9fb --- /dev/null +++ b/test/compile/failing/SimpleCompilerError/project.json @@ -0,0 +1,16 @@ +{ + "version": "1.0.0-*", + "compilationOptions": { + "emitEntryPoint": true + }, + + "dependencies": { + "Microsoft.NETCore.ConsoleHost": "1.0.0-*", + "Microsoft.NETCore.Runtime": "1.0.1-*", + "System.Console": "4.0.0-beta-23109" + }, + + "frameworks": { + "dnxcore50": { } + } +}