Merge pull request #217 from brthor/dotnet-compile-natives

dotnet-compile-native
Thanks for getting this in!
This commit is contained in:
Piotr Puszkiewicz 2015-11-18 02:11:11 -08:00
commit c284a7492a
35 changed files with 1829 additions and 9 deletions

View file

@ -21,7 +21,8 @@ $Projects = @(
"Microsoft.DotNet.Tools.Repl.Csi",
"Microsoft.DotNet.Tools.Resgen",
"Microsoft.DotNet.Tools.Run",
"Microsoft.DotNet.Tools.Init"
"Microsoft.DotNet.Tools.Init",
"Microsoft.DotNet.Tools.Compiler.Native"
)
$BinariesForCoreHost = @(

View file

@ -33,6 +33,7 @@ PROJECTS=( \
Microsoft.DotNet.Tools.Repl.Csi \
Microsoft.DotNet.Tools.Resgen \
Microsoft.DotNet.Tools.Run \
Microsoft.DotNet.Tools.Compiler.Native \
)
BINARIES_FOR_COREHOST=( \

View file

@ -0,0 +1,21 @@
@echo off
REM This file encapsulates the temporary steps to build the dotnet-compile-native command successfully
REM The AppDepSDK package is a temporary artifact until we have CoreRT assemblies published to Nuget
set __ScriptDir=%~dp0
set __RepoRoot=%__ScriptDir%\..\..
set __AppDepsProjectDir=%__RepoRoot%\src\Microsoft.DotNet.Tools.Compiler.Native\appdep
REM Get absolute path
pushd %1
set __OutputPath=%CD%\bin
popd
pushd %__AppDepsProjectDir%
dotnet restore --packages %AppDepsProjectDir%\packages
set __AppDepSDK=%AppDepsProjectDir%\packages\toolchain*\*\
popd
mkdir %__OutputPath%\appdepsdk
xcopy /S/E/H/Y %__AppDepSDK% %__OutputPath%\appdepsdk

30
scripts/build/build_appdeps.sh Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env bash
# This file encapsulates the temporary steps to build the dotnet-compile-native command successfully
# The AppDepSDK package is a temporary artifact until we have CoreRT assemblies published to Nuget
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/../_common.sh
# Dotnet-compile-native doesn't work for mac yet
if [[ "$(uname)" != "Linux" ]]; then
exit 0
fi
REPO_ROOT="$SCRIPT_DIR/../.."
APPDEPS_PROJECT_DIR=$REPO_ROOT/src/Microsoft.DotNet.Tools.Compiler.Native/appdep
# Get Absolute Output Dir
pushd $1
OUTPUT_DIR="$(pwd)"
popd
## App Deps ##
pushd $APPDEPS_PROJECT_DIR
dotnet restore --packages $APPDEPS_PROJECT_DIR/packages
APPDEP_SDK=$APPDEPS_PROJECT_DIR/packages/toolchain*/*/
popd
mkdir -p $OUTPUT_DIR/appdepsdk
cp -a $APPDEP_SDK/. $OUTPUT_DIR/appdepsdk

View file

@ -46,7 +46,7 @@ Download it from https://www.cmake.org
# Restore packages
header "Restoring packages"
dotnet restore "$RepoRoot" --quiet --runtime "osx.10.10-x64" --runtime "ubuntu.14.04-x64" --runtime "win7-x64"
dotnet restore "$RepoRoot" --quiet --runtime "osx.10.10-x64" --runtime "ubuntu.14.04-x64" --runtime "win7-x64" --no-cache
header "Building corehost"
pushd "$RepoRoot\src\corehost"
@ -94,8 +94,12 @@ Download it from https://www.cmake.org
# Copy in the dotnet-restore script
cp "$PSScriptRoot\dotnet-restore.cmd" "$Stage2Dir\bin\dotnet-restore.cmd"
# Smoke test stage2
# Copy in AppDeps
$env:PATH = "$Stage2Dir\bin;$StartPath"
header "Acquiring Native App Dependencies"
cmd /c "$PSScriptRoot\build\build_appdeps.cmd" "$Stage2Dir"
# Smoke test stage2
$env:DOTNET_HOME = "$Stage2Dir"
& "$PSScriptRoot\test\smoke-test.ps1"
} finally {

View file

@ -51,7 +51,7 @@ if [ ! -d "$DNX_ROOT" ] || [ ! -e "$DNX_ROOT/dnx" ]; then
fi
header "Restoring packages"
dotnet restore "$REPOROOT" --quiet --runtime "osx.10.10-x64" --runtime "ubuntu.14.04-x64" --runtime "win7-x64"
dotnet restore "$REPOROOT" --quiet --runtime "osx.10.10-x64" --runtime "ubuntu.14.04-x64" --runtime "win7-x64" --no-cache
header "Building corehost"
@ -106,6 +106,10 @@ cp -R $DNX_ROOT $STAGE2_DIR/bin/dnx
cp $DIR/dotnet-restore.sh $STAGE2_DIR/bin/dotnet-restore
chmod a+x $STAGE2_DIR/bin/dotnet-restore
# Copy in AppDeps
header "Acquiring Native App Dependencies"
DOTNET_HOME=$STAGE2_DIR DOTNET_TOOLS=$STAGE2_DIR $REPOROOT/scripts/build/build_appdeps.sh "$STAGE2_DIR/bin"
# Stamp the output with the commit metadata
COMMIT_ID=$(git rev-parse HEAD)
echo $COMMIT_ID > $STAGE2_DIR/.commit