Use --native-subdirectory when publishing cli projects.

This gives support for files to publish in subdirectories
from dependency nuget packages.

Additionally Change Native Compilation to consume these paths.
This commit is contained in:
Bryan 2015-12-30 15:23:55 -08:00
parent 7481f10e45
commit 89de0c2172
9 changed files with 17 additions and 20 deletions

View file

@ -50,9 +50,9 @@ $RuntimeOutputDir = "$OutputDir\runtime\coreclr"
# Publish each project
$Projects | ForEach-Object {
dotnet publish --framework "$Tfm" --runtime "$Rid" --output "$OutputDir\bin" --configuration "$Configuration" "$RepoRoot\src\$_"
dotnet publish --native-subdirectory --framework "$Tfm" --runtime "$Rid" --output "$OutputDir\bin" --configuration "$Configuration" "$RepoRoot\src\$_"
if (!$?) {
Write-Host Command failed: dotnet publish --framework "$Tfm" --runtime "$Rid" --output "$OutputDir\bin" --configuration "$Configuration" "$RepoRoot\src\$_"
Write-Host Command failed: dotnet publish --native-subdirectory --framework "$Tfm" --runtime "$Rid" --output "$OutputDir\bin" --configuration "$Configuration" "$RepoRoot\src\$_"
exit 1
}
}
@ -64,7 +64,6 @@ if (!$?) {
Exit 1
}
# Clean up bogus additional files
$FilesToClean | ForEach-Object {
$path = Join-Path $RuntimeOutputDir $_

View file

@ -61,7 +61,7 @@ RUNTIME_OUTPUT_DIR="$OUTPUT_DIR/runtime/coreclr"
for project in ${PROJECTS[@]}
do
echo dotnet publish --framework "$TFM" --runtime "$RID" --output "$OUTPUT_DIR/bin" --configuration "$CONFIGURATION" "$REPOROOT/src/$project"
dotnet publish --framework "$TFM" --runtime "$RID" --output "$OUTPUT_DIR/bin" --configuration "$CONFIGURATION" "$REPOROOT/src/$project"
dotnet publish --native-subdirectory --framework "$TFM" --runtime "$RID" --output "$OUTPUT_DIR/bin" --configuration "$CONFIGURATION" "$REPOROOT/src/$project"
done
# Bring in the runtime

View file

@ -46,7 +46,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
argsList.Add($"\"{inputFilePath}\"");
// System.Private.CoreLib Reference
var coreLibPath = Path.Combine(config.IlcSdkPath, "System.Private.CoreLib.dll");
var coreLibPath = Path.Combine(config.IlcSdkPath, "sdk", "System.Private.CoreLib.dll");
argsList.Add($"-r \"{coreLibPath}\"");
// AppDep References

View file

@ -65,9 +65,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
// Flags
argsList.Add(cflags);
// TODO: Enable this when https://github.com/dotnet/cli/pull/469 goes through.
// var ilcSdkIncPath = Path.Combine(config.IlcSdkPath, "inc");
var ilcSdkIncPath = config.IlcSdkPath;
var ilcSdkIncPath = Path.Combine(config.IlcSdkPath, "inc");
argsList.Add("-I");
argsList.Add($"\"{ilcSdkIncPath}\"");
@ -82,9 +80,10 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
}
// ILC SDK Libs
var IlcSdkLibPath = Path.Combine(config.IlcSdkPath, "sdk");
foreach (var lib in IlcSdkLibs)
{
var libPath = Path.Combine(config.IlcSdkPath, lib);
var libPath = Path.Combine(IlcSdkLibPath, lib);
argsList.Add(libPath);
}

View file

@ -77,9 +77,10 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
}
// ILC SDK Libs
var IlcSdkLibPath = Path.Combine(config.IlcSdkPath, "sdk");
foreach (var lib in IlcSdkLibs)
{
var libPath = Path.Combine(config.IlcSdkPath, lib);
var libPath = Path.Combine(IlcSdkLibPath, lib);
argsList.Add(libPath);
}

View file

@ -67,9 +67,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
// Flags
argsList.Add(cflags);
// TODO: Enable this when https://github.com/dotnet/cli/pull/469 goes through.
// var ilcSdkIncPath = Path.Combine(config.IlcSdkPath, "inc");
var ilcSdkIncPath = config.IlcSdkPath;
var ilcSdkIncPath = Path.Combine(config.IlcSdkPath, "inc");
argsList.Add("-I");
argsList.Add($"\"{ilcSdkIncPath}\"");
@ -87,9 +85,10 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
}
// ILC SDK Libs
var IlcSdkLibPath = Path.Combine(config.IlcSdkPath, "sdk");
foreach (var lib in IlcSdkLibs)
{
var libPath = Path.Combine(config.IlcSdkPath, lib);
var libPath = Path.Combine(IlcSdkLibPath, lib);
// Forward the library to linked to the linker
argsList.Add("-Xlinker");

View file

@ -77,9 +77,10 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
argsList.Add("-Xlinker "+inLibFile);
// ILC SDK Libs
var IlcSdkLibPath = Path.Combine(config.IlcSdkPath, "sdk");
foreach (var lib in IlcSdkLibs)
{
var libPath = Path.Combine(config.IlcSdkPath, lib);
var libPath = Path.Combine(IlcSdkLibPath, lib);
argsList.Add("-Xlinker "+libPath);
}

View file

@ -68,10 +68,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
argsList.Add("/c");
// Add Includes
//
// TODO: Enable this when https://github.com/dotnet/cli/pull/469 goes through.
// var ilcSdkIncPath = Path.Combine(config.IlcSdkPath, "inc");
var ilcSdkIncPath = config.IlcSdkPath;
var ilcSdkIncPath = Path.Combine(config.IlcSdkPath, "inc");
argsList.Add("/I");
argsList.Add($"\"{ilcSdkIncPath}\"");

View file

@ -102,9 +102,10 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
// ILC SDK Libs
var SDKLibs = IlcSdkLibMap[config.NativeMode];
var IlcSdkLibPath = Path.Combine(config.IlcSdkPath, "sdk");
foreach (var lib in SDKLibs)
{
var sdkLibPath = Path.Combine(config.IlcSdkPath, lib);
var sdkLibPath = Path.Combine(IlcSdkLibPath, lib);
argsList.Add($"\"{sdkLibPath}\"");
}