Skip to content
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
4 changes: 2 additions & 2 deletions build-tools/scripts/BuildEverything.mk
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ framework-assemblies:
rm -f bin/$(conf)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0/Xamarin.Android.NUnitLite.dll; \
$(call MSBUILD_BINLOG,NUnitLite,$(_SLN_BUILD),$(conf)) $(MSBUILD_FLAGS) src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj \
/p:Configuration=$(conf) $(_MSBUILD_ARGS) \
/p:AndroidApiLevel=$(lastword $(API_LEVELS)) /p:AndroidPlatformId=$(word $(lastword $(API_LEVELS)), $(ALL_PLATFORM_IDS)) \
/p:AndroidFrameworkVersion=$(lastword $(FRAMEWORKS)) || exit 1; )
/p:AndroidApiLevel=$(firstword $(API_LEVELS)) /p:AndroidPlatformId=$(word $(firstword $(API_LEVELS)), $(ALL_PLATFORM_IDS)) \
/p:AndroidFrameworkVersion=$(firstword $(FRAMEWORKS)) || exit 1; )
_latest_stable_framework=$$($(MSBUILD) /p:DoNotLoadOSProperties=True /nologo /v:minimal /t:GetAndroidLatestStableFrameworkVersion build-tools/scripts/Info.targets | tr -d '[[:space:]]') ; \
$(foreach conf, $(CONFIGURATIONS), \
rm -f "bin/$(conf)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/$$_latest_stable_framework"/Mono.Android.Export.* ; \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ public override void OnStart ()

string GetResultsPath ()
{
Java.IO.File resultsPathFile = null;
#if __ANDROID_19__
if (((int)Build.VERSION.SdkInt) >= 19)
resultsPathFile = Context.GetExternalFilesDir (global::Android.OS.Environment.DirectoryDocuments);
#endif
Java.IO.File resultsPathFile = GetExternalFilesDir ();
var usePathFile = resultsPathFile != null && resultsPathFile.Exists ();
var resultsPath = usePathFile
? resultsPathFile.AbsolutePath
Expand All @@ -117,6 +113,19 @@ string GetResultsPath ()
return Path.Combine (resultsPath, "TestResults.xml");
}

Java.IO.File GetExternalFilesDir ()
{
if (((int)Build.VERSION.SdkInt) < 19)
return null;
string type = null;
#if __ANDROID_19__
type = global::Android.OS.Environment.DirectoryDocuments;
#else // !__ANDROID_19__
type = global::Android.OS.Environment.DirectoryDownloads;
#endif // !__ANDROID_19__
return Context.GetExternalFilesDir (type);
}

// On some Android targets, the external storage directory is "emulated",
// in which case the paths used on-device by the application are *not*
// paths that can be used off-device with `adb pull`.
Expand Down