This message was deleted.
# community-support
s
This message was deleted.
c
Is that
./gradlew
on Windows? On what bash-like shell? (and is that a supported setup). The syntax looks correct, no issues with specifying property names as youโ€™ve done.
Perhaps try double-quoting each parameter to avoid the shell messing with the args.
i
I have tried various combinations, but nothing seems to work - I am still not sure how escaping works on windows ๐Ÿ˜ž Any idea how to escape this?
c
perhaps try gradlew.bat. Or, as I do, avoid Windows ๐Ÿ˜‰.
a
I have a vague memory of having to quote args like so
Copy code
-P"konsist.releaseTarget=local"
v
You most probably have some non-printable character between
konsist
and
.releaseTarget=local
and due to that
.releaseTarget=local
is seen as separate argument that is then taken as task name.
If that is the case, then Adam's suggestion will make the error go away, but the intended property will not be set properly.
Try typing the command, not copying from somewhere, or paste it to a text file and double-check with a hex editor what you pasted in.
i
Unfortunately there is no white character - I am 100% sure of this. To demonstrate this problem I have created a simple repo - fresh gradle project with fresh Github repo, together with a single PR that triggers GithubAction workflow (add inside PR) : https://github.com/igorwojda/gradle-parameters-test/pull/1 Command ./gradlew -Pprefix.param1 -Pprefix.param2 Works on Ubuntu, error on windows:
Copy code
* What went wrong:
Task '.param1' not found in root project 'Test'.
@Vampire @Chris Lee can you take a close look? (you may not be able to see GithubActions logs, so pushing attached project to own test repo and opening PR may be the best way to set this up and reproduce the issue)
v
Why should we not be able to see the action logs? As long as your project is public, also the logs are public.
Hm, seems to be a PowerShell topic, not a Windows topic
i
@Vampire I was not able to see full logs in incognito tab, can you see all logs?
v
I think so
Yeah, definitely a PowerShell topic
If you execute
./gradlew --% -Pprefix.param1 -Pprefix.param2
it works, if you execute
./gradlew -P prefix.param1 -P prefix.param2
it works, if you execute
./gradlew -P"prefix.param1" "-Pprefix.param2"
it works
j
it is the -P
v
It is the PowerShell
๐Ÿ™‚
j
you need to do โ€œ-Pfoo=barโ€
v
Which I just said as one option
j
I think I am using power shell and I must use that, I will check when I come back home
v
I just tried all those I wrote in PowerShell, but you are welcome to also try it. ๐Ÿ™‚
j
if you execute
./gradlew -P prefix.param1 -P prefix.param2
it works
I didnโ€™t know Gradle allows spaces
v
It does for
-P
and I always use them as imho it increases readability. It does not for
-D
probably to stay consistent with
-D
of
java
.
j
Interesting, TIL and I will do the same as it is better than โ€œโ€
๐Ÿ‘Œ 2
i
Yah these spaces are nice - also think it is much more readable
Works for me now - thx a lot for help ๐ŸŽ‰
๐Ÿ‘Œ 1