Commit a98c1ae
authored
[build] fix env vars causing gradle build error (#705)
Context: dotnet/android#5044 (comment)
Context: https://docs.microsoft.com/visualstudio/msbuild/exec-task
An env var can break the build such as running the following powershell:
> $env:FOO="`nFoo.cs(123,1) error: oh dear!"
A new line in the string is required to hit an issue. (```n`` is
PowerShell-ese for a `\n` newline.)
This results in a confusing build error:
(_BuildJava target) ->
EXEC : Foo.cs(123,1) error : oh dear!
`gradlew -d` prints every environment variable, and if there is a line
that looks like an MSBuild error then `msbuild` will emit the error.
We can set `IgnoreStandardErrorWarningFormat="true"` to disable this.
This could commonly happen on CI systems, if a commit message contains
an error message.
In the case of Azure DevOps, `%BUILD_SOURCEVERSIONMESSAGE%` will
contain the full commit message.
I also fixed the `_CleanJava` target that was not running at all.
`java-source-utils.csproj` now properly cleans now.1 parent 75354b9 commit a98c1ae
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
0 commit comments