Skip to content

Commit

Permalink
BRK: Revamp AlternatePack module
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeago committed Oct 26, 2023
1 parent dfb545f commit 5c1b362
Show file tree
Hide file tree
Showing 7 changed files with 604 additions and 196 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### New features

- NuGet-related features provided by the `NuGetPack` module can now be disabled altogether by setting the `IncludeNuGetPackSupport` property to `false`. The default value is `true`, which behaves like previous versions.

### Changes to existing features

- **BREAKING CHANGE:** Alternate pack methods can now be used independently of one another. Therefore the `AlternatePackMethod` property has been discontinued; to enable alternate pack, just set `UseAlternatePack` to `true`, as in versions prior to 1.0.41-preview where `AlternatePackMethod` was introduced.
- **BREAKING CHANGE:** InnoSetup support has been completely rewritten. Main features include the following:
- Creation of an InnoSetup installations is no longer bound to a `PublishFolder`.
- An `InnoSetup` item must be created for every installation program to create.
- Source files for an installation can come from a publish folders, or from a custom location.
- Installation programs can be automatically added to the release asset list.
- The default name for a zipped publish folder is now suffixed with the complete informational version (the `AssemblyInformationalVersion` property) when available, including semantic versioning metadata. This allows for clearer distinction between, for example, zip files created locally and on a continuous integration server.

### Bugs fixed in this release

- It was not possible to run InnoSetup scripts for more than one runtime identifier with the same target framework. For example, given two `PublishFolder`s, both with `TargetFramework` set to `net7.0`, whose `RuntimeIdentifier`s were `win10-x86` and `win10-x64` respectively, a setup was generated only for the first of the two. This has been fixed.
Expand Down
4 changes: 3 additions & 1 deletion docs/Diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ Each module is assigned a contiguous range of 100 diagnostics, as listed below.

| Code | Severity | Message | Description |
| -----| :------: | ------- | ----------- |
| BVSDK1900 | Error | Unknown alternate pack method '...'. | The `AlternatePackMethod` property was set to an unrecognized value. |
| BVSDK1900 | Error | InnoSetup item '...' does not specify a script. | An `InnoSetup` item has no `Script` metadata. |
| BVSDK1901 | Error | InnoSetup script '...' referenced by '...' does not exist. | An `InnoSetup` item's `Script` metadata refers to a non-existing file. |
| BVSDK1902 | Error | InnoSetup item '...' refers to non-existent PublishFolder '...'. | An `InnoSetup` item has a `SourcePublishFolder` metadata, but no `PublishFolder` item exists with the specified name. |

## NerdbankGitVersioning module (2000-2099)

Expand Down
28 changes: 7 additions & 21 deletions src/Buildvana.Sdk/Modules/AlternatePack/BeforeModules.targets
Original file line number Diff line number Diff line change
@@ -1,30 +1,16 @@
<Project>

<PropertyGroup Condition="'$(AlternatePackMethod)' == 'None'">
<UsingAlternatePack>true</UsingAlternatePack>
<!-- UseAlternatePack default to false. -->
<PropertyGroup Condition="'$(UseAlternatePack)' != 'true'">
<UseAlternatePack>false</UseAlternatePack>
</PropertyGroup>

<PropertyGroup Condition="'$(AlternatePackMethod)' == 'PublishToFolders'">
<UsingAlternatePack>true</UsingAlternatePack>
<BV_AlternatePackMethod_PublishToFolders>true</BV_AlternatePackMethod_PublishToFolders>
<!-- Disable functionality provided by the NuGetPack module when using alternate pack. -->
<PropertyGroup Condition="$(UseAlternatePack)">
<IncludeNuGetPackSupport>false</IncludeNuGetPackSupport>
</PropertyGroup>

<PropertyGroup Condition="'$(AlternatePackMethod)' == 'InnoSetup'">
<UsingAlternatePack>true</UsingAlternatePack>
<BV_AlternatePackMethod_PublishToFolders>true</BV_AlternatePackMethod_PublishToFolders>
<BV_AlternatePackMethod_InnoSetup>true</BV_AlternatePackMethod_InnoSetup>
</PropertyGroup>

<PropertyGroup Condition="'$(UsingAlternatePack)' != 'true'">
<UsingAlternatePack>false</UsingAlternatePack>
</PropertyGroup>

<ItemGroup Condition="'$(AlternatePackMethod)' != '' And !$(UsingAlternatePack)">
<EvaluationError Include="BVSDK1900"
Text="Unknown alternate pack method '$(AlternatePackMethod)'." />
</ItemGroup>

<Import Project="BeforeModules.Core.targets"
Condition="$(UsingAlternatePack)" />
Condition="$(UseAlternatePack)" />

</Project>
Loading

0 comments on commit 5c1b362

Please sign in to comment.