Skip to content

Commit 6a3ce0d

Browse files
authored
Add light/lit command packages (#25334)
* Add light/lit command packages This adds light command package generation to aspnetcore. After build of a wix project, generate a light package based off of the inputs that are sent to light.exe/lit.exe.
1 parent a73ae50 commit 6a3ce0d

File tree

5 files changed

+69
-0
lines changed

5 files changed

+69
-0
lines changed

eng/Version.Details.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,10 @@
321321
<Uri>https://github.com/dotnet/arcade</Uri>
322322
<Sha>f2b7fe854a0b1f78c04dfc065164d6d61040f5b8</Sha>
323323
</Dependency>
324+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="5.0.0-beta.20427.5">
325+
<Uri>https://github.com/dotnet/arcade</Uri>
326+
<Sha>f2b7fe854a0b1f78c04dfc065164d6d61040f5b8</Sha>
327+
</Dependency>
324328
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.20427.5">
325329
<Uri>https://github.com/dotnet/arcade</Uri>
326330
<Sha>f2b7fe854a0b1f78c04dfc065164d6d61040f5b8</Sha>

eng/Versions.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@
143143
<MicrosoftEntityFrameworkCoreToolsPackageVersion>5.0.0-rc.1.20431.2</MicrosoftEntityFrameworkCoreToolsPackageVersion>
144144
<MicrosoftEntityFrameworkCorePackageVersion>5.0.0-rc.1.20431.2</MicrosoftEntityFrameworkCorePackageVersion>
145145
<MicrosoftEntityFrameworkCoreDesignPackageVersion>5.0.0-rc.1.20431.2</MicrosoftEntityFrameworkCoreDesignPackageVersion>
146+
147+
<!-- Packages from dotnet/arcade -->
148+
<MicrosoftDotNetBuildTasksInstallersPackageVersion>5.0.0-beta.20427.5</MicrosoftDotNetBuildTasksInstallersPackageVersion>
146149
</PropertyGroup>
147150
<!--
148151

src/Installers/Windows/SharedFrameworkLib/SharedFrameworkLib.wixproj

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,23 @@
4040
<PropertyGroup>
4141
<PackageFileName>$(InternalInstallerBaseName)-$(PackageVersion)-win-$(Platform)$(TargetExt)</PackageFileName>
4242
</PropertyGroup>
43+
44+
<!-- Overwrite the wix package drop creation target to create a lit
45+
package instead. -->
46+
<Target Name="CreateWixPackageDrop" AfterTargets="Build">
47+
<CreateLitCommandPackageDrop
48+
LitCommandWorkingDir="$(WixCommandObjDir)"
49+
WixExtensions="@(WixExtension)"
50+
Bf="true"
51+
Out="$(InstallersOutputPath)$(OutputName).wixlib"
52+
WixSrcFiles="@(CompileObjOutput);@(WixObject);@(WixLibProjects);@(WixLibrary)">
53+
<Output TaskParameter="LitCommandPackageNameOutput" PropertyName="_LitCommandPackageNameOutput" />
54+
</CreateLitCommandPackageDrop>
55+
<MakeDir Directories="$(WixCommandPackagesDir)" />
56+
57+
<ZipDirectory
58+
DestinationFile="$(WixCommandPackagesDir)/LitCommandPackage-$(_LitCommandPackageNameOutput).zip"
59+
SourceDirectory="$(WixCommandObjDir)/$(_LitCommandPackageNameOutput)"
60+
Overwrite="true" />
61+
</Target>
4362
</Project>

src/Installers/Windows/Wix.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,12 @@
2828
<GenerateNupkgPowershellScript>$(RepoRoot)\src\Installers\Windows\GenerateNugetPackageWithMsi.ps1</GenerateNupkgPowershellScript>
2929
</PropertyGroup>
3030

31+
<!-- Properties for light/lit command package drop generation -->
32+
<PropertyGroup>
33+
<!-- Directory for the unzipped directory -->
34+
<WixCommandObjDir>$(ArtifactsObjDir)/WixCommandPackages</WixCommandObjDir>
35+
<!-- Directory for the zipped up light/lit command package -->
36+
<WixCommandPackagesDir>$(ArtifactsNonShippingPackagesDir)</WixCommandPackagesDir>
37+
</PropertyGroup>
38+
3139
</Project>

src/Installers/Windows/Wix.targets

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@
2424
<GuidInputs>$(Version);$(Platform);$(VersionSuffix);$(_BuildNumberLabels)</GuidInputs>
2525
</PropertyGroup>
2626

27+
<ItemGroup>
28+
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Installers" Version="$(MicrosoftDotNetBuildTasksInstallersPackageVersion)" />
29+
</ItemGroup>
30+
31+
<PropertyGroup>
32+
<MicrosoftDotNetBuildTasksInstallersTaskAssembly Condition="'$(MSBuildRuntimeType)' == 'Core'">$(NuGetPackageRoot)microsoft.dotnet.build.tasks.installers\$(MicrosoftDotNetBuildTasksInstallersPackageVersion)\tools\netcoreapp2.0\Microsoft.DotNet.Build.Tasks.Installers.dll</MicrosoftDotNetBuildTasksInstallersTaskAssembly>
33+
<MicrosoftDotNetBuildTasksInstallersTaskAssembly Condition="'$(MSBuildRuntimeType)' != 'Core'">$(NuGetPackageRoot)microsoft.dotnet.build.tasks.installers\$(MicrosoftDotNetBuildTasksInstallersPackageVersion)\tools\net472\Microsoft.DotNet.Build.Tasks.Installers.dll</MicrosoftDotNetBuildTasksInstallersTaskAssembly>
34+
</PropertyGroup>
35+
36+
<UsingTask TaskName="CreateLightCommandPackageDrop" AssemblyFile="$(MicrosoftDotNetBuildTasksInstallersTaskAssembly)" />
37+
<UsingTask TaskName="CreateLitCommandPackageDrop" AssemblyFile="$(MicrosoftDotNetBuildTasksInstallersTaskAssembly)" />
38+
2739
<Target Name="GenerateGUIDs" BeforeTargets="BeforeBuild" DependsOnTargets="_GeneratePackageGuids;_GenerateBundleGuids" Condition=" '$(DisableGuidGeneration)' != 'true' " />
2840

2941
<Target Name="_GeneratePackageGuids" Condition="'$(OutputType)' == 'package'">
@@ -72,4 +84,27 @@
7284
<Copy SourceFiles="@(_cabs)" DestinationFolder="$(InstallersOutputPath)" />
7385
</Target>
7486

87+
<Target Name="CreateWixPackageDrop" AfterTargets="Build">
88+
<CreateLightCommandPackageDrop
89+
LightCommandWorkingDir="$(WixCommandObjDir)"
90+
NoLogo="true"
91+
Cultures="en-us"
92+
Out="$(InstallersOutputPath)$(PackageFileName)"
93+
AdditionalBasePaths="$(MSBuildProjectDirectory)"
94+
WixExtensions="@(WixExtension)"
95+
Loc="@(EmbeddedResource)"
96+
Sice="$(SuppressIces)"
97+
WixProjectFile="$(MSBuildProjectFile)"
98+
Fv="true"
99+
WixSrcFiles="@(CompileObjOutput);@(WixObject);@(WixLibProjects);@(_ResolvedWixLibraryPaths)">
100+
<Output TaskParameter="LightCommandPackageNameOutput" PropertyName="_LightCommandPackageNameOutput" />
101+
</CreateLightCommandPackageDrop>
102+
<MakeDir Directories="$(WixCommandPackagesDir)" />
103+
104+
<ZipDirectory
105+
DestinationFile="$(WixCommandPackagesDir)/LightCommandPackage-$(_LightCommandPackageNameOutput).zip"
106+
SourceDirectory="$(WixCommandObjDir)/$(_LightCommandPackageNameOutput)"
107+
Overwrite="true" />
108+
</Target>
109+
75110
</Project>

0 commit comments

Comments
 (0)