From 7060845e11ebba205cfeefa13901a898c6005bfe Mon Sep 17 00:00:00 2001 From: Ivan Dlugos <6349682+vaind@users.noreply.github.com> Date: Mon, 6 May 2024 11:01:58 +0200 Subject: [PATCH] Remove JNI macos directory (#1122) Currently, macOS is not supported. Having this directory here breaks builds on apps that import jni and build macOS (among other platforms), even though if they don't need jni/jnigen for macOS specifically (and only use it on Android, for example). Therefore, removing this directory should fix the issue for now before macOS support is actually added to the package. ``` macos/Classes/jni.c:3:10: fatal error: '../../src/jni.c' file not found #include "../../src/jni.c" ^~~~~~~~~~~~~~~~~ ``` --- pkgs/jni/CHANGELOG.md | 4 ++++ pkgs/jni/macos/Classes/jni.c | 3 --- pkgs/jni/macos/jni.podspec | 27 --------------------------- pkgs/jni/pubspec.yaml | 2 +- 4 files changed, 5 insertions(+), 31 deletions(-) delete mode 100644 pkgs/jni/macos/Classes/jni.c delete mode 100644 pkgs/jni/macos/jni.podspec diff --git a/pkgs/jni/CHANGELOG.md b/pkgs/jni/CHANGELOG.md index 5bc57ff81..2c30d7180 100644 --- a/pkgs/jni/CHANGELOG.md +++ b/pkgs/jni/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.1-wip + +- Fix compilation on macOS for consumers that don't use JNI on macOS (which is still not supported) ([#1122](https://github.com/dart-lang/native/pull/1122)). + ## 0.9.0 - **Breaking Change** diff --git a/pkgs/jni/macos/Classes/jni.c b/pkgs/jni/macos/Classes/jni.c deleted file mode 100644 index 28e68ae51..000000000 --- a/pkgs/jni/macos/Classes/jni.c +++ /dev/null @@ -1,3 +0,0 @@ -// Relative import to be able to reuse the C sources. -// See the comment in ../{projectName}}.podspec for more information. -#include "../../src/jni.c" diff --git a/pkgs/jni/macos/jni.podspec b/pkgs/jni/macos/jni.podspec deleted file mode 100644 index 582861a93..000000000 --- a/pkgs/jni/macos/jni.podspec +++ /dev/null @@ -1,27 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint jni.podspec` to validate before publishing. -# -Pod::Spec.new do |s| - s.name = 'jni' - s.version = '0.0.1' - s.summary = 'A new Flutter FFI plugin project.' - s.description = <<-DESC -A new Flutter FFI plugin project. - DESC - s.homepage = 'http://example.com' - s.license = { :file => '../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } - - # This will ensure the source files in Classes/ are included in the native - # builds of apps using this FFI plugin. Podspec does not support relative - # paths, so Classes contains a forwarder C file that relatively imports - # `../src/*` so that the C sources can be shared among all target platforms. - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.dependency 'FlutterMacOS' - - s.platform = :osx, '10.11' - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } - s.swift_version = '5.0' -end diff --git a/pkgs/jni/pubspec.yaml b/pkgs/jni/pubspec.yaml index b735e85ab..9efbc485d 100644 --- a/pkgs/jni/pubspec.yaml +++ b/pkgs/jni/pubspec.yaml @@ -4,7 +4,7 @@ name: jni description: A library to access JNI from Dart and Flutter that acts as a support library for package:jnigen. -version: 0.9.0 +version: 0.9.1-wip repository: https://github.com/dart-lang/native/tree/main/pkgs/jni topics: