diff --git a/scripts/build/build_appdeps.cmd b/scripts/build/build_appdeps.cmd deleted file mode 100644 index 9d023d3df..000000000 --- a/scripts/build/build_appdeps.cmd +++ /dev/null @@ -1,33 +0,0 @@ -REM TEMPORARILY disable @echo off to debug CI. -REM @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=%__RepoRoot%\artifacts\win7-x64\stage2\bin -popd - - -pushd %__AppDepsProjectDir% -rmdir /S /Q packages -mkdir packages -dotnet restore --packages %__AppDepsProjectDir%\packages -set __AppDepSDK=%__AppDepsProjectDir%\packages\toolchain*\ -popd - -mkdir %__OutputPath%\appdepsdk -cd %__AppDepSDK% -FOR /D %%a IN (*) DO ( - CD %%a - TREE - GOTO :Copy -) - -:Copy -xcopy /S/E/H/Y * %__OutputPath%\appdepsdk diff --git a/scripts/build/build_appdeps.ps1 b/scripts/build/build_appdeps.ps1 new file mode 100644 index 000000000..f4fb7e1df --- /dev/null +++ b/scripts/build/build_appdeps.ps1 @@ -0,0 +1,26 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# +param( + [Parameter(Mandatory=$true)][string]$RepoRoot, + [Parameter(Mandatory=$true)][string]$OutputDir) + +$intermediateDir = "$RepoRoot\artifacts\appdepssdk\packages" +$appdepBinDir = "$OutputDir\bin\appdepsdk" + +If (Test-Path $intermediateDir){ + rmdir -Force -Rec $intermediateDir +} +mkdir $intermediateDir +& dotnet restore --packages "$intermediateDir" "$RepoRoot\src\dotnet-compile-native\appdep\project.json" + + +If (Test-Path $appdepBinDir){ + rmdir -Force -Rec $appdepBinDir +} +mkdir -Force "$appdepBinDir" + +ls "$intermediateDir\toolchain*\*\*" | foreach { + copy -Rec $_ "$appdepBinDir" +} \ No newline at end of file diff --git a/scripts/build/build_appdeps.sh b/scripts/build/build_appdeps.sh index a4b7d8d18..92da1179e 100755 --- a/scripts/build/build_appdeps.sh +++ b/scripts/build/build_appdeps.sh @@ -16,7 +16,7 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/../common/_common.sh" -APPDEPS_PROJECT_DIR="$REPOROOT/src/Microsoft.DotNet.Tools.Compiler.Native/appdep" +APPDEPS_PROJECT_DIR="$REPOROOT/src/dotnet-compile-native/appdep" # Get Absolute Output Dir pushd $1 diff --git a/scripts/compile/compile-stage.ps1 b/scripts/compile/compile-stage.ps1 index 19e822a61..f2760edd8 100644 --- a/scripts/compile/compile-stage.ps1 +++ b/scripts/compile/compile-stage.ps1 @@ -136,8 +136,6 @@ $BinariesForCoreHost | ForEach-Object { #} # Copy in AppDeps -if (-not (Test-Path "$OutputDir\bin\appdepsdk\")) { - $env:PATH = "$OutputDir\bin;$StartPath" - header "Acquiring Native App Dependencies" - _cmd "$RepoRoot\scripts\build\build_appdeps.cmd ""$OutputDir""" -} +header "Acquiring Native App Dependencies" +_ "$RepoRoot\scripts\build\build_appdeps.ps1" @("$RepoRoot", "$OutputDir") +