Skip to content

Commit

Permalink
Enable ability to setup custom build modes (microsoft#884)
Browse files Browse the repository at this point in the history
Enable ability to setup custom build modes by not validating the build
mode is either Default, Translated or Clean.

Useful in cases like microsoft/BCApps#502 where
we need to add another build mode (Strict / StrictMode)

---------

Co-authored-by: aholstrup1 <[email protected]@users.noreply.github.com>
  • Loading branch information
aholstrup1 and aholstrup1 authored Jan 24, 2024
1 parent 431e100 commit 70ee72a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion Actions/RunPipeline/RunPipeline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
[Parameter(HelpMessage = "Project folder", Mandatory = $false)]
[string] $project = "",
[Parameter(HelpMessage = "Specifies a mode to use for the build steps", Mandatory = $false)]
[ValidateSet('Default', 'Translated', 'Clean')]
[string] $buildMode = 'Default',
[Parameter(HelpMessage = "A JSON-formatted list of apps to install", Mandatory = $false)]
[string] $installAppsJson = '[]',
Expand Down
3 changes: 3 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Note that when using the preview version of AL-Go for GitHub, we recommend you Update your AL-Go system files, as soon as possible when informed that an update is available.

### Build modes
AL-Go ships with Default, Translated and Clean mode out of the box. Now you can also define custom build modes in addition to the ones shipped with AL-Go. This allows you to define your own build modes, which can be used to build your apps in different ways. By default, a custom build mode will build the apps similarly to the Default mode but this behavior can be overridden in e.g. script overrides in your repository.

## v4.1

### New Settings
Expand Down
3 changes: 2 additions & 1 deletion Scenarios/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ The repository settings are only read from the repository settings file (.github
| <a id="pullRequestTrigger"></a>pullRequestTrigger | Setting for specifying the trigger AL-Go should use to trigger Pull Request Builds. By default it is set to [pull_request_target](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target) |
| <a id="CICDSchedule"></a>CICDSchedule | CRON schedule for when CI/CD workflow should run. Default is no scheduled run, only manually triggered or triggered by Push or Pull Request. Build your CRON string here: [https://crontab.guru](https://crontab.guru) |
| <a id="UpdateGitHubGoSystemFilesSchedule"></a>UpdateGitHubGoSystemFilesSchedule | CRON schedule for when Update AL-Go System Files should run. When Update AL-Go System Files runs on a schedule, it uses direct Commit instead of creating a PR. Default is no scheduled run, only manual trigger. Build your CRON string here: [https://crontab.guru](https://crontab.guru) |
| <a id="buildModes"></a>buildModes | A list of build modes to use when building the AL-Go projects. Every AL-Go projects will be built using each built mode. Available build modes are:<br /> **Default**: Apps are compiled as they are in the source code.<br />**Clean**: _PreprocessorSymbols_ are enabled when compiling the apps. The values for the symbols correspond to the `cleanModePreprocessorSymbols` setting of the AL-Go project.<br />**Translated**: `TranslationFile` compiler feature is enabled when compiling the apps. |
| <a id="buildModes"></a>buildModes | A list of build modes to use when building the AL-Go projects. Every AL-Go project will be built using each build mode. AL-Go ships with the following build modes out of the box:<br /> **Default**: Apps are compiled as they are in the source code.<br />**Clean**: _PreprocessorSymbols_ are enabled when compiling the apps. The values for the symbols correspond to the `cleanModePreprocessorSymbols` setting of the AL-Go project.<br />**Translated**: `TranslationFile` compiler feature is enabled when compiling the apps.<br /><br />It is also possible to specify custom build modes by adding a build mode that is different than 'Default', 'Clean' or 'Translated'.
|

## Advanced settings

Expand Down
4 changes: 2 additions & 2 deletions e2eTests/scenarios/BuildModes/runtest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ CreateAlGoRepository `
-template $template `
-repository $repository `
-branch $branch `
-addRepoSettings @{"buildModes" = @("Clean", "Default", "Translated" ); "cleanModePreprocessorSymbols" = @( "CLEAN" )} `
-addRepoSettings @{"buildModes" = @("Clean", "Default", "Translated", "CustomBuildMode" ); "cleanModePreprocessorSymbols" = @( "CLEAN" )} `
-contentScript {
Param([string] $path)
CreateNewAppInFolder -folder $path -name "App" | Out-Null
Expand All @@ -64,7 +64,7 @@ Start-Process $repoPath
$run = RunCICD -repository $repository -branch $branch -wait

# Test number of artifacts
Test-ArtifactsFromRun -runid $run.id -folder 'artifacts' -expectedArtifacts @{"Apps"=1;"CleanApps"=1;"TranslatedApps"=1} -repoVersion '1.0' -appVersion '1.0'
Test-ArtifactsFromRun -runid $run.id -folder 'artifacts' -expectedArtifacts @{"Apps"=1;"CleanApps"=1;"TranslatedApps"=1;"CustomBuildModeApps"=1} -repoVersion '1.0' -appVersion '1.0'

Set-Location $prevLocation

Expand Down

0 comments on commit 70ee72a

Please sign in to comment.