Skip to content

Commit cdf11d7

Browse files
jonpryordellis1972
authored andcommitted
[Xamarin.Android.Build.Tasks] Move LintToolPath Check (#659)
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=57532#c5 @pjcollins notes that if `lint` isn't installed *and isn't used*, commit 010332d will generate a build error -- because `lint` can't be found -- and this isn't necessarily warranted. It could be a backward compatibility break. Move the `lint` path check into the `<Lint/>` task so that we only generate an XA5205 error if `lint` can't be found *and* we're attempting to use `lint`.
1 parent db668ba commit cdf11d7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Xamarin.Android.Build.Tasks/Tasks/Lint.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ public override bool Execute ()
179179
Log.LogDebugTaskItems (" LibraryDirectories:", LibraryDirectories);
180180
Log.LogDebugTaskItems (" LibraryJars:", LibraryJars);
181181

182+
if (string.IsNullOrEmpty (ToolPath) || !File.Exists (GenerateFullPathToTool ())) {
183+
Log.LogCodedError ("XA5205", $"Cannot find `{ToolName}` in the Android SDK. Please set its path via /p:LintToolPath.");
184+
return false;
185+
}
186+
182187
base.Execute ();
183188

184189
return !Log.HasLoggedErrors;

src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,6 @@ public bool RunTask ()
179179
break;
180180
}
181181
}
182-
if (string.IsNullOrEmpty (LintToolPath)) {
183-
Log.LogCodedError ("XA5205", $"Cannot find {Lint} in the AndroidSdk. Please set via /p:LintToolPath.");
184-
return false;
185-
}
186-
187182

188183
foreach (var dir in AndroidSdk.GetBuildToolsPaths (AndroidSdkBuildToolsVersion)) {
189184
Log.LogDebugMessage ("Trying build-tools path: {0}", dir);

0 commit comments

Comments
 (0)