Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(GH-143) added buildScript setting #436

Merged
merged 3 commits into from
Nov 9, 2020
Merged

Conversation

nils-a
Copy link
Member

@nils-a nils-a commented Nov 8, 2020

to configure the build script to be used for "Code Lens" and "Run Task"

fixes #143
fixes #409

This PR makes configuration of the build script for the "Run Task" command and for "Code Lens" possible.
Currently both are fixed to ./build.sh for non-Windows and powershell [...] build.ps1 for Windows.

Using this modification it is possible to have different configurations for the build script using a default value and also using platform-dependent values.

The "current" build script as given in the code would translate to the followin setting of cake.taskRunner.buildScript:

{
  "default": "./build.sh",
  "win32": "powershell -ExecutionPolicy ByPass -File build.ps1"
}

However, if this was to be set in package.json, the setting would always contain a value for win32. Therefore the default for cake.taskRunner.buildScript is null (or not configured) and the runtime-default (of the above given configuration) is set in ExtensionSettings.ts#L72.

One example for an alternate configuration could be:

{
  "default": "dotnet cake",
  "darwin": "./build.sh"
}

using the .NET global tool for all paltforms except OSX/macOS in which case the build.sh would be used.

default is a "required" property and will always be set (see ExtensionSettings.ts#L83) while the other properties of the cake.taskRunner.buildScript object should correspond to one of the values of os.platform().

nils-a and others added 3 commits November 9, 2020 00:22
to configure the build script to be used for "Code Lens" and "Run Task"
During stream, we tested out a few things, namely calling target bob,
from bill.cake, and we found that this didn't work without some
modifications.
Renamed buildScript to be launchCommand.
Removed verbosity from codelens configuration, in favour of higher level
setting.
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gep13 gep13 merged commit 4e00e07 into cake-build:develop Nov 9, 2020
@gep13
Copy link
Member

gep13 commented Nov 9, 2020

@nils-a your changes have been merged, thanks for your contribution 👍

@nils-a
Copy link
Member Author

nils-a commented Nov 9, 2020

@gep13 I "think" we broke the default setup by removing the --script argument in the code.

Using the default build.ps1 and default settings I get the following output:

❯ powershell -ExecutionPolicy ByPass -File build.ps1 "d:\_dev\test-123\build.cake" --target="Default" --verbosity=normal
Preparing to run build script...
Running build script...
More than one build script specified.
For usage, use parameter --help

I think we need to modify the default settings either to {default: "dotnet cake"} or to

{
  "default": "./build.sh --script",
  "win32": "powershell -ExecutionPolicy ByPass -File build.ps1 -Script"
}

@nils-a nils-a deleted the feature/GH-143 branch November 11, 2020 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not support Bootstrapping for .NET Core Tool out of box Allow for files other then build.ps1/build.sh
2 participants