From 1ad9f80188b2fa296933af35e6902ffcd6db001e Mon Sep 17 00:00:00 2001 From: Soumya Ranjan Mahunt Date: Sun, 6 Mar 2022 20:12:54 +0530 Subject: [PATCH] feat: allow local flutter module to be declared dependency --- .gitignore | 114 +++++ cocoapods-embed-flutter.gemspec | 14 +- example/flutter_module/.gitignore | 48 ++ example/flutter_module/.metadata | 10 + example/flutter_module/README.md | 11 + example/flutter_module/analysis_options.yaml | 4 + example/flutter_module/flutter_module.iml | 18 + .../flutter_module/flutter_module_android.iml | 27 ++ example/flutter_module/lib/main.dart | 112 +++++ example/flutter_module/pubspec.lock | 174 +++++++ example/flutter_module/pubspec.yaml | 87 ++++ example/flutter_module/test/widget_test.dart | 30 ++ example/ios_app/Gemfile | 4 + example/ios_app/Gemfile.lock | 105 +++++ example/ios_app/Podfile | 11 + example/ios_app/Podfile.lock | 28 ++ .../ios_app/ios_app.xcodeproj/project.pbxproj | 426 ++++++++++++++++++ .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 98 ++++ .../ios_app/Assets.xcassets/Contents.json | 6 + example/ios_app/ios_app/ContentView.swift | 40 ++ .../Preview Assets.xcassets/Contents.json | 6 + example/ios_app/ios_app/ios_appApp.swift | 18 + lib/cocoapods-embed-flutter.rb | 3 + lib/cocoapods-embed-flutter/command.rb | 1 - .../command/flutter.rb | 44 -- .../flutter/dependency.rb | 40 ++ .../flutter/pubspec.rb | 61 +++ lib/cocoapods-embed-flutter/gem_version.rb | 3 +- lib/cocoapods-embed-flutter/source.rb | 1 + .../src/flutter_module.rb | 46 ++ lib/cocoapods_plugin.rb | 2 +- spec/command/flutter_spec.rb | 12 - 33 files changed, 1550 insertions(+), 65 deletions(-) create mode 100644 example/flutter_module/.gitignore create mode 100644 example/flutter_module/.metadata create mode 100644 example/flutter_module/README.md create mode 100644 example/flutter_module/analysis_options.yaml create mode 100644 example/flutter_module/flutter_module.iml create mode 100644 example/flutter_module/flutter_module_android.iml create mode 100644 example/flutter_module/lib/main.dart create mode 100644 example/flutter_module/pubspec.lock create mode 100644 example/flutter_module/pubspec.yaml create mode 100644 example/flutter_module/test/widget_test.dart create mode 100644 example/ios_app/Gemfile create mode 100644 example/ios_app/Gemfile.lock create mode 100644 example/ios_app/Podfile create mode 100644 example/ios_app/Podfile.lock create mode 100644 example/ios_app/ios_app.xcodeproj/project.pbxproj create mode 100644 example/ios_app/ios_app/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 example/ios_app/ios_app/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 example/ios_app/ios_app/Assets.xcassets/Contents.json create mode 100644 example/ios_app/ios_app/ContentView.swift create mode 100644 example/ios_app/ios_app/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 example/ios_app/ios_app/ios_appApp.swift delete mode 100644 lib/cocoapods-embed-flutter/command.rb delete mode 100644 lib/cocoapods-embed-flutter/command/flutter.rb create mode 100644 lib/cocoapods-embed-flutter/flutter/dependency.rb create mode 100644 lib/cocoapods-embed-flutter/flutter/pubspec.rb create mode 100644 lib/cocoapods-embed-flutter/source.rb create mode 100644 lib/cocoapods-embed-flutter/src/flutter_module.rb delete mode 100644 spec/command/flutter_spec.rb diff --git a/.gitignore b/.gitignore index 4e46fab..6577156 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,117 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +xcuserdata/ + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +*.xcscmblueprint +*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +build/ +vendor/ +DerivedData/ +*.moved-aside +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +# OS generated files # +###################### .DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# CocoaPods +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +Pods/ +contents.xcworkspacedata +IDEWorkspaceChecks.plist pkg + +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.ipr +*.iws .idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/ephemeral +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 \ No newline at end of file diff --git a/cocoapods-embed-flutter.gemspec b/cocoapods-embed-flutter.gemspec index 58005ae..d5d2118 100644 --- a/cocoapods-embed-flutter.gemspec +++ b/cocoapods-embed-flutter.gemspec @@ -4,13 +4,13 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'cocoapods-embed-flutter/gem_version.rb' Gem::Specification.new do |spec| - spec.name = 'cocoapods-embed-flutter' + spec.name = CocoapodsEmbedFlutter::NAME spec.version = CocoapodsEmbedFlutter::VERSION - spec.authors = ['Soumya Mahunt'] - spec.email = ['soumya.mahunt@tatadigital.com'] - spec.description = %q{A short description of cocoapods-embed-flutter.} - spec.summary = %q{A longer description of cocoapods-embed-flutter.} - spec.homepage = 'https://github.com/EXAMPLE/cocoapods-embed-flutter' + spec.authors = ['Soumya Ranjan Mahunt'] + spec.email = ['devsoumyamahunt@gmail.com'] + spec.description = %q{Embed flutter plugins in iOS projects.} + spec.summary = %q{Embed flutter plugins in iOS projects.} + spec.homepage = 'https://github.com/soumyamahunt/cocoapods-embed-flutter' spec.license = 'MIT' spec.files = `git ls-files`.split($/) @@ -18,6 +18,8 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ['lib'] + spec.add_dependency 'yaml' + spec.add_development_dependency 'bundler', '~> 1.3' spec.add_development_dependency 'rake' end diff --git a/example/flutter_module/.gitignore b/example/flutter_module/.gitignore new file mode 100644 index 0000000..ff612b3 --- /dev/null +++ b/example/flutter_module/.gitignore @@ -0,0 +1,48 @@ +.DS_Store +.dart_tool/ + +.packages +.pub/ + +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +*.swp +profile + +DerivedData/ + +.generated/ + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + +build/ +.android/ +.ios/ +.flutter-plugins +.flutter-plugins-dependencies + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json diff --git a/example/flutter_module/.metadata b/example/flutter_module/.metadata new file mode 100644 index 0000000..26b1aaf --- /dev/null +++ b/example/flutter_module/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 097d3313d8e2c7f901932d63e537c1acefb87800 + channel: stable + +project_type: module diff --git a/example/flutter_module/README.md b/example/flutter_module/README.md new file mode 100644 index 0000000..0796ed0 --- /dev/null +++ b/example/flutter_module/README.md @@ -0,0 +1,11 @@ +# flutter_module + +A new flutter module project. + +## Getting Started + +For help getting started with Flutter, view our online +[documentation](https://flutter.dev/). + +For instructions integrating Flutter modules to your existing applications, +see the [add-to-app documentation](https://flutter.dev/docs/development/add-to-app). diff --git a/example/flutter_module/analysis_options.yaml b/example/flutter_module/analysis_options.yaml new file mode 100644 index 0000000..a5744c1 --- /dev/null +++ b/example/flutter_module/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/example/flutter_module/flutter_module.iml b/example/flutter_module/flutter_module.iml new file mode 100644 index 0000000..e5c8371 --- /dev/null +++ b/example/flutter_module/flutter_module.iml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/example/flutter_module/flutter_module_android.iml b/example/flutter_module/flutter_module_android.iml new file mode 100644 index 0000000..6fa7b63 --- /dev/null +++ b/example/flutter_module/flutter_module_android.iml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + diff --git a/example/flutter_module/lib/main.dart b/example/flutter_module/lib/main.dart new file mode 100644 index 0000000..358c6ce --- /dev/null +++ b/example/flutter_module/lib/main.dart @@ -0,0 +1,112 @@ +import 'package:flutter/material.dart'; + +void main() => runApp(const MyApp()); + +class MyApp extends StatelessWidget { + const MyApp({Key? key}) : super(key: key); + + // This widget is the root of your application. + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + theme: ThemeData( + // This is the theme of your application. + // + // Try running your application with "flutter run". You'll see the + // application has a blue toolbar. Then, without quitting the app, try + // changing the primarySwatch below to Colors.green and then invoke + // "hot reload" (press "r" in the console where you ran "flutter run", + // or press Run > Flutter Hot Reload in a Flutter IDE). Notice that the + // counter didn't reset back to zero; the application is not restarted. + primarySwatch: Colors.blue, + ), + home: const MyHomePage(title: 'Flutter Demo Home Page'), + ); + } +} + +class MyHomePage extends StatefulWidget { + const MyHomePage({Key? key, required this.title}) : super(key: key); + + // This widget is the home page of your application. It is stateful, meaning + // that it has a State object (defined below) that contains fields that affect + // how it looks. + + // This class is the configuration for the state. It holds the values (in this + // case the title) provided by the parent (in this case the App widget) and + // used by the build method of the State. Fields in a Widget subclass are + // always marked "final". + + final String title; + + @override + State createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + int _counter = 0; + + void _incrementCounter() { + setState(() { + // This call to setState tells the Flutter framework that something has + // changed in this State, which causes it to rerun the build method below + // so that the display can reflect the updated values. If we changed + // _counter without calling setState(), then the build method would not be + // called again, and so nothing would appear to happen. + _counter++; + }); + } + + @override + Widget build(BuildContext context) { + // This method is rerun every time setState is called, for instance as done + // by the _incrementCounter method above. + // + // The Flutter framework has been optimized to make rerunning build methods + // fast, so that you can just rebuild anything that needs updating rather + // than having to individually change instances of widgets. + return Scaffold( + appBar: AppBar( + // Here we take the value from the MyHomePage object that was created by + // the App.build method, and use it to set our appbar title. + title: Text(widget.title), + ), + body: Center( + // Center is a layout widget. It takes a single child and positions it + // in the middle of the parent. + child: Column( + // Column is also a layout widget. It takes a list of children and + // arranges them vertically. By default, it sizes itself to fit its + // children horizontally, and tries to be as tall as its parent. + // + // Invoke "debug painting" (press "p" in the console, choose the + // "Toggle Debug Paint" action from the Flutter Inspector in Android + // Studio, or the "Toggle Debug Paint" command in Visual Studio Code) + // to see the wireframe for each widget. + // + // Column has various properties to control how it sizes itself and + // how it positions its children. Here we use mainAxisAlignment to + // center the children vertically; the main axis here is the vertical + // axis because Columns are vertical (the cross axis would be + // horizontal). + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text( + 'You have pushed the button this many times:', + ), + Text( + '$_counter', + style: Theme.of(context).textTheme.headline4, + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: _incrementCounter, + tooltip: 'Increment', + child: const Icon(Icons.add), + ), // This trailing comma makes auto-formatting nicer for build methods. + ); + } +} diff --git a/example/flutter_module/pubspec.lock b/example/flutter_module/pubspec.lock new file mode 100644 index 0000000..7e78bae --- /dev/null +++ b/example/flutter_module/pubspec.lock @@ -0,0 +1,174 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.8.2" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + lints: + dependency: transitive + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.8" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" +sdks: + dart: ">=2.16.1 <3.0.0" diff --git a/example/flutter_module/pubspec.yaml b/example/flutter_module/pubspec.yaml new file mode 100644 index 0000000..ee03aed --- /dev/null +++ b/example/flutter_module/pubspec.yaml @@ -0,0 +1,87 @@ +name: flutter_module +description: A new flutter module project. + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# +# This version is used _only_ for the Runner app, which is used if you just do +# a `flutter run` or a `flutter make-host-app-editable`. It has no impact +# on any other native host app that you embed your Flutter project into. +version: 1.0.0+1 + +environment: + sdk: ">=2.16.1 <3.0.0" + +dependencies: + flutter: + sdk: flutter + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^1.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +flutter: + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add Flutter specific assets to your application, add an assets section, + # like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add Flutter specific custom fonts to your application, add a fonts + # section here, in this "flutter" section. Each entry in this list should + # have a "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages + + + # This section identifies your Flutter project as a module meant for + # embedding in a native host app. These identifiers should _not_ ordinarily + # be changed after generation - they are used to ensure that the tooling can + # maintain consistency when adding or modifying assets and plugins. + # They also do not have any bearing on your native host application's + # identifiers, which may be completely independent or the same as these. + module: + androidX: true + androidPackage: com.example.flutter_module + iosBundleIdentifier: com.example.flutterModule diff --git a/example/flutter_module/test/widget_test.dart b/example/flutter_module/test/widget_test.dart new file mode 100644 index 0000000..0c7ffca --- /dev/null +++ b/example/flutter_module/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility that Flutter provides. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:flutter_module/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} diff --git a/example/ios_app/Gemfile b/example/ios_app/Gemfile new file mode 100644 index 0000000..9445d2f --- /dev/null +++ b/example/ios_app/Gemfile @@ -0,0 +1,4 @@ +source 'https://rubygems.org' + +gem 'cocoapods', '~> 1.11.2' +gem 'cocoapods-embed-flutter', :path => '../../' diff --git a/example/ios_app/Gemfile.lock b/example/ios_app/Gemfile.lock new file mode 100644 index 0000000..a520dc3 --- /dev/null +++ b/example/ios_app/Gemfile.lock @@ -0,0 +1,105 @@ +PATH + remote: ../.. + specs: + cocoapods-embed-flutter (0.0.1) + yaml + +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.5) + rexml + activesupport (6.1.4.6) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + addressable (2.8.0) + public_suffix (>= 2.0.2, < 5.0) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) + atomos (0.1.3) + claide (1.1.0) + cocoapods (1.11.2) + addressable (~> 2.8) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.11.2) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 1.4.0, < 2.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) + escape (~> 0.0.4) + fourflusher (>= 2.3.0, < 3.0) + gh_inspector (~> 1.0) + molinillo (~> 0.8.0) + nap (~> 1.0) + ruby-macho (>= 1.0, < 3.0) + xcodeproj (>= 1.21.0, < 2.0) + cocoapods-core (1.11.2) + activesupport (>= 5.0, < 7) + addressable (~> 2.8) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + netrc (~> 0.11) + public_suffix (~> 4.0) + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.5) + cocoapods-downloader (1.5.1) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.1) + cocoapods-trunk (1.6.0) + nap (>= 0.8, < 2.0) + netrc (~> 0.11) + cocoapods-try (1.2.0) + colored2 (3.1.2) + concurrent-ruby (1.1.9) + escape (0.0.4) + ethon (0.15.0) + ffi (>= 1.15.0) + ffi (1.15.5) + fourflusher (2.3.1) + fuzzy_match (2.0.4) + gh_inspector (1.1.3) + httpclient (2.8.3) + i18n (1.10.0) + concurrent-ruby (~> 1.0) + json (2.6.1) + minitest (5.15.0) + molinillo (0.8.0) + nanaimo (0.3.0) + nap (1.1.0) + netrc (0.11.0) + public_suffix (4.0.6) + rexml (3.2.5) + ruby-macho (2.5.1) + typhoeus (1.4.0) + ethon (>= 0.9.0) + tzinfo (2.0.4) + concurrent-ruby (~> 1.0) + xcodeproj (1.21.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.3.0) + rexml (~> 3.2.4) + yaml (0.2.0) + zeitwerk (2.5.4) + +PLATFORMS + universal-darwin-21 + +DEPENDENCIES + cocoapods (~> 1.11.2) + cocoapods-embed-flutter! + +BUNDLED WITH + 2.3.7 diff --git a/example/ios_app/Podfile b/example/ios_app/Podfile new file mode 100644 index 0000000..167e105 --- /dev/null +++ b/example/ios_app/Podfile @@ -0,0 +1,11 @@ +# Uncomment the next line to define a global platform for your project +platform :ios, '9.0' +plugin 'cocoapods-embed-flutter' + +target 'ios_app' do + # Comment the next line if you don't want to use dynamic frameworks + use_frameworks! + + # Pods for ios_app + flutter_module 'flutter_module', :path => '../' +end diff --git a/example/ios_app/Podfile.lock b/example/ios_app/Podfile.lock new file mode 100644 index 0000000..f437c7b --- /dev/null +++ b/example/ios_app/Podfile.lock @@ -0,0 +1,28 @@ +PODS: + - Flutter (1.0.0) + - flutter_module (0.0.1): + - Flutter + - FlutterPluginRegistrant (0.0.1): + - Flutter + +DEPENDENCIES: + - Flutter (from `../flutter_module/.ios/Flutter/engine`) + - flutter_module (from `../flutter_module/.ios/Flutter`) + - FlutterPluginRegistrant (from `../flutter_module/.ios/Flutter/FlutterPluginRegistrant`) + +EXTERNAL SOURCES: + Flutter: + :path: "../flutter_module/.ios/Flutter/engine" + flutter_module: + :path: "../flutter_module/.ios/Flutter" + FlutterPluginRegistrant: + :path: "../flutter_module/.ios/Flutter/FlutterPluginRegistrant" + +SPEC CHECKSUMS: + Flutter: bdfa2e8fe0e2880a2c6a58a0b1a8675c262a07af + flutter_module: d1e1ff44505640bd9aa37f23f63380c646272be4 + FlutterPluginRegistrant: 2afd5ea46d3a949472c9b7da6462d8fbf7d8b16e + +PODFILE CHECKSUM: c3b3a9549c635bdd7321f4b209b67310a97803e9 + +COCOAPODS: 1.11.2 diff --git a/example/ios_app/ios_app.xcodeproj/project.pbxproj b/example/ios_app/ios_app.xcodeproj/project.pbxproj new file mode 100644 index 0000000..fdfb062 --- /dev/null +++ b/example/ios_app/ios_app.xcodeproj/project.pbxproj @@ -0,0 +1,426 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXBuildFile section */ + 22CB562DAD2D1C676D5358E3 /* Pods_ios_app.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79B5C9758BB57E0B419A9552 /* Pods_ios_app.framework */; }; + 2471880027D496AC00059CE2 /* ios_appApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 247187FF27D496AC00059CE2 /* ios_appApp.swift */; }; + 2471880227D496AC00059CE2 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2471880127D496AC00059CE2 /* ContentView.swift */; }; + 2471880427D496AD00059CE2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2471880327D496AD00059CE2 /* Assets.xcassets */; }; + 2471880727D496AD00059CE2 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2471880627D496AD00059CE2 /* Preview Assets.xcassets */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 247187FC27D496AC00059CE2 /* ios_app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ios_app.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 247187FF27D496AC00059CE2 /* ios_appApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ios_appApp.swift; sourceTree = ""; }; + 2471880127D496AC00059CE2 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 2471880327D496AD00059CE2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 2471880627D496AD00059CE2 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 50ED8077F22A1CBA4F02FFCF /* Pods-ios_app.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ios_app.debug.xcconfig"; path = "Target Support Files/Pods-ios_app/Pods-ios_app.debug.xcconfig"; sourceTree = ""; }; + 79B5C9758BB57E0B419A9552 /* Pods_ios_app.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ios_app.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 98E2D0C2FE73392EB0FDA00B /* Pods-ios_app.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ios_app.release.xcconfig"; path = "Target Support Files/Pods-ios_app/Pods-ios_app.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 247187F927D496AC00059CE2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 22CB562DAD2D1C676D5358E3 /* Pods_ios_app.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 247187F327D496AC00059CE2 = { + isa = PBXGroup; + children = ( + 247187FE27D496AC00059CE2 /* ios_app */, + 247187FD27D496AC00059CE2 /* Products */, + 50216A5544007A9BD9A16E0C /* Pods */, + F73D541B21D74A80060D155B /* Frameworks */, + ); + sourceTree = ""; + }; + 247187FD27D496AC00059CE2 /* Products */ = { + isa = PBXGroup; + children = ( + 247187FC27D496AC00059CE2 /* ios_app.app */, + ); + name = Products; + sourceTree = ""; + }; + 247187FE27D496AC00059CE2 /* ios_app */ = { + isa = PBXGroup; + children = ( + 247187FF27D496AC00059CE2 /* ios_appApp.swift */, + 2471880127D496AC00059CE2 /* ContentView.swift */, + 2471880327D496AD00059CE2 /* Assets.xcassets */, + 2471880527D496AD00059CE2 /* Preview Content */, + ); + path = ios_app; + sourceTree = ""; + }; + 2471880527D496AD00059CE2 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 2471880627D496AD00059CE2 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 50216A5544007A9BD9A16E0C /* Pods */ = { + isa = PBXGroup; + children = ( + 50ED8077F22A1CBA4F02FFCF /* Pods-ios_app.debug.xcconfig */, + 98E2D0C2FE73392EB0FDA00B /* Pods-ios_app.release.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + F73D541B21D74A80060D155B /* Frameworks */ = { + isa = PBXGroup; + children = ( + 79B5C9758BB57E0B419A9552 /* Pods_ios_app.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 247187FB27D496AC00059CE2 /* ios_app */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2471880A27D496AD00059CE2 /* Build configuration list for PBXNativeTarget "ios_app" */; + buildPhases = ( + 35BF99F470B5D4D6E728DB41 /* [CP] Check Pods Manifest.lock */, + 53FA3069BD2E4806E9D8564B /* [CP-User] Run Flutter Build flutter_module Script */, + 247187F827D496AC00059CE2 /* Sources */, + 247187F927D496AC00059CE2 /* Frameworks */, + 247187FA27D496AC00059CE2 /* Resources */, + 3D8B7144B0E208F0862E51E5 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ios_app; + productName = ios_app; + productReference = 247187FC27D496AC00059CE2 /* ios_app.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 247187F427D496AC00059CE2 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1320; + LastUpgradeCheck = 1320; + TargetAttributes = { + 247187FB27D496AC00059CE2 = { + CreatedOnToolsVersion = 13.2.1; + }; + }; + }; + buildConfigurationList = 247187F727D496AC00059CE2 /* Build configuration list for PBXProject "ios_app" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 247187F327D496AC00059CE2; + productRefGroup = 247187FD27D496AC00059CE2 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 247187FB27D496AC00059CE2 /* ios_app */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 247187FA27D496AC00059CE2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2471880727D496AD00059CE2 /* Preview Assets.xcassets in Resources */, + 2471880427D496AD00059CE2 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 35BF99F470B5D4D6E728DB41 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-ios_app-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 3D8B7144B0E208F0862E51E5 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-ios_app/Pods-ios_app-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-ios_app/Pods-ios_app-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ios_app/Pods-ios_app-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 53FA3069BD2E4806E9D8564B /* [CP-User] Run Flutter Build flutter_module Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + name = "[CP-User] Run Flutter Build flutter_module Script"; + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\nset -u\nsource \"${SRCROOT}/../flutter_module/.ios/Flutter/flutter_export_environment.sh\"\nexport VERBOSE_SCRIPT_LOGGING=1 && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/xcode_backend.sh build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 247187F827D496AC00059CE2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2471880227D496AC00059CE2 /* ContentView.swift in Sources */, + 2471880027D496AC00059CE2 /* ios_appApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 2471880827D496AD00059CE2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.2; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 2471880927D496AD00059CE2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 2471880B27D496AD00059CE2 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 50ED8077F22A1CBA4F02FFCF /* Pods-ios_app.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"ios_app/Preview Content\""; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.soumyamahunt.ios-app"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 2471880C27D496AD00059CE2 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 98E2D0C2FE73392EB0FDA00B /* Pods-ios_app.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"ios_app/Preview Content\""; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.soumyamahunt.ios-app"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 247187F727D496AC00059CE2 /* Build configuration list for PBXProject "ios_app" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2471880827D496AD00059CE2 /* Debug */, + 2471880927D496AD00059CE2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2471880A27D496AD00059CE2 /* Build configuration list for PBXNativeTarget "ios_app" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2471880B27D496AD00059CE2 /* Debug */, + 2471880C27D496AD00059CE2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 247187F427D496AC00059CE2 /* Project object */; +} diff --git a/example/ios_app/ios_app/Assets.xcassets/AccentColor.colorset/Contents.json b/example/ios_app/ios_app/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/example/ios_app/ios_app/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/ios_app/ios_app/Assets.xcassets/AppIcon.appiconset/Contents.json b/example/ios_app/ios_app/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/example/ios_app/ios_app/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/ios_app/ios_app/Assets.xcassets/Contents.json b/example/ios_app/ios_app/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/example/ios_app/ios_app/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/ios_app/ios_app/ContentView.swift b/example/ios_app/ios_app/ContentView.swift new file mode 100644 index 0000000..767b1ae --- /dev/null +++ b/example/ios_app/ios_app/ContentView.swift @@ -0,0 +1,40 @@ +// +// ContentView.swift +// ios_app +// +// Created by Soumya Ranjan Mahunt on 06/03/22. +// + +import SwiftUI +import Flutter +import FlutterPluginRegistrant + +struct ContentView: View { + var body: some View { + NavigationView { + VStack { + Text("Hello, world!") + .padding() + NavigationLink("Go to Flutter", destination: FlutterView()) + } + } + } +} + + +struct FlutterView: UIViewControllerRepresentable { + + func makeUIViewController(context: Context) -> FlutterViewController { + let flutterViewController = FlutterViewController(project: nil, nibName: nil, bundle: nil) + return flutterViewController + } + + func updateUIViewController(_ uiViewController: FlutterViewController, context: Context) { + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/example/ios_app/ios_app/Preview Content/Preview Assets.xcassets/Contents.json b/example/ios_app/ios_app/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/example/ios_app/ios_app/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/ios_app/ios_app/ios_appApp.swift b/example/ios_app/ios_app/ios_appApp.swift new file mode 100644 index 0000000..3a5dffc --- /dev/null +++ b/example/ios_app/ios_app/ios_appApp.swift @@ -0,0 +1,18 @@ +// +// ios_appApp.swift +// ios_app +// +// Created by Soumya Ranjan Mahunt on 06/03/22. +// + +import SwiftUI + +@main +struct ios_appApp: App { + + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/lib/cocoapods-embed-flutter.rb b/lib/cocoapods-embed-flutter.rb index 3e4a3a3..cc6f730 100644 --- a/lib/cocoapods-embed-flutter.rb +++ b/lib/cocoapods-embed-flutter.rb @@ -1 +1,4 @@ require 'cocoapods-embed-flutter/gem_version' +require 'cocoapods-embed-flutter/source' + +include CocoapodsEmbedFlutter::FlutterModule diff --git a/lib/cocoapods-embed-flutter/command.rb b/lib/cocoapods-embed-flutter/command.rb deleted file mode 100644 index 3cb204e..0000000 --- a/lib/cocoapods-embed-flutter/command.rb +++ /dev/null @@ -1 +0,0 @@ -require 'cocoapods-embed-flutter/command/flutter' diff --git a/lib/cocoapods-embed-flutter/command/flutter.rb b/lib/cocoapods-embed-flutter/command/flutter.rb deleted file mode 100644 index 0d7d599..0000000 --- a/lib/cocoapods-embed-flutter/command/flutter.rb +++ /dev/null @@ -1,44 +0,0 @@ -module Pod - class Command - # This is an example of a cocoapods plugin adding a top-level subcommand - # to the 'pod' command. - # - # You can also create subcommands of existing or new commands. Say you - # wanted to add a subcommand to `list` to show newly deprecated pods, - # (e.g. `pod list deprecated`), there are a few things that would need - # to change. - # - # - move this file to `lib/pod/command/list/deprecated.rb` and update - # the class to exist in the the Pod::Command::List namespace - # - change this class to extend from `List` instead of `Command`. This - # tells the plugin system that it is a subcommand of `list`. - # - edit `lib/cocoapods_plugins.rb` to require this file - # - # @todo Create a PR to add your plugin to CocoaPods/cocoapods.org - # in the `plugins.json` file, once your plugin is released. - # - class Flutter < Command - self.summary = 'Short description of cocoapods-embed-flutter.' - - self.description = <<-DESC - Longer description of cocoapods-embed-flutter. - DESC - - self.arguments = 'NAME' - - def initialize(argv) - @name = argv.shift_argument - super - end - - def validate! - super - help! 'A Pod name is required.' unless @name - end - - def run - UI.puts "Add your implementation for the cocoapods-embed-flutter plugin in #{__FILE__}" - end - end - end -end diff --git a/lib/cocoapods-embed-flutter/flutter/dependency.rb b/lib/cocoapods-embed-flutter/flutter/dependency.rb new file mode 100644 index 0000000..f13974b --- /dev/null +++ b/lib/cocoapods-embed-flutter/flutter/dependency.rb @@ -0,0 +1,40 @@ +require 'cocoapods-embed-flutter/flutter/pubspec' + +module Flutter + class Dependency + attr_reader :name, :requirements, :parent_spec, :is_dev_dependency + + def initialize(name, requirements, parent_spec, dev_dependency = false) + raise StandardError, 'A flutter dependency requires a name.' unless name + raise StandardError, 'A flutter dependency requires a parent pubspec.' unless parent_spec.is_a?(Flutter::PubSpec) + @name = name + @requirements = requirements + @parent_spec = parent_spec + @is_dev_dependency = dev_dependency + end + + def self.create_from_hash(hash, parent_spec, dev_dependency = false) + raise StandardError, 'A flutter dependency requires a parent pubspec.' unless parent_spec.is_a?(Flutter::PubSpec) + hash.keys.map { |key| Flutter::Dependency.new(key, hash[key], parent_spec, dev_dependency) } + end + + def is_local + requirements.is_a?(Hash) && requirements.include?('path') + end + + def spec + Flutter::PubSpec.new(File.expand_path(path, File.dirname(parent_spec.file_path))) + end + + def install + spec.setup if is_local + end + + def method_missing(m, *args, &block) + if requirements.is_a?(Hash) && requirements.include?(m.to_s) + return requirements[m.to_s] + end + super.method_missing(m, *args, &block) + end + end +end \ No newline at end of file diff --git a/lib/cocoapods-embed-flutter/flutter/pubspec.rb b/lib/cocoapods-embed-flutter/flutter/pubspec.rb new file mode 100644 index 0000000..cd83931 --- /dev/null +++ b/lib/cocoapods-embed-flutter/flutter/pubspec.rb @@ -0,0 +1,61 @@ +require 'cocoapods-embed-flutter/flutter/dependency' +require 'yaml' + +module Flutter + NAME = 'flutter' + DIR_NAME = 'Flutter' + PUBSPEC_FILENAME = 'pubspec.yaml' + + class PubSpec + attr_reader :file_path + + def initialize(path) + @data = YAML.load_file path + @file_path = path + end + + def is_module + return false unless @data.include?(Flutter::NAME) + return @data[Flutter::NAME].is_a?(Hash) && @data[Flutter::NAME].include?('module') + end + + def pod_helper_path + File.join(File.dirname(file_path), '.ios', Flutter::DIR_NAME, 'podhelper.rb') if is_module + end + + def dependencies + return [] unless @data.include?('dependencies') + Flutter::Dependency.create_from_hash(@data['dependencies'], self) + end + + def dev_dependencies + return [] unless @data.include?('dev_dependencies') + Flutter::Dependency.create_from_hash(@data['dev_dependencies'], self) + end + + def all_dependencies + dependencies + dev_dependencies + end + + def setup + if is_module + pup_get unless File.exists?(pod_helper_path) + else + pup_get + end + + all_dependencies.each(&:install) + end + + def pup_get + Dir.chdir(File.dirname(file_path)) { |path| system('flutter pub get', exception: true) } + end + + def method_missing(m, *args, &block) + if @data.include?(m.to_s) + return @data[m.to_s] + end + super.method_missing(m, *args, &block) + end + end +end \ No newline at end of file diff --git a/lib/cocoapods-embed-flutter/gem_version.rb b/lib/cocoapods-embed-flutter/gem_version.rb index 8fcdc2a..4f45824 100644 --- a/lib/cocoapods-embed-flutter/gem_version.rb +++ b/lib/cocoapods-embed-flutter/gem_version.rb @@ -1,3 +1,4 @@ module CocoapodsEmbedFlutter - VERSION = "0.0.1" + VERSION = '0.0.1' + NAME = File.basename(File.dirname(__FILE__)) end diff --git a/lib/cocoapods-embed-flutter/source.rb b/lib/cocoapods-embed-flutter/source.rb new file mode 100644 index 0000000..1215e2d --- /dev/null +++ b/lib/cocoapods-embed-flutter/source.rb @@ -0,0 +1 @@ +require 'cocoapods-embed-flutter/src/flutter_module' diff --git a/lib/cocoapods-embed-flutter/src/flutter_module.rb b/lib/cocoapods-embed-flutter/src/flutter_module.rb new file mode 100644 index 0000000..f4ed2c4 --- /dev/null +++ b/lib/cocoapods-embed-flutter/src/flutter_module.rb @@ -0,0 +1,46 @@ +require 'cocoapods-embed-flutter/gem_version' +require 'cocoapods-embed-flutter/flutter/pubspec' + +module CocoapodsEmbedFlutter + module FlutterModule + def flutter_module(name = nil, *requirements) + raise StandardError, 'A flutter module requires a name.' unless name + + options = requirements.last + raise StandardError, "No options for flutter module: '#{name}'." unless options.is_a?(Hash) + + path = options[:path] + raise StandardError, "No path for flutter module: '#{name}'." unless path + + path = File.expand_path(path, Dir.pwd) + if File.basename(path) == Flutter::PUBSPEC_FILENAME + pubspec = Flutter::PubSpec.new(path) + raise StandardError, "Invalid pubspec path: '#{path}' for flutter module: '#{name}'." unless pubspec.name == name + path = File.dirname(path) + elsif Dir.exists?(File.expand_path(name, path)) && File.exists?(File.expand_path(Flutter::PUBSPEC_FILENAME, File.expand_path(name, path))) + module_path = File.expand_path(name, path) + pubspec = Flutter::PubSpec.new(File.expand_path(Flutter::PUBSPEC_FILENAME, module_path)) + raise StandardError, "Invalid path: '#{path}' for flutter module: '#{name}'." unless pubspec.name == name + path = module_path + elsif File.exists?(File.expand_path(Flutter::PUBSPEC_FILENAME, path)) + pubspec = Flutter::PubSpec.new(File.expand_path(Flutter::PUBSPEC_FILENAME, path)) + raise StandardError, "Invalid path: '#{path}' for flutter module: '#{name}'." unless pubspec.name == name + else + raise StandardError, "Invalid path: '#{path}' for flutter module: '#{name}'." + end + + pubspec.setup + raise StandardError, "Invalid flutter module: '#{name}'." unless File.exists?(pubspec.pod_helper_path) + + load pubspec.pod_helper_path + install_all_flutter_pods(path) + end + end + + # Registers for CocoaPods plugin hooks + module Hooks + Pod::HooksManager.register(CocoapodsEmbedFlutter::NAME, :post_install) do |installer, options| + # Do nothing + end + end +end \ No newline at end of file diff --git a/lib/cocoapods_plugin.rb b/lib/cocoapods_plugin.rb index 0f9f239..409d333 100644 --- a/lib/cocoapods_plugin.rb +++ b/lib/cocoapods_plugin.rb @@ -1 +1 @@ -require 'cocoapods-embed-flutter/command' +require 'cocoapods-embed-flutter' diff --git a/spec/command/flutter_spec.rb b/spec/command/flutter_spec.rb deleted file mode 100644 index a4c9fb5..0000000 --- a/spec/command/flutter_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -require File.expand_path('../../spec_helper', __FILE__) - -module Pod - describe Command::Flutter do - describe 'CLAide' do - it 'registers it self' do - Command.parse(%w{ flutter }).should.be.instance_of Command::Flutter - end - end - end -end -