Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Xamarin.Android.Build.Tasks] %(AndroidApiInfo.Stable)=False #1499

Merged
merged 2 commits into from
Apr 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public override bool Execute ()
if (JavaPlatformJarPath == null)
return !Log.HasLoggedErrors;

TargetSdkVersion = platform;
TargetSdkVersion = MonoAndroidHelper.SupportedVersions.GetApiLevelFromId (platform).ToString ();

Log.LogDebugMessage (" [Output] JavaPlatformJarPath: {0}", JavaPlatformJarPath);
Log.LogDebugMessage (" [Output] TargetSdkVersion: {0}", TargetSdkVersion);
Expand Down
24 changes: 13 additions & 11 deletions src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -435,33 +435,35 @@ bool ValidateApiLevels ()
// overwrite using user version only if it is
// above the maxStableApi and a valid apiLevel.
if (userSelected != null && userSelected > maxSupported && userSelected <= maxInstalled) {
AndroidApiLevel = userSelected.ToString ();
SupportedApiLevel = userSelected.ToString ();
}
}
TargetFrameworkVersion = GetTargetFrameworkVersionFromApiLevel ();
return TargetFrameworkVersion != null;
}

if (!string.IsNullOrWhiteSpace (AndroidApiLevel)) {
AndroidApiLevel = AndroidApiLevel.Trim ();
SupportedApiLevel = GetMaxSupportedApiLevel (AndroidApiLevel);
TargetFrameworkVersion = GetTargetFrameworkVersionFromApiLevel ();
return TargetFrameworkVersion != null;
}

if (!string.IsNullOrWhiteSpace (TargetFrameworkVersion)) {
TargetFrameworkVersion = TargetFrameworkVersion.Trim ();
string apiLevel = MonoAndroidHelper.SupportedVersions.GetIdFromFrameworkVersion (TargetFrameworkVersion);
if (apiLevel == null) {
string id = MonoAndroidHelper.SupportedVersions.GetIdFromFrameworkVersion (TargetFrameworkVersion);
if (id == null) {
Log.LogCodedError ("XA0000",
"Could not determine API level for $(TargetFrameworkVersion) of '{0}'.",
TargetFrameworkVersion);
return false;
}
AndroidApiLevel = apiLevel;
SupportedApiLevel = apiLevel;
AndroidApiLevel = MonoAndroidHelper.SupportedVersions.GetApiLevelFromId (id).ToString ();
SupportedApiLevel = AndroidApiLevel;
return true;
}

if (!string.IsNullOrWhiteSpace (AndroidApiLevel)) {
AndroidApiLevel = AndroidApiLevel.Trim ();
SupportedApiLevel = GetMaxSupportedApiLevel (AndroidApiLevel);
TargetFrameworkVersion = GetTargetFrameworkVersionFromApiLevel ();
return TargetFrameworkVersion != null;
}

Log.LogCodedError ("XA0000", "Could not determine $(AndroidApiLevel) or $(TargetFrameworkVersion); SHOULD NOT BE REACHED.");
return false;
}
Expand Down
3 changes: 3 additions & 0 deletions tests/locales/LibraryResources/LibraryResources.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
<AssemblyName>LibraryResources</AssemblyName>
</PropertyGroup>
<Import Project="..\..\..\Configuration.props" />
<PropertyGroup>
<TargetFrameworkVersion>$(AndroidFrameworkVersion)</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
Expand Down