Skip to content

Upgrade dependencies + ios xcframework #78

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

Merged
merged 4 commits into from
Nov 30, 2024
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
10 changes: 5 additions & 5 deletions .github/workflows/example-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- uses: docker/build-push-action@v2
- uses: docker/build-push-action@v6
with:
context: .
file: ./example/Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: scottbrenner/generate-changelog-action@master
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- uses: android-actions/setup-android@v2
- uses: android-actions/setup-android@v3
- uses: subosito/flutter-action@main
with:
flutter-version: '3.x'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@main
with:
flutter-version: '3.x'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: futureware-tech/simulator-action@v1
with:
os: iOS
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@main
with:
flutter-version: '3.x'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@main
with:
flutter-version: '3.x'
Expand All @@ -23,4 +23,4 @@ jobs:
flutter pub get
- run: sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
- run: "cd example && DISPLAY=:99 flutter test -d linux integration_test/app_test.dart"
- run: "cd example && flutter test test/app_test.dart"
- run: "cd example && flutter test test/app_test.dart"
2 changes: 1 addition & 1 deletion .github/workflows/tests_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
e2e:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@main
with:
flutter-version: '3.x'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
e2e:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@main
with:
flutter-version: '3.x'
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.9.0
- Updates binaries
- Add XCFramework for ios

## 3.8.3
- Migrate to package:web

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ default: test
test:
cd example && flutter test integration_test/app_test.dart

fmt:
dart format . && dart fix --apply
cd example && dart format . && dart fix --apply

upgrade: upgrade-libs upgrade-flatbuffers

upgrade-libs:
Expand All @@ -12,4 +16,4 @@ upgrade-flatbuffers:
./scripts/upgrade_bridge_flatbuffers.sh

example-web:
docker build -t flutter-openpgp-web -f example/Dockerfile .
docker build -t flutter-openpgp-web -f example/Dockerfile .
2 changes: 2 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include: package:flutter_lints/flutter.yaml

analyzer:
exclude:
- example/**
Expand Down
1 change: 1 addition & 0 deletions android/.gitignore
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
.DS_Store
/build
/captures
.cxx
69 changes: 44 additions & 25 deletions android/build.gradle
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,54 +1,73 @@
group 'dev.jerson.openpgp'
version '1.0'
group = "dev.jerson.openpgp"
version = "1.0-SNAPSHOT"

buildscript {
ext.kotlin_version = "1.8.22"
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.0'
classpath("com.android.tools.build:gradle:8.1.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
}
}

rootProject.allprojects {
allprojects {
repositories {
google()
mavenCentral()
}
}

apply plugin: 'com.android.library'
apply plugin: "com.android.library"
apply plugin: "kotlin-android"

android {
// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) {
namespace 'dev.jerson.openpgp'
namespace = "dev.jerson.openpgp"
}

compileSdk = 34

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}

compileSdkVersion 31
sourceSets {
main {
java.srcDirs += "src/main/kotlin"
jniLibs.srcDirs = ['src/main/jniLibs']
}
test {
java.srcDirs += "src/test/kotlin"
}
}

defaultConfig {
minSdkVersion 19
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
disable 'InvalidPackage'
minSdk = 21
}
}

task nativeLibsToJar(type: Jar, description: 'create a jar archive of the native libs') {
destinationDirectory.set(file("$buildDir/native-libs"))
archiveBaseName = 'native-libs'
from fileTree(dir: 'libs', include: '**/*.so')
into 'lib/'
}
dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.mockito:mockito-core:5.0.0")
}

tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn(nativeLibsToJar)
}
testOptions {
unitTests.all {
useJUnitPlatform()

dependencies {
api fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
outputs.upToDateWhen {false}
showStandardStreams = true
}
}
}
}
4 changes: 0 additions & 4 deletions android/gradle.properties

This file was deleted.

5 changes: 0 additions & 5 deletions android/gradle/wrapper/gradle-wrapper.properties

This file was deleted.

Empty file modified android/settings.gradle
100755 → 100644
Empty file.
Empty file modified android/src/main/AndroidManifest.xml
100755 → 100644
Empty file.
36 changes: 0 additions & 36 deletions android/src/main/java/dev/jerson/openpgp/OpenpgpPlugin.java

This file was deleted.

Binary file modified android/src/main/jniLibs/arm64-v8a/libopenpgp_bridge.so
Binary file not shown.
Binary file modified android/src/main/jniLibs/armeabi-v7a/libopenpgp_bridge.so
Binary file not shown.
Binary file modified android/src/main/jniLibs/x86/libopenpgp_bridge.so
Binary file not shown.
Binary file modified android/src/main/jniLibs/x86_64/libopenpgp_bridge.so
Binary file not shown.
35 changes: 35 additions & 0 deletions android/src/main/kotlin/dev/jerson/openpgp/OpenpgpPlugin.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package dev.jerson.openpgp

import androidx.annotation.NonNull

import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result

/** OpenpgpPlugin */
class OpenpgpPlugin: FlutterPlugin, MethodCallHandler {
/// The MethodChannel that will the communication between Flutter and native Android
///
/// This local reference serves to register the plugin with the Flutter Engine and unregister it
/// when the Flutter Engine is detached from the Activity
private lateinit var channel : MethodChannel

override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "openpgp")
channel.setMethodCallHandler(this)
}

override fun onMethodCall(call: MethodCall, result: Result) {
if (call.method == "getPlatformVersion") {
result.success("Android ${android.os.Build.VERSION.RELEASE}")
} else {
result.notImplemented()
}
}

override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
channel.setMethodCallHandler(null)
}
}
2 changes: 1 addition & 1 deletion example/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gradle-wrapper.jar
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
# See https://flutter.dev/to/reference-keystore
key.properties
**/*.keystore
**/*.jks
Loading
Loading