-
So, I tried to make a bundleproj file to create install bundles which itself does not specify any RIDs so that way the project file that uses the MSBuild element in it's file can pass them in, instead none of them get passed in and the solution file runs a top level build of it only which produces nuget packages with the RID as any (it uses any when no RID is specified in them to create only packages that are not R2R + crossgen2 optimized). This is what the project file looks like (it uses dotnet/arcade to generate installers): <Project Sdk="Microsoft.Build.NoTargets/3.2.9">
<Target Name="BuildInstallerProjects" BeforeTargets="Build">
<Message Importance="high" Text="Building Installers for Windows." Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
<Message Importance="high" Text="Building Installers for Linux." Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
<Message Importance="high" Text="Building Installers for MacOS." Condition="$([MSBuild]::IsOSPlatform('OSX'))" />
<MSBuild
Projects="../bundle/Elskom.Sdk.App.Bundle.bundleproj"
Targets="GenerateInstallers"
SkipNonexistentTargets="true"
Properties="RuntimeIdentifier=win-x86"
Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
<MSBuild
Projects="../bundle/Elskom.Sdk.App.Bundle.bundleproj"
Targets="GenerateInstallers"
SkipNonexistentTargets="true"
Properties="RuntimeIdentifier=win-x64"
Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
<MSBuild
Projects="../bundle/Elskom.Sdk.App.Bundle.bundleproj"
Targets="GenerateInstallers"
SkipNonexistentTargets="true"
Properties="RuntimeIdentifier=win-arm64"
Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
<MSBuild
Projects="../bundle/Elskom.Sdk.App.Bundle.bundleproj"
Targets="GenerateInstallers"
SkipNonexistentTargets="true"
Properties="RuntimeIdentifier=linux-x64"
Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
<MSBuild
Projects="../bundle/Elskom.Sdk.App.Bundle.bundleproj"
Targets="GenerateInstallers"
SkipNonexistentTargets="true"
Properties="RuntimeIdentifier=linux-arm"
Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
<MSBuild
Projects="../bundle/Elskom.Sdk.App.Bundle.bundleproj"
Targets="GenerateInstallers"
SkipNonexistentTargets="true"
Properties="RuntimeIdentifier=linux-arm64"
Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
<MSBuild
Projects="../bundle/Elskom.Sdk.App.Bundle.bundleproj"
Targets="GenerateInstallers"
SkipNonexistentTargets="true"
Properties="RuntimeIdentifier=osx-x64"
Condition="$([MSBuild]::IsOSPlatform('OSX'))" />
<MSBuild
Projects="../bundle/Elskom.Sdk.App.Bundle.bundleproj"
Targets="GenerateInstallers"
SkipNonexistentTargets="true"
Properties="RuntimeIdentifier=osx-arm64"
Condition="$([MSBuild]::IsOSPlatform('OSX'))" />
</Target>
</Project> Unless what I have to do is generate the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I have came up with this, however it happens to have an issue after manual <Project Sdk="Microsoft.Build.NoTargets/3.2.9">
<ItemGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
<!-- Use these when OS is Windows. -->
<BundleRestoreReference Include="../bundle/Elskom.Sdk.App.Bundle.bundleproj">
<AdditionalProperties>Configuration=$(Configuration);RuntimeIdentifiers=win-x86,win-x64,win-arm64</AdditionalProperties>
</BundleRestoreReference>
<BundleRIDReference Include="../bundle/Elskom.Sdk.App.Bundle.bundleproj">
<AdditionalProperties>Configuration=$(Configuration);RuntimeIdentifier=win-x86</AdditionalProperties>
<Targets>GenerateInstallers</Targets>
</BundleRIDReference>
<BundleRIDReference Include="../bundle/Elskom.Sdk.App.Bundle.bundleproj">
<AdditionalProperties>Configuration=$(Configuration);RuntimeIdentifier=win-x64</AdditionalProperties>
<Targets>GenerateInstallers</Targets>
</BundleRIDReference>
<BundleRIDReference Include="../bundle/Elskom.Sdk.App.Bundle.bundleproj">
<AdditionalProperties>Configuration=$(Configuration);RuntimeIdentifier=win-arm64</AdditionalProperties>
<Targets>GenerateInstallers</Targets>
</BundleRIDReference>
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::IsOSPlatform('Linux'))">
<!-- Use these when OS is Linux. -->
<!-- On Linux use targets that generate an tar.gz file instead of an installer. -->
<BundleRestoreReference Include="../bundle/Elskom.Sdk.App.Bundle.bundleproj">
<AdditionalProperties>Configuration=$(Configuration);RuntimeIdentifiers=linux-x64,linux-arm,linux-arm64</AdditionalProperties>
</BundleRestoreReference>
<BundleRIDReference Include="../bundle/Elskom.Sdk.App.Bundle.bundleproj">
<AdditionalProperties>Configuration=$(Configuration);RuntimeIdentifier=linux-x64</AdditionalProperties>
</BundleRIDReference>
<BundleRIDReference Include="../bundle/Elskom.Sdk.App.Bundle.bundleproj">
<AdditionalProperties>Configuration=$(Configuration);RuntimeIdentifier=linux-arm</AdditionalProperties>
</BundleRIDReference>
<BundleRIDReference Include="../bundle/Elskom.Sdk.App.Bundle.bundleproj">
<AdditionalProperties>Configuration=$(Configuration);RuntimeIdentifier=linux-arm64</AdditionalProperties>
</BundleRIDReference>
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::IsOSPlatform('OSX'))">
<!-- Use these when OS is MacOS. -->
<BundleRestoreReference Include="../bundle/Elskom.Sdk.App.Bundle.bundleproj">
<AdditionalProperties>Configuration=$(Configuration);RuntimeIdentifiers=osx-x64,osx-arm64</AdditionalProperties>
</BundleRestoreReference>
<BundleRIDReference Include="../bundle/Elskom.Sdk.App.Bundle.bundleproj">
<AdditionalProperties>Configuration=$(Configuration);RuntimeIdentifier=osx-x64</AdditionalProperties>
<Targets>GenerateInstallers</Targets>
</BundleRIDReference>
<BundleRIDReference Include="../bundle/Elskom.Sdk.App.Bundle.bundleproj">
<AdditionalProperties>Configuration=$(Configuration);RuntimeIdentifier=osx-arm64</AdditionalProperties>
<Targets>GenerateInstallers</Targets>
</BundleRIDReference>
</ItemGroup>
<Target Name="BuildInstallerProjects" BeforeTargets="Build">
<Message Importance="high" Text="Building Installers for Windows." Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
<Message Importance="high" Text="Building Installers for Linux." Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
<Message Importance="high" Text="Building Installers for MacOS." Condition="$([MSBuild]::IsOSPlatform('OSX'))" />
<!-- Restore the bundle projects. -->
<MSBuild Projects="@(BundleRestoreReference)" Targets="restore" />
<!-- Generate installers with the RIDs specified above for the target platforms. -->
<MSBuild Projects="@(BundleRIDReference)" />
</Target>
</Project> |
Beta Was this translation helpful? Give feedback.
I have came up with this, however it happens to have an issue after manual
restore
where it says it does not have the rids in the restore assets file.