Skip to content

[nunit] build X.A.NUnitLite.dll with API level 19 - #547

Merged
jonpryor merged 1 commit into
dotnet:masterfrom
radekdoulik:fix-nunitlite-build
Apr 5, 2017
Merged

[nunit] build X.A.NUnitLite.dll with API level 19#547
jonpryor merged 1 commit into
dotnet:masterfrom
radekdoulik:fix-nunitlite-build

Conversation

@radekdoulik

Copy link
Copy Markdown
Member
  • current NUnitLite was built with latest API level. that was
    problematic, because it was referencing BaseBundle class, which is
    only available in API >= 21, see
    https://developer.android.com/reference/android/os/BaseBundle.html

  • so instead of using latest API, we now build it with API 19. that's
    the lowes API level we can use, because
    src/Xamarin.Android.NUnitLite/Gui/Instrumentations/TestSuiteInstrumentation.cs
    is using global::Android.OS.Environment.DirectoryDocuments which is
    avalable in API level >= 19, see
    https://developer.android.com/reference/android/os/Environment.html#DIRECTORY_DOCUMENTS

  • also the X.A.Build.Tasks project reference is now conditional,
    because it requires API level >= 24. it is OK, because we build it
    in leeroy-all rule with latest API level and default build uses
    latest API level too. the project reference itself is there to
    ensure the build ordering, so we can safely make it conditional

  • it fixes bugs #53418 and #53884

@jonpryor

Copy link
Copy Markdown
Contributor

Unit test execution failed on macOS+xbuild PR Build, and I'm not at all sure why.

 Task "CheckAdbTarget"
[Output] IsValidTarget: True

There's an emulator...

 Tool /Users/builder/android-toolchain/sdk/platform-tools/adb execution started with arguments: uninstall "Mono.Android_Tests" [Output] Output:
Error: Could not access the Package Manager. Is the system running?

...but we can't access the package manager?

All following adb commands fail with the same message.

Re-reading, it gets weirder:

 Target AcquireAndroidTarget:
Task "CheckAdbTarget"
Using task CheckAdbTarget from Xamarin.Android.Tools.BootstrapTasks.CheckAdbTarget, Xamarin.Android.Tools.BootstrapTasks, Version=1.0.6304.13713, Culture=neutral, PublicKeyToken=null
Task CheckAdbTarget
AdbTarget: SdkVersion: Tool /Users/builder/android-toolchain/sdk/platform-tools/adb execution started with arguments: shell getprop ro.build.version.sdk Environment variables being passed to the tool:
21
Tool /Users/builder/android-toolchain/sdk/platform-tools/adb execution finished.
[Output] AdbTarget: [Output] IsValidTarget: True
Done executing task "CheckAdbTarget"
Done building target "AcquireAndroidTarget" in project "/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets".

We never create an emulator. A device is already attached, as far as AcquireAndroidTarget is concerned, so it doesn't create one.

This is very fishy; I'm going to kick off a new build.

<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\Xamarin.Android.Build.Tasks\Xamarin.Android.Build.Tasks.csproj">
<ProjectReference Condition=" '$(AndroidApiLevel)' &gt;= 24 " Include="..\Xamarin.Android.Build.Tasks\Xamarin.Android.Build.Tasks.csproj">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think > needs escaping in XML. It can be, but I don't believe it's required, and >= is certainly easier to read...

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was probably escaped by XS or emacs. will try to use >

@jonpryor

Copy link
Copy Markdown
Contributor

build

@jonpryor

Copy link
Copy Markdown
Contributor

The rebuild worked. I don't know why it failed last time.

 - current NUnitLite was built with latest API level. that was
problematic, because it was referencing BaseBundle class, which is
only available in API >= 21, see
https://developer.android.com/reference/android/os/BaseBundle.html
- so instead of using latest API, we now build it with API 19. that's
the lowes API level we can use, because
src/Xamarin.Android.NUnitLite/Gui/Instrumentations/TestSuiteInstrumentation.cs
is using global::Android.OS.Environment.DirectoryDocuments which is
avalable in API level >= 19, see
https://developer.android.com/reference/android/os/Environment.html#DIRECTORY_DOCUMENTS
- also the X.A.Build.Tasks project reference is now conditional,
because it requires API level >= 24. it is OK, because we build it
in leeroy-all rule with latest API level and default build uses
latest API level too. the project reference itself is there to
ensure the build ordering, so we can safely make it conditional
- it fixes bugs #53418 and #53884
@radekdoulik

Copy link
Copy Markdown
MemberAuthor

ok, removed the escaping

@jonpryor
jonpryor merged commit 3ed220d into dotnet:masterApr 5, 2017
jonpryor pushed a commit that referenced this pull request Apr 10, 2017
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=53418
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=53884
- current NUnitLite was built with latest API level. that was
problematic, because it was referencing BaseBundle class, which is
only available in API >= 21, see
https://developer.android.com/reference/android/os/BaseBundle.html
- so instead of using latest API, we now build it with API 19. that's
the lowes API level we can use, because
src/Xamarin.Android.NUnitLite/Gui/Instrumentations/TestSuiteInstrumentation.cs
is using global::Android.OS.Environment.DirectoryDocuments which is
avalable in API level >= 19, see
https://developer.android.com/reference/android/os/Environment.html#DIRECTORY_DOCUMENTS
- also the X.A.Build.Tasks project reference is now conditional,
because it requires API level >= 24. it is OK, because we build it
in leeroy-all rule with latest API level and default build uses
latest API level too. the project reference itself is there to
ensure the build ordering, so we can safely make it conditional
jonpryor pushed a commit that referenced this pull request Mar 18, 2020
Changes: dotnet/java-interop@bd7c60a...cedf4d0
* dotnet/java-interop@cedf4d0: [build] Convert more projects to Short-Form projects (#547)
Update `src/Mono.Android` to not check target framework of referenced
console apps. These project references only exist to ensure a
particular build order, so we can skip target framework version
compatibility checks.
jonpryor pushed a commit that referenced this pull request Mar 18, 2020
Changes: dotnet/java-interop@a84d19e...2cab35c
* dotnet/java-interop@2cab35cc: [build] Convert more projects to Short-Form projects (#547)
Update `src/Mono.Android` to not check target framework of referenced
console apps. These project references only exist to ensure a
particular build order, so we can skip target framework version
compatibility checks.
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Feb 5, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@radekdoulik@jonpryor@dnfclas