-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add androidNative targets. #1739
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
base: master
Are you sure you want to change the base?
Conversation
Outdated..To run the tests on the Android Emulator run ``` ./gradlew androidNativeX64TestBinaries && adb push okio/build/bin/androidNativeX64/debugTest/test.kexe /data/local/tmp && adb shell /data/local/tmp/test.kexe ```For me all the tests passed except those: Will investigate further and update you. |
Also, OutdatedUPDATE: I got most tests running. Those are the only failing tests. ``` [ FAILED ] 3 tests, listed below: [ FAILED ] okio.NativeSystemFileSystemTest.canonicalizeDotReturnsCurrentWorkingDirectory [ FAILED ] okio.NativeSystemFileSystemTest.listOnRelativePathWhichIsNotDotReturnsRelativePaths [ FAILED ] okio.NativeSystemFileSystemTest.listOrNullOnRelativePathWhichIsNotDotReturnsRelativePaths ```To run tests now, do the following on the terminal. |
|
UPDATE again. Now the only failling tests are Best way to run the tests as of now. |
|
After reading the Knowing that, I can say that Okio does work as intended on Android native, which is useful for a bunch of Android tech apps such as Termux or Android IDEs. |
|
@JakeWharton should i edit |
|
@JakeWharton are you free to look at this? I think there are two ways to make opendir/closedir and this stuff on Android native
And also it would be nice if we could create a new nativeNonAndroid sourceset. Although if we made it then we can't use the option 1, as the platform.posix.DIR is a typealias on Linux and we can't create a typealias to a typealias. All the tests succeeded expect listOnRelativePathWhichIsNotDotReturnsRelativePaths and listOrNullOnRelativePathWhichIsNotDotReturnsRelativePaths I can probably fix this tests and edit the github workflow to run them all for androidNative. What do you think? Info: |
This adds support for androidNative targets.
This is the second attempt at trying to do this. Now I can confirm that it does compile and work.
The problem with the first attempt (#1726) was that it didn't account for the fact that platform.posix.DIR doesn't exist on androidNative. Therefore, opendir, readdir, and closedir can't be used from common code. This fixes this by using expect/actual for all this stuff.
To run the tests. Run the following commands in order.
(You need to have an Android Emulator running first.)
Closes: #1692, Closes #1242