-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from readdle/restore-32-bit-support
Restore 32 bit support
- Loading branch information
Showing
32 changed files
with
244 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Android CI x86 | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: macOS-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Install Swift toolchain 5.0.3 | ||
run: wget https://swift.org/builds/swift-5.0.3-release/xcode/swift-5.0.3-RELEASE/swift-5.0.3-RELEASE-osx.pkg; | ||
sudo installer -pkg swift-5.0.3-RELEASE-osx.pkg -target / | ||
- name: Install NDK | ||
run: wget https://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip; | ||
unzip android-ndk-r17c-darwin-x86_64.zip | ||
- name: Install Swift Android Toolchain | ||
run: SWIFT_ANDROID=$(curl -fsSL https://api.bintray.com/packages/readdle/swift-android-toolchain/swift-android-toolchain/versions/_latest | python -c 'import json,sys;print(json.load(sys.stdin))["name"]'); | ||
wget https://dl.bintray.com/readdle/swift-android-toolchain/swift-android-$SWIFT_ANDROID.zip; | ||
unzip swift-android-$SWIFT_ANDROID.zip; | ||
swift-android-$SWIFT_ANDROID/bin/swift-android tools --update; | ||
ln -sfn swift-android-$SWIFT_ANDROID swift-android-current | ||
- name: Download Android Emulator | ||
run: $ANDROID_HOME/tools/bin/sdkmanager "system-images;android-29;google_apis;x86" | ||
- name: Create Android Emulator | ||
run: $ANDROID_HOME/tools/bin/avdmanager create avd -n ci-test -k "system-images;android-29;google_apis;x86" -d "pixel" --force | ||
- name: Start Android Emulator | ||
run: $ANDROID_HOME/emulator/emulator -no-window -avd ci-test -noaudio > /dev/null & | ||
- name: Run connected android tests | ||
run: export TOOLCHAINS=org.swift.50320190830a; | ||
export ANDROID_NDK_HOME=$(pwd)/android-ndk-r17c; | ||
export SWIFT_ANDROID_HOME=$(pwd)/swift-android-current; | ||
export PATH=$ANDROID_NDK_HOME:$PATH; | ||
export PATH=$SWIFT_ANDROID_HOME/bin:$SWIFT_ANDROID_HOME/build-tools/current:$PATH; | ||
adb wait-for-device; | ||
./gradlew sample:cAT |
2 changes: 1 addition & 1 deletion
2
.github/workflows/android.yml → .github/workflows/android_x86_64.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Android CI | ||
name: Android CI x86_64 | ||
|
||
on: [push] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
GROUP=com.readdle.swift.java.codegen | ||
VERSION_NAME=0.9.0 | ||
VERSION_NAME=0.9.1 | ||
|
||
org.gradle.jvmargs=-Xmx1536m | ||
android.useAndroidX=true | ||
android.enableJetifier=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sample/src/androidTest/java/com/readdle/swiftjava/sample/BoolTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sample/src/androidTest/java/com/readdle/swiftjava/sample/DoubleTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sample/src/androidTest/java/com/readdle/swiftjava/sample/FloatTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sample/src/androidTest/java/com/readdle/swiftjava/sample/Int16Tests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sample/src/androidTest/java/com/readdle/swiftjava/sample/Int32Tests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sample/src/androidTest/java/com/readdle/swiftjava/sample/Int64Tests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sample/src/androidTest/java/com/readdle/swiftjava/sample/Int8Tests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
sample/src/androidTest/java/com/readdle/swiftjava/sample/Issue31Tests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.readdle.swiftjava.sample | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import com.readdle.codegen.anotation.JavaSwift | ||
import com.readdle.swiftjava.sample.SwiftEnvironment.Companion.initEnvironment | ||
import org.junit.Assert | ||
import org.junit.Before | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class Issue31Tests { | ||
|
||
@Before | ||
fun setUp() { | ||
System.loadLibrary("SampleAppCore") | ||
JavaSwift.init() | ||
initEnvironment() | ||
} | ||
|
||
@Test | ||
fun testValueTypeNanBug() { | ||
val progress = Issue31TestProgress(elapsed = 8, total = 8) | ||
Assert.assertNotEquals(Double.NaN, progress.percentage) | ||
Assert.assertNotEquals(Double.NaN, progress.calculatePercentage()) | ||
} | ||
|
||
@Test | ||
fun testReferenceTypeNanBug() { | ||
val progress = Issue31ReferenceTestProgress.init(elapsed = 8, total = 8) | ||
Assert.assertNotEquals(Double.NaN, progress.percentage) | ||
Assert.assertNotEquals(Double.NaN, progress.calculatePercentage()) | ||
} | ||
} |
7 changes: 3 additions & 4 deletions
7
sample/src/androidTest/java/com/readdle/swiftjava/sample/SampleReferenceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sample/src/androidTest/java/com/readdle/swiftjava/sample/SampleValueTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sample/src/androidTest/java/com/readdle/swiftjava/sample/StringTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sample/src/androidTest/java/com/readdle/swiftjava/sample/UInt16Tests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sample/src/androidTest/java/com/readdle/swiftjava/sample/UInt32Tests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sample/src/androidTest/java/com/readdle/swiftjava/sample/UInt64Tests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sample/src/androidTest/java/com/readdle/swiftjava/sample/UInt8Tests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.