Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Use --native-subdirectory when publishing cli projects.
Browse files Browse the repository at this point in the history
This gives support for files to publish in subdirectories
from dependency nuget packages.

Additionally Change Native Compilation to consume these paths.
  • Loading branch information
brthor committed Dec 31, 2015
1 parent 7481f10 commit 68a4f89
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 19 deletions.
5 changes: 2 additions & 3 deletions scripts/compile/compile-stage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand All @@ -64,7 +64,6 @@ if (!$?) {
Exit 1
}


# Clean up bogus additional files
$FilesToClean | ForEach-Object {
$path = Join-Path $RuntimeOutputDir $_
Expand Down
2 changes: 1 addition & 1 deletion scripts/compile/compile-stage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ private void InitializeArgs(NativeCompileSettings config)
// 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}\"");

Expand All @@ -82,9 +80,10 @@ private void InitializeArgs(NativeCompileSettings config)
}

// 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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ private void InitializeArgs(NativeCompileSettings config)
}

// 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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ private void InitializeArgs(NativeCompileSettings config)
// 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}\"");

Expand All @@ -87,9 +85,10 @@ private void InitializeArgs(NativeCompileSettings config)
}

// 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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ private void InitializeArgs(NativeCompileSettings config)
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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ private void InitializeArgs(NativeCompileSettings config)
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}\"");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ private void InitializeArgs(NativeCompileSettings config)

// 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}\"");
}

Expand Down

0 comments on commit 68a4f89

Please sign in to comment.