Skip to content

[release/10.0.1xx-preview6] Add dnx scripts #49486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Layout/redist/dnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
"$(dirname "$0")/dotnet" dnx "$@"
2 changes: 2 additions & 0 deletions src/Layout/redist/dnx.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
"%~dp0dotnet.exe" dnx %*
16 changes: 16 additions & 0 deletions src/Layout/redist/targets/GenerateInstallerLayout.targets
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@
Overwrite="true" />
</Target>

<Target Name="LayoutDnxScript">
<PropertyGroup>
<DnxScriptSource Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">dnx.cmd</DnxScriptSource>
<DnxScriptSource Condition="!$([MSBuild]::IsOSPlatform('WINDOWS'))">dnx</DnxScriptSource>
</PropertyGroup>
<Copy SourceFiles="$(DnxScriptSource)" DestinationFolder="$(RedistInstallerLayoutPath)" />

<!-- Mark script as executable -->
<Exec Command="chmod 644 &quot;$(RedistInstallerLayoutPath)/dnx&quot;" Condition="!$([MSBuild]::IsOSPlatform('Windows'))" />
</Target>

<!-- Replace files from the runtime packs with symbolic links to the corresponding shared framework files (and hostfxr) to reduce the size of the runtime pack directories. -->
<Target Name="ReplaceBundledRuntimePackFilesWithSymbolicLinks" DependsOnTargets="LayoutBundledComponents"
Condition="'$(BundleRuntimePacks)' == 'true' and !$([MSBuild]::IsOSPlatform('WINDOWS'))">
Expand All @@ -81,6 +92,7 @@
LayoutManifests;
LayoutBaselineWorkloadSet;
LayoutWorkloadUserLocalMarker;
LayoutDnxScript;
CrossgenLayout;
ReplaceBundledRuntimePackFilesWithSymbolicLinks"
AfterTargets="AfterBuild" />
Expand All @@ -101,6 +113,10 @@
DestinationFiles="@(SdkOutputFile -> '$(IntermediateSdkInstallerOutputPath)sdk\$(Version)\%(RecursiveDir)%(Filename)%(Extension)')"
UseHardLinksIfPossible="true"
SkipUnchangedFiles="true" />

<!-- Copy dnx script to root dotnet folder (which will map to DOTNETHOME) -->
<Copy SourceFiles="dnx.cmd" DestinationFolder="$(IntermediateSdkInstallerOutputPath)" />

</Target>

</Project>
3 changes: 0 additions & 3 deletions src/Layout/redist/targets/GenerateLayout.targets
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,6 @@
DestinationFiles="$(OutputPath)/%(BundledTools.Identity).runtimeconfig.json"
SkipUnchangedFiles="true" />

<Delete Files="$(OutputPath)/$(TargetName).deps.json;
$(OutputPath)/$(TargetName).runtimeconfig.json" />

<Delete Files="$(OutputPath)/%(BundledToolProjects.Identity).dll;
$(OutputPath)/%(BundledToolProjects.Identity).pdb" />

Expand Down
Loading