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

Android support #244

Merged
merged 3 commits into from
Jan 14, 2025
Merged

Android support #244

merged 3 commits into from
Jan 14, 2025

Conversation

marcprux
Copy link
Contributor

Add Android support

Motivation:

Support the Android platform.

Modifications:

Add Android imports and fix the default temporary directory to be correct for the OS.

Result:

The package will build and test on Android.

@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Jan 14, 2025
Copy link
Contributor

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

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

Thank you!

Copy link
Contributor

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

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

@marcprux the formatter is unhappy but otherwise this looks great

@marcprux
Copy link
Contributor Author

@marcprux the formatter is unhappy but otherwise this looks great

Is there any indication of what it doesn't like? The action log at https://github.com/apple/swift-nio-extras/actions/runs/12766669331/job/35592455040?pr=244 just reports a failure without any diagnostic message.

@Lukasa
Copy link
Contributor

Lukasa commented Jan 14, 2025

It wants you to apply this diff:

diff --git a/Tests/NIOExtrasTests/WritePCAPHandlerTest.swift b/Tests/NIOExtrasTests/WritePCAPHandlerTest.swift
index ab6c28a..1489d5b 100644
--- a/Tests/NIOExtrasTests/WritePCAPHandlerTest.swift
+++ b/Tests/NIOExtrasTests/WritePCAPHandlerTest.swift
@@ -16,12 +16,13 @@ import Foundation
 import NIOCore
 import NIOEmbedded
 import XCTest
+
+@testable import NIOExtras
+
 #if canImport(Android)
 import Android
 #endif
 
-@testable import NIOExtras
-
 class WritePCAPHandlerTest: XCTestCase {
     private var accumulatedPackets: [ByteBuffer]!
     private var channel: EmbeddedChannel!

@marcprux
Copy link
Contributor Author

It wants you to apply this diff:

Done in 63cf347

Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

Nice one, thanks!

@Lukasa Lukasa enabled auto-merge (squash) January 14, 2025 16:35
@Lukasa Lukasa merged commit aa0d902 into apple:main Jan 14, 2025
22 checks passed
mergify bot added a commit to cgrindel/rules_swift_package_manager that referenced this pull request Feb 11, 2025
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [vapor/vapor](https://redirect.github.com/vapor/vapor) | minor |
`4.112.1` -> `4.113.0` |

---

### Release Notes

<details>
<summary>vapor/vapor (vapor/vapor)</summary>

###
[`v4.113.0`](https://redirect.github.com/vapor/vapor/releases/tag/4.113.0):
- Fix warnings from NIO 2.79.0

[Compare
Source](https://redirect.github.com/vapor/vapor/compare/4.112.2...4.113.0)

#### What's Changed

Fix warnings from NIO 2.79.0 by
[@&#8203;0xTim](https://redirect.github.com/0xTim) in
[#&#8203;3285](https://redirect.github.com/vapor/vapor/issues/3285)

> Fixes a number of `Sendable` warnings introduced by
https://github.com/apple/swift-nio/releases/tag/2.79.0
>
> This also deprecates the main `Application.init()` API that was
blocking on an event loop that has been marked as `noasync` for a while.
Vapor users should migrate to the async APIs.

###### *This patch was released by
[@&#8203;0xTim](https://redirect.github.com/0xTim)*

**Full Changelog**:
vapor/vapor@4.112.2...4.113.0

###
[`v4.112.2`](https://redirect.github.com/vapor/vapor/releases/tag/4.112.2):
- Android support

[Compare
Source](https://redirect.github.com/vapor/vapor/compare/4.112.1...4.112.2)

#### What's Changed

Android support by
[@&#8203;marcprux](https://redirect.github.com/marcprux) in
[#&#8203;3282](https://redirect.github.com/vapor/vapor/issues/3282)

> This PR adds experimental support for building and testing on Android.
It simply involves adding some conditional imports.
>
> Building is contingent on
[apple/swift-distributed-tracing#163](https://redirect.github.com/apple/swift-distributed-tracing/pull/163),
[apple/swift-http-structured-headers#57](https://redirect.github.com/apple/swift-http-structured-headers/pull/57),
[swift-server/async-http-client#799](https://redirect.github.com/swift-server/async-http-client/pull/799),
and
[apple/swift-nio-extras#244](https://redirect.github.com/apple/swift-nio-extras/pull/244),
but if you use local snapshots of those packages, you can build with the
[Android SDK](https://redirect.github.com/finagolfin/swift-android-sdk)
using:
>
>
~/Library/Developer/Toolchains/swift-6.0.3-RELEASE.xctoolchain/usr/bin/swift
build --swift-sdk aarch64-unknown-linux-android24 --build-tests

###### *This patch was released by
[@&#8203;0xTim](https://redirect.github.com/0xTim)*

**Full Changelog**:
vapor/vapor@4.112.1...4.112.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC45NC4xIiwidXBkYXRlZEluVmVyIjoiMzguOTQuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: cgrindel-self-hosted-renovate[bot] <139595543+cgrindel-self-hosted-renovate[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants