Skip to content

Commit

Permalink
Build all tasks, regardless of target (dotnet#55346)
Browse files Browse the repository at this point in the history
In a dirty tree, different architectures require different tasks.

For example,
```
./build.sh --os iossimulator -c Release
./build.sh --os android -c Release
```
the second step will complain that the AndroidAppBuilder task does not exist,
because the build-semaphore.txt was created during the first build which built
the AppleAppBuilder, but not the AndroidAppBuilder.

The solution is to build all the tasks, regardless of target

Simplifies building for different targets from the same dirty tree.  All the
tasks are always built once and then remain unchanged as long as their sources
don't change.
  • Loading branch information
lambdageek authored Jul 9, 2021
1 parent e4ca022 commit 03eb03e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion src/tasks/AppleAppBuilder/AppleAppBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public override bool Execute()
throw new ArgumentException($"MainLibraryFileName='{MainLibraryFileName}' was not found in AppDir='{AppDir}'");
}

if (ProjectName.Contains(" "))
if (ProjectName.Contains(' '))
{
throw new ArgumentException($"ProjectName='{ProjectName}' should not contain spaces");
}
Expand Down
12 changes: 0 additions & 12 deletions src/tasks/tasks.proj
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
<Project Sdk="Microsoft.Build.Traversal">
<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)**\*.csproj" />
<ProjectReference Remove="$(MSBuildThisFileDirectory)AndroidAppBuilder\AndroidAppBuilder.csproj"
Condition="'$(TargetOS)' != 'Android'" />
<ProjectReference Remove="$(MSBuildThisFileDirectory)AppleAppBuilder\AppleAppBuilder.csproj"
Condition="'$(TargetOS)' != 'MacCatalyst' and '$(TargetOS)' != 'iOS' and '$(TargetOS)' != 'iOSSimulator' and '$(TargetOS)' != 'tvOS' and '$(TargetOS)' != 'tvOSSimulator'" />
<ProjectReference Remove="$(MSBuildThisFileDirectory)WasmAppBuilder\WasmAppBuilder.csproj"
Condition="'$(TargetOS)' != 'Browser'" />
<ProjectReference Remove="$(MSBuildThisFileDirectory)WasmBuildTasks\WasmBuildTasks.csproj"
Condition="'$(TargetOS)' != 'Browser'" />
<ProjectReference Remove="$(MSBuildThisFileDirectory)AotCompilerTask\MonoAOTCompiler.csproj"
Condition="'$(TargetsMobile)' != 'true'" />
<ProjectReference Remove="$(MSBuildThisFileDirectory)RuntimeConfigParser\RuntimeConfigParser.csproj"
Condition="'$(TargetsMobile)' != 'true'" />
</ItemGroup>

<!--
Expand Down

0 comments on commit 03eb03e

Please sign in to comment.