Skip to content

Commit a3dfd4c

Browse files
radicaljonpryor
authored andcommitted
[Xamarin.Android.Build.Tasks]: Fix incremental builds (#10)
The (poorly named) `_Foo` target didn't have any `//Target/@Inputs` or `//Target/@Outputs` attribute values, and thus would constantly: 1. Re-execute on every build, which would 2. Create a "new" $(IntermediateOutputPath)Profile.g.cs, which would 3. Require that Mono.Android.dll be rebuilt, as a file had changed. Rename the `_Foo` target to `_GenerateProfileClass`, and add `Inputs` and `Outputs` attributes so that the target isn't constantly executed.
1 parent 461cc83 commit a3dfd4c

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<UsingTask TaskName="Xamarin.Android.Tools.BootstrapTasks.GenerateProfile" AssemblyFile="..\..\bin\Build$(Configuration)\Xamarin.Android.Tools.BootstrapTasks.dll" />
4-
<Target Name="_Foo" BeforeTargets="CoreCompile">
5-
<PropertyGroup>
6-
<_GeneratedProfileClass>$(IntermediateOutputPath)Profile.g.cs</_GeneratedProfileClass>
7-
</PropertyGroup>
8-
<ItemGroup>
9-
<SharedRuntimeBuildPath Include="..\..\bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\" />
10-
</ItemGroup>
11-
<CreateItem Include="@(SharedRuntimeBuildPath->'%(Identity)\\v1.0\*.dll');@(SharedRuntimeBuildPath->'%(Identity)\\v6.0\*.dll')">
12-
<Output TaskParameter="Include" ItemName="_SharedRuntimeAssemblies" />
13-
</CreateItem>
4+
<PropertyGroup>
5+
<_SharedRuntimeBuildPath>..\..\bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\</_SharedRuntimeBuildPath>
6+
<_GeneratedProfileClass>$(IntermediateOutputPath)Profile.g.cs</_GeneratedProfileClass>
7+
</PropertyGroup>
8+
<ItemGroup>
9+
<_SharedRuntimeAssemblies Include="$(_SharedRuntimeBuildPath)v1.0\*.dll;$(_SharedRuntimeBuildPath)$(AndroidFrameworkVersion)\*.dll"/>
10+
</ItemGroup>
11+
12+
<Target Name="_GenerateProfileClass" BeforeTargets="CoreCompile"
13+
Inputs="@(_SharedRuntimeAssemblies)"
14+
Outputs="$(_GeneratedProfileClass)"
15+
>
1416
<GenerateProfile Files="@(_SharedRuntimeAssemblies)" OutputFile="$(_GeneratedProfileClass)" />
1517
<ItemGroup>
1618
<Compile Include="$(_GeneratedProfileClass)" />
@@ -20,4 +22,4 @@
2022
Lines="$(_GeneratedProfileClass)"
2123
Overwrite="false"/>
2224
</Target>
23-
</Project>
25+
</Project>

0 commit comments

Comments
 (0)