Skip to content

Commit

Permalink
[Xamarin.Android.Build.Tasks] Fix VS DesignTime Build Hang (dotnet#985)
Browse files Browse the repository at this point in the history
FixesL https://bugzilla.xamarin.com/show_bug.cgi?id=60080

In a previous attempt to fix an intellisense build (1cd582e) we
caused this issue. The DesignTime build does NOT like our AsyncTask
as it locks the IDE.

This commit puts the old code back in place which skips the task
if we are in DesignTime mode. But so we can easily test it, we
emit an message that our test can pick up to ensure we are doing
the correct thing. Without the message we have no way of knowing
if the task is skipped.
  • Loading branch information
dellis1972 authored and Redth committed Oct 30, 2017
1 parent 0719b46 commit 08454a6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void DesignTimeBuild ([Values(false, true)] bool isRelease, [Values (fals
b.Target = "Compile";
Assert.IsTrue (b.Build (proj, doNotCleanupOnUpdate: true, parameters: new string [] { "DesignTimeBuild=true" }, environmentVariables: envVar),
"first build failed");
Assert.AreEqual (!useManagedParser, b.LastBuildOutput.Contains ("Skipping download of "),
Assert.AreEqual (!useManagedParser, b.LastBuildOutput.Contains ("Skipping GetAdditionalResourcesFromAssemblies"),
"failed to skip the downloading of files.");
var items = new List<string> ();
string first = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,9 @@ Copyright (C) 2012 Xamarin Inc. All rights reserved.
CacheFile="$(IntermediateOutputPath)resourcepaths.cache"
YieldDuringToolExecution="$(YieldDuringToolExecution)"
DesignTimeBuild="$(DesignTimeBuild)"
Condition=" '$(DesignTimeBuild)' == '' Or '$(DesignTimeBuild)' == 'false' "
/>
<Message Text="Skipping GetAdditionalResourcesFromAssemblies in DesignTime build" Condition=" '$(DesignTimeBuild)' == 'true' " />
</Target>

<Target Name="_GetAdditionalResourcesFromAssemblies" DependsOnTargets="_BuildAdditionalResourcesCache">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,9 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved.
YieldDuringToolExecution="$(YieldDuringToolExecution)"
DesignTimeBuild="$(DesignTimeBuild)"
ContinueOnError="$(DesignTimeBuild)"
Condition=" '$(DesignTimeBuild)' == '' Or '$(DesignTimeBuild)' == 'false' "
/>
<Message Text="Skipping GetAdditionalResourcesFromAssemblies in DesignTime build" Condition=" '$(DesignTimeBuild)' == 'true' " />
</Target>

<Target Name="_ValidateResourceCache">
Expand Down

0 comments on commit 08454a6

Please sign in to comment.