Commit c75bbfc
authored
[Xamarin.Android.Build.Tasks] guard
There is an email thread about ASP.NET projects in VS, and something
is potentially slowing down builds when optional workloads are
installed.
One concern is our `AutoImport.props`. Consider this example
`foo.targets` file:
<Project>
<ItemGroup>
<AndroidResource Include="$(MonoAndroidResourcePrefix)\*\*.xml" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\*\*.axml" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\*\*.png" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\*\*.jpg" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\*\*.gif" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\*\*.webp" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\font\*.ttf" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\font\*.otf" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\font\*.ttc" />
<AndroidResource Include="$(MonoAndroidResourcePrefix)\raw\*" Exclude="$(MonoAndroidResourcePrefix)\raw\.*" />
<AndroidAsset Include="$(MonoAndroidAssetsPrefix)\**\*" Exclude="$(MonoAndroidAssetsPrefix)\**\.*\**" />
</ItemGroup>
<Target Name="Build" />
</Project>
In this example `$(MonoAndroidResourcePrefix)` and
`$(MonoAndroidAssetsPrefix)` will be blank, so when we build:
> msbuild foo.targets -bl
…
MSBUILD : warning MSB5029: The value "\**\.*\**" of the "Exclude" attribute in element <ItemGroup> in file "foo.targets (13,61)"
is a wildcard that results in enumerating all files on the drive, which was likely not intended.
Check that referenced properties are always defined.
1 Warning(s)
0 Error(s)
Time Elapsed 00:02:45.14
I'm not sure if this is causing an actual problem, but I think it's a
good idea to add some safety here.
Update `AutoImport.props` to avoid including item groups when
`$(MonoAndroidResourcePrefix)` and `$(MonoAndroidAssetsPrefix)` are
not set/empty.AutoImport.props against empty values (#7837)1 parent a983fbb commit c75bbfc
File tree
1 file changed
+12
-1
lines changed- src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/Sdk
1 file changed
+12
-1
lines changedLines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
38 | 45 | | |
39 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
40 | 51 | | |
41 | 52 | | |
42 | 53 | | |
| |||
0 commit comments