Cake: Casing causes 'More than one build script specified.' message

Created on 19 Jul 2017  路  13Comments  路  Source: cake-build/cake

I switched from windows _(ps1)_ to mac _(sh)_, and noticed that using commands such as -T or -Target on the shell script it causes the following issue More than one build script specified. After a while I noticed it was just a casing issue -t worked just fine. Is there anyway to get some better notification or just to ignore casing for this?

Documentation

Most helpful comment

Able to reproduce this on MacOS 10.14 (18A391) with:

./build.sh --target build

Also tried -t, -target, -T, -Target, --Target, but they don't work.

Edit:

Had to use = like:

./build.sh --target=build

All 13 comments

@kharlamov Command line options are case sensitive in bash, so this is by design.

I guess that part makes sense, the weird part to me was the side effect when the command is wrong More than one build script specified.? However, thats no big deal now that I know, thank you.

@kharlamov That message is coming from Cake's parser so that we might want to look closer at.

Would you mind specifying what OS you're running on, which Cake version and what the command looks like to get this error?

Sure, I am using mac OS X 10.12.5 with the latest version of cake.

@kharlamov can you supply the command line used that causes the error?

I faced the same issue when running scripts cloned from this repo https://github.com/xamarin/AndroidSupportComponents.

The running script is

exec mono ./tools/Cake/Cake.exe build.cake --target libs

Without --target libs, this issue will be gone; however, that's a custom argument of the script.

When invoking Cake directly the syntax would be:
exec mono ./tools/Cake/Cake.exe build.cake --target=libs

Able to reproduce this on MacOS 10.14 (18A391) with:

./build.sh --target build

Also tried -t, -target, -T, -Target, --Target, but they don't work.

Edit:

Had to use = like:

./build.sh --target=build

Can confirm this issue, reproduce on Mac OS 10.14.1 (18B75).

Able to reproduce this on MacOS 10.14 (18A391) with:

./build.sh --target build

Also tried -t, -target, -T, -Target, --Target, but they don't work.

Edit:

Had to use = like:

./build.sh --target=build

This Worked for me

I think part of the problem is the documentation is not clear, especially when running a Bash script as opposed to PowerShell. The doc page about running targets gives these examples:

./build.ps1 -Target Publish

./build.ps1 --target Publish --exclusive

If the tool is going to claim to be cross-platform like it does on the home page then the documentation should be cross-platform as well.

The .NET Tool runner is now the recommended way to run Cake scripts on all platforms, the bootstrapping became a lot simpler (a handful of lines of code) and the documentation on the website has been updated.

Closing this as resolved as part of the 1.0.0 milestone. Feel free to reopen if needed.


:tada: This issue has been resolved in version v1.0.0 :tada:

The release is available on:

Your GitReleaseManager bot :package::rocket:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

patriksvensson picture patriksvensson  路  5Comments

ubbeK picture ubbeK  路  5Comments

thomaslevesque picture thomaslevesque  路  4Comments

vktr picture vktr  路  6Comments

coxp picture coxp  路  5Comments