Skip to content

Commit 62b79b9

Browse files
dsplaistedbaronfel
andauthored
Add dnx scripts (#49461)
Co-authored-by: Chet Husk <[email protected]>
1 parent 0e9898b commit 62b79b9

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

src/Layout/redist/dnx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
"$(dirname "$0")/dotnet" dnx "$@"

src/Layout/redist/dnx.cmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
"%~dp0dotnet.exe" dnx %*

src/Layout/redist/targets/GenerateInstallerLayout.targets

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@
6464
Overwrite="true" />
6565
</Target>
6666

67+
<Target Name="LayoutDnxScript">
68+
<PropertyGroup>
69+
<DnxScriptSource Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">dnx.cmd</DnxScriptSource>
70+
<DnxScriptSource Condition="!$([MSBuild]::IsOSPlatform('WINDOWS'))">dnx</DnxScriptSource>
71+
</PropertyGroup>
72+
<Copy SourceFiles="$(DnxScriptSource)" DestinationFolder="$(RedistInstallerLayoutPath)" />
73+
74+
<!-- Mark script as executable -->
75+
<Exec Command="chmod 644 &quot;$(RedistInstallerLayoutPath)/dnx&quot;" Condition="!$([MSBuild]::IsOSPlatform('Windows'))" />
76+
</Target>
77+
6778
<!-- 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. -->
6879
<Target Name="ReplaceBundledRuntimePackFilesWithSymbolicLinks" DependsOnTargets="LayoutBundledComponents"
6980
Condition="'$(BundleRuntimePacks)' == 'true' and !$([MSBuild]::IsOSPlatform('WINDOWS'))">
@@ -81,6 +92,7 @@
8192
LayoutManifests;
8293
LayoutBaselineWorkloadSet;
8394
LayoutWorkloadUserLocalMarker;
95+
LayoutDnxScript;
8496
CrossgenLayout;
8597
ReplaceBundledRuntimePackFilesWithSymbolicLinks"
8698
AfterTargets="AfterBuild" />
@@ -101,6 +113,10 @@
101113
DestinationFiles="@(SdkOutputFile -> '$(IntermediateSdkInstallerOutputPath)sdk\$(Version)\%(RecursiveDir)%(Filename)%(Extension)')"
102114
UseHardLinksIfPossible="true"
103115
SkipUnchangedFiles="true" />
116+
117+
<!-- Copy dnx script to root dotnet folder (which will map to DOTNETHOME) -->
118+
<Copy SourceFiles="dnx.cmd" DestinationFolder="$(IntermediateSdkInstallerOutputPath)" />
119+
104120
</Target>
105121

106122
</Project>

src/Layout/redist/targets/GenerateLayout.targets

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,6 @@
278278
DestinationFiles="$(OutputPath)/%(BundledTools.Identity).runtimeconfig.json"
279279
SkipUnchangedFiles="true" />
280280

281-
<Delete Files="$(OutputPath)/$(TargetName).deps.json;
282-
$(OutputPath)/$(TargetName).runtimeconfig.json" />
283-
284281
<Delete Files="$(OutputPath)/%(BundledToolProjects.Identity).dll;
285282
$(OutputPath)/%(BundledToolProjects.Identity).pdb" />
286283

0 commit comments

Comments
 (0)