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

Fix part of Mono.Posix build issue regarding MonoDroidSDK discovery. #59

Merged
merged 1 commit into from
Jun 8, 2016
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
3 changes: 1 addition & 2 deletions src/Mono.Posix/Mono.Posix.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<AndroidResgenClass>Resource</AndroidResgenClass>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<AssemblyName>Mono.Posix</AssemblyName>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v6.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
2 changes: 2 additions & 0 deletions src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ public override bool Execute ()
Log.LogDebugMessage (" TargetFrameworkVersion: {0}", TargetFrameworkVersion);
Log.LogDebugMessage (" UseLatestAndroidPlatformSdk: {0}", UseLatestAndroidPlatformSdk);
Log.LogDebugMessage (" SequencePointsMode: {0}", SequencePointsMode);
Log.LogDebugMessage (" MonoAndroidToolsPath: {0}", MonoAndroidToolsPath);
Log.LogDebugMessage (" MonoAndroidBinPath: {0}", MonoAndroidBinPath);

MonoAndroidHelper.InitializeAndroidLogger (Log);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static void RefreshAndroidSdk (string sdkPath, string ndkPath, string jav
public static void RefreshMonoDroidSdk (string toolsPath, string binPath, string[] referenceAssemblyPaths)
{
MonoDroidSdk.Refresh (toolsPath, binPath,
(from refPath in referenceAssemblyPaths
(from refPath in referenceAssemblyPaths ?? new string [0]
where !string.IsNullOrEmpty (refPath)
let path = refPath.TrimEnd (Path.DirectorySeparatorChar)
where File.Exists (Path.Combine (path, "mscorlib.dll"))
Expand Down
4 changes: 2 additions & 2 deletions src/Xamarin.Android.Build.Utilities/Sdks/MonoDroidSdkBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Xamarin.Android.Build.Utilities
abstract class MonoDroidSdkBase
{
protected readonly static string DebugRuntime = "Mono.Android.DebugRuntime-debug.apk";
protected readonly static string GeneratorExe = "generator.exe";
protected readonly static string ClassParseExe = "class-parse.exe";
protected readonly static string GeneratorScript = "generator";

// I can never remember the difference between SdkPath and anything else...
Expand Down Expand Up @@ -107,7 +107,7 @@ protected static bool ValidateRuntime (string loc)
{
return !string.IsNullOrWhiteSpace (loc) &&
(File.Exists (Path.Combine (loc, DebugRuntime)) || // Normal/expected
File.Exists (Path.Combine (loc, GeneratorExe)) || // Normal/expected
File.Exists (Path.Combine (loc, ClassParseExe)) || // Normal/expected
File.Exists (Path.Combine (loc, "Ionic.Zip.dll"))); // Wrench builds
}

Expand Down
6 changes: 5 additions & 1 deletion src/Xamarin.Android.Build.Utilities/Sdks/MonoDroidSdkUnix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ protected override string FindRuntime ()

// check also in the users folder
var personal = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
var additionalSearchPaths = new [] { Path.Combine (personal, @".xamarin.android/lib/mandroid") };
var additionalSearchPaths = new [] {
// for Mono.Posix and Mono.Data.Sqlite builds in xamarin-android.
monoAndroidPath = Path.GetFullPath (Path.Combine (new Uri (GetType ().Assembly.CodeBase).LocalPath, "..", "..", "..", "..", "..", "lib", "mandroid")),
Path.Combine (personal, @".xamarin.android/lib/mandroid")
};

return additionalSearchPaths.Concat (SearchPaths).FirstOrDefault (ValidateRuntime);
}
Expand Down