gonative-cli 1.5.7 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +33 -21
  3. data/lib/gonative/commands/ios/build.rb +3 -4
  4. data/lib/gonative/commands/ios/publish.rb +20 -5
  5. data/lib/gonative/commands/ios/version.rb +3 -5
  6. data/lib/gonative/plugins/ios/build_framework.rb +232 -92
  7. data/lib/gonative/plugins/ios/create.rb +5 -2
  8. data/lib/gonative/plugins/ios/release.rb +144 -49
  9. data/lib/gonative/plugins/ios/verify.rb +1 -7
  10. data/lib/gonative/plugins/ios/version.rb +8 -8
  11. data/lib/gonative/utils/template_inflator.rb +8 -4
  12. data/lib/gonative/utils.rb +1 -1
  13. data/lib/gonative/version.rb +1 -1
  14. data/templates/plugins/android/plugin-metadata.json.erb +7 -0
  15. data/templates/plugins/android/src/main/{AndroidManifest.xml.tpl → AndroidManifest.xml.erb} +2 -2
  16. data/templates/plugins/android/src/main/java/io/gonative/android/plugins/JAVA_PACKAGE/{PLUGIN_NAME.java.tpl → PLUGIN_NAME.java.erb} +3 -3
  17. data/templates/plugins/ios/common/Package.swift.erb +28 -0
  18. data/templates/plugins/ios/common/Project.swift.erb +44 -0
  19. data/templates/plugins/ios/common/Resources/polyfill.js.erb +10 -0
  20. data/templates/plugins/ios/common/VERSION +1 -0
  21. data/templates/plugins/ios/common/Wrappers/dummy.m +1 -0
  22. data/templates/plugins/ios/common/Wrappers/include/dummy.h +1 -0
  23. data/templates/plugins/ios/language-specific/objc/{PLUGIN_NAME/Classes/GNPLUGIN_NAME.h.tpl → Classes/GNPLUGIN_NAME.h.erb} +4 -4
  24. data/templates/plugins/ios/language-specific/objc/Classes/GNPLUGIN_NAME.m.erb +14 -0
  25. data/templates/plugins/ios/language-specific/objc/Project.swift.erb +44 -0
  26. data/templates/plugins/ios/language-specific/swift/Classes/GNSwiftModule.m.erb +12 -0
  27. data/templates/plugins/ios/language-specific/swift/Classes/GNSwiftModule.swift.erb +14 -0
  28. data/templates/plugins/ios/language-specific/swift/Project.swift.erb +43 -0
  29. metadata +19 -20
  30. data/lib/gonative/utils/content_evaluator.rb +0 -16
  31. data/templates/build/ios/Info.plist +0 -28
  32. data/templates/build/ios/PLUGIN_NAME-umbrella.h.tpl +0 -16
  33. data/templates/build/ios/PLUGIN_NAME.modulemap.tpl +0 -6
  34. data/templates/build/ios/Podfile.tpl +0 -10
  35. data/templates/build/ios/create-framework.sh.tpl +0 -36
  36. data/templates/plugins/android/plugin-metadata.json.tpl +0 -7
  37. data/templates/plugins/ios/common/PLUGIN_NAME/Classes/Dummy.swift +0 -6
  38. data/templates/plugins/ios/common/PLUGIN_NAME/Resources/polyfill.js.tpl +0 -0
  39. data/templates/plugins/ios/common/PLUGIN_NAME.podspec.tpl +0 -30
  40. data/templates/plugins/ios/language-specific/objc/PLUGIN_NAME/Classes/GNPLUGIN_NAME.m.tpl +0 -14
  41. data/templates/plugins/ios/language-specific/swift/PLUGIN_NAME/Classes/GNSwiftModule.m.tpl +0 -12
  42. data/templates/plugins/ios/language-specific/swift/PLUGIN_NAME/Classes/GNSwiftModule.swift.tpl +0 -14
  43. /data/templates/plugins/ios/common/{PLUGIN_NAME/Frameworks → Frameworks}/.keep +0 -0
  44. /data/templates/plugins/ios/common/{PLUGIN_NAME/Info.plist → Info.plist} +0 -0
  45. /data/templates/plugins/ios/common/{PLUGIN_NAME/LICENSE → LICENSE} +0 -0
@@ -1,7 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'cocoapods'
4
3
  require 'aws-sdk-s3'
4
+ require 'digest'
5
+ require 'json'
6
+ require 'net/http'
7
+ require 'shellwords'
5
8
 
6
9
  module GoNative
7
10
  module Plugins
@@ -11,86 +14,178 @@ module GoNative
11
14
 
12
15
  extend DSL::Serviceable
13
16
 
14
- GONATIVE_SOURCE_NAME = 'gonative-specs'
17
+ attr_reader :version, :scope, :registry_url, :project_root
15
18
 
16
- attr_reader :spec, :spec_name, :plugin_name
17
-
18
- def initialize(spec_name)
19
- @spec_name = spec_name
20
- @spec = Pod::Specification.from_file(spec_name)
21
- @plugin_name = File.basename(spec_name, '.podspec')
19
+ def initialize(version, scope:, registry_url:, project_root: FileUtils.pwd)
20
+ @version = version
21
+ @scope = scope
22
+ @registry_url = registry_url
23
+ @project_root = File.expand_path(project_root)
22
24
  end
23
25
 
24
26
  def call
25
- Utils::UI.info 'Linting and releasing pod'
26
- sources_manager.update(GONATIVE_SOURCE_NAME)
27
- assert_not_pushed!
28
- move_framework_file
29
- zip!
30
- upload_to_s3
31
- push_to_pod_repo!
27
+ assert_not_published!
28
+ zip_frameworks!
29
+ upload_frameworks!
30
+ publish_to_registry!
31
+ ensure
32
+ cleanup!
32
33
  end
33
34
 
34
35
  private
35
36
 
36
- def assert_not_pushed!
37
- version = spec.version
38
- name = spec.name
39
-
40
- pushed_versions = source.versions(name)&.collect(&:to_s)
37
+ def plugin_name
38
+ @plugin_name ||= begin
39
+ project_definition = File.read(File.join(project_root, 'Project.swift'))
40
+ match = project_definition.match(/name:\s*"([^"]+)"/)
41
+ raise Error, "Could not determine project name from Project.swift" unless match
41
42
 
42
- if pushed_versions&.include? version.to_s
43
- raise Error,
44
- "#{name} (#{version}) has already been pushed to #{source.name}"
43
+ match[1]
45
44
  end
46
45
  end
47
46
 
48
- def push_to_pod_repo!
49
- system "pod repo push #{GONATIVE_SOURCE_NAME} #{spec_name} --private --allow-warnings"
47
+ def package_name
48
+ @package_name ||= plugin_name.gsub(/([A-Z]+)([A-Z][a-z])/, '\1-\2')
49
+ .gsub(/([a-z\d])([A-Z])/, '\1-\2')
50
+ .downcase
51
+ end
52
+
53
+ def assert_not_published!
54
+ Utils::UI.info 'Checking if version already exists'
55
+ uri = URI("#{registry_url}/#{scope}/#{package_name}/#{version}")
56
+ response = Net::HTTP.get_response(uri)
57
+
58
+ return unless response.is_a?(Net::HTTPSuccess)
59
+
60
+ raise Error, "#{plugin_name} #{version} has already been published to the registry"
61
+ end
62
+
63
+ def frameworks_dir
64
+ File.join(project_root, 'Frameworks')
50
65
  end
51
66
 
52
- def source
53
- @source ||= sources_manager.source_with_name_or_url(GONATIVE_SOURCE_NAME)
67
+ def extensions_dir
68
+ File.join(project_root, 'Extensions')
54
69
  end
55
70
 
56
- def move_framework_file
57
- Utils::UI.info 'Moving framework to plugin directory'
58
- FileUtils.mv("build/Frameworks/#{plugin_name}.xcframework", "#{plugin_name}/Frameworks")
71
+ def zips_dir
72
+ File.join(project_root, '.build', 'zips')
59
73
  end
60
74
 
61
- def zip!
62
- Utils::UI.info 'Creating release package'
63
- FileUtils.mkdir_p('build') unless File.exist?('build')
64
- included_paths = %w[Frameworks Resources LICENSE Info.plist Classes/Dummy.swift Extensions]
65
- included_paths = included_paths.map { |path| "#{plugin_name}/#{path}" }
66
- system "zip -r build/#{zip_file_name} " + included_paths.join(' ')
75
+ # Zips each xcframework in Frameworks/ individually.
76
+ # Uses SHA256-based hash (8 chars) as filename postfix for cache-busting.
77
+ def zip_frameworks!
78
+ Utils::UI.info 'Creating framework zips'
79
+ @framework_zips = {}
80
+ FileUtils.mkdir_p(zips_dir)
81
+
82
+ Dir.glob(File.join(frameworks_dir, '*.xcframework')).each do |framework_path|
83
+ name = File.basename(framework_path, '.xcframework')
84
+ temp_zip = File.join(zips_dir, "#{name}-temp.zip")
85
+
86
+ FileUtils.rm_f(temp_zip)
87
+
88
+ # Create zip from Frameworks/ directory
89
+ FileUtils.cd(frameworks_dir) do
90
+ system "zip -Xqr #{Shellwords.escape(temp_zip)} #{Shellwords.escape("#{name}.xcframework")}" or
91
+ raise Error, "Failed to zip #{name}.xcframework"
92
+ end
93
+
94
+ # Compute hash-based filename
95
+ checksum = Digest::SHA256.file(temp_zip).hexdigest
96
+ hash = checksum[0..7]
97
+ final_name = "#{name}-#{hash}.zip"
98
+
99
+ FileUtils.mv(temp_zip, File.join(zips_dir, final_name))
100
+
101
+ @framework_zips[name] = {
102
+ zip_path: File.join(zips_dir, final_name),
103
+ url: "https://pods.median.co/#{plugin_name}/#{final_name}",
104
+ checksum: checksum
105
+ }
106
+ end
67
107
  end
68
108
 
69
- def upload_to_s3
70
- Utils::UI.info 'Uploading to S3'
109
+ def upload_frameworks!
71
110
  s3 = Aws::S3::Client.new(
72
111
  region: ENV['S3_REGION'],
73
112
  access_key_id: ENV['ACCESS_KEY_ID'],
74
113
  secret_access_key: ENV['SECRET_ACCESS_KEY']
75
114
  )
76
115
 
77
- s3.put_object(
78
- bucket: ENV['S3_BUCKET'],
79
- key: "#{plugin_name}/#{zip_file_name}",
80
- body: File.open(zip_file_path, 'rb')
81
- )
116
+ @framework_zips.each do |name, info|
117
+ key = "#{plugin_name}/#{File.basename(info[:zip_path])}"
118
+
119
+ # Skip upload if already exists (same content = same hash = same filename)
120
+ begin
121
+ s3.head_object(bucket: ENV['S3_BUCKET'], key: key)
122
+ Utils::UI.info "#{name} already exists on S3, skipping upload"
123
+ next
124
+ rescue Aws::S3::Errors::NotFound
125
+ # Not found, proceed with upload
126
+ end
127
+
128
+ Utils::UI.info "Uploading #{name} to S3"
129
+ s3.put_object(
130
+ bucket: ENV['S3_BUCKET'],
131
+ key: key,
132
+ body: File.open(info[:zip_path], 'rb')
133
+ )
134
+ end
135
+ end
136
+
137
+ def update_package_swift!(dir)
138
+ Utils::UI.info 'Updating Package.swift with binary URLs and checksums'
139
+
140
+ package_swift_path = File.join(dir, 'Package.swift')
141
+ content = File.read(package_swift_path)
142
+
143
+ @framework_zips.each do |name, info|
144
+ content = update_binary_target(content, name, info[:url], info[:checksum])
145
+ end
146
+
147
+ File.write(package_swift_path, content)
82
148
  end
83
149
 
84
- def zip_file_name
85
- "#{plugin_name}-v#{spec.version}.zip"
150
+ # Matches both "Name" and "NameBinary" target names, preserving the original.
151
+ def update_binary_target(content, name, url, checksum)
152
+ content.gsub(
153
+ /\.binaryTarget\(\s*name:\s*"(#{Regexp.escape(name)}(?:Binary)?)"\s*,\s*url:\s*"[^"]*"\s*,\s*checksum:\s*"[^"]*"\s*\)/
154
+ ) do
155
+ target_name = ::Regexp.last_match(1)
156
+ %(.binaryTarget(\n name: "#{target_name}",\n url: "#{url}",\n checksum: "#{checksum}"\n ))
157
+ end
86
158
  end
87
159
 
88
- def zip_file_path
89
- File.join('build', zip_file_name)
160
+ def publish_to_registry!
161
+ Utils::UI.info 'Publishing to SPM registry'
162
+ package_identity = "#{scope}.#{package_name}"
163
+
164
+ staging_dir = File.join(project_root, '.build', 'publish')
165
+ FileUtils.rm_rf(staging_dir)
166
+ FileUtils.mkdir_p(staging_dir)
167
+
168
+ # Copy Package.swift and supporting directories to a staging directory
169
+ # so only the wrapper metadata gets published to the registry.
170
+ FileUtils.cp(File.join(project_root, 'Package.swift'), staging_dir)
171
+
172
+ wrappers_dir = File.join(project_root, 'Wrappers')
173
+ FileUtils.cp_r(wrappers_dir, staging_dir) if File.directory?(wrappers_dir)
174
+ FileUtils.cp_r(extensions_dir, staging_dir) if File.directory?(extensions_dir)
175
+
176
+ # Update the staged Package.swift with real URLs and checksums
177
+ update_package_swift!(staging_dir)
178
+
179
+ FileUtils.cd(staging_dir) do
180
+ system "swift package-registry publish #{package_identity} #{version}" \
181
+ " --registry-url #{registry_url}" or
182
+ raise Error, 'Failed to publish to SPM registry'
183
+ end
90
184
  end
91
185
 
92
- def sources_manager
93
- Pod::Config.instance.sources_manager
186
+ def cleanup!
187
+ FileUtils.rm_rf(File.join(project_root, '.build', 'zips'))
188
+ FileUtils.rm_rf(File.join(project_root, '.build', 'publish'))
94
189
  end
95
190
  end
96
191
  end
@@ -7,13 +7,7 @@ module GoNative
7
7
  extend DSL::Serviceable
8
8
 
9
9
  def call
10
- assert_staging_clear!
11
- end
12
-
13
- def assert_staging_clear!
14
- return if `git status --porcelain`.empty?
15
-
16
- raise Error, "There are uncommitted changes in the repository"
10
+ nil
17
11
  end
18
12
  end
19
13
  end
@@ -1,21 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'cocoapods'
4
-
5
3
  module GoNative
6
4
  module Plugins
7
5
  module IOS
8
6
  class Version
9
7
  extend DSL::Serviceable
10
8
 
11
- attr_reader :spec
9
+ def call
10
+ path = File.join(Dir.pwd, 'VERSION')
11
+ unless File.exist?(path)
12
+ raise Error, 'No VERSION file found'
13
+ end
12
14
 
13
- def initialize(spec_path)
14
- @spec = Pod::Specification.from_file(spec_path)
15
- end
15
+ version = File.read(path).strip
16
+ raise Error, 'VERSION file is empty' if version.empty?
16
17
 
17
- def call
18
- Utils::UI.output(spec.version)
18
+ Utils::UI.output(version)
19
19
  end
20
20
  end
21
21
  end
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'erb'
4
+ require 'ostruct'
5
+
3
6
  module GoNative
4
7
  module Utils
5
8
  class TemplateInflator
@@ -13,10 +16,10 @@ module GoNative
13
16
 
14
17
  def call
15
18
  Dir.glob('*/').each do |dir|
16
- FileUtils.cd(dir)
17
- call
18
- FileUtils.cd('..')
19
19
  dir_name = dir.delete_suffix('/')
20
+ FileUtils.cd(dir_name) do
21
+ call
22
+ end
20
23
  normalized_name = normalized_name(dir_name)
21
24
  FileUtils.mv(dir_name, normalized_name) if dir_name != normalized_name
22
25
  end
@@ -32,7 +35,8 @@ module GoNative
32
35
 
33
36
  def contents(file)
34
37
  content = File.read(file)
35
- Utils::ContentEvaluator.call(content, options)
38
+ context = OpenStruct.new(options)
39
+ ERB.new(content).result(context.instance_eval { binding })
36
40
  end
37
41
 
38
42
  def normalized_name(file_name)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GoNative
4
4
  module Utils
5
- TEMPLATE_FILES_EXTENSION = '.tpl'.freeze
5
+ TEMPLATE_FILES_EXTENSION = '.erb'.freeze
6
6
  end
7
7
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GoNative
4
- VERSION = '1.5.7'
4
+ VERSION = '2.0.0'
5
5
  end
@@ -0,0 +1,7 @@
1
+ {
2
+ "plugin": {
3
+ "packageName": "io.gonative.android.plugins.<%= java_package %>",
4
+ "classInstance": "<%= plugin_name %>",
5
+ "pluginName": "<%= java_package + '-plugin' %>"
6
+ }
7
+ }
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
- package="io.gonative.android.plugins.#{java_package}">
3
+ package="io.gonative.android.plugins.<%= java_package %>">
4
4
 
5
- </manifest>
5
+ </manifest>
@@ -1,4 +1,4 @@
1
- package io.gonative.android.plugins.#{java_package};
1
+ package io.gonative.android.plugins.<%= java_package %>;
2
2
 
3
3
  import android.app.Activity;
4
4
  import android.content.Context;
@@ -6,8 +6,8 @@ import android.content.Context;
6
6
  import io.gonative.gonative_core.BridgeModule;
7
7
  import io.gonative.gonative_core.GoNativeActivity;
8
8
 
9
- public class #{plugin_name} implements BridgeModule {
10
- private final static String TAG = #{plugin_name}.class.getSimpleName();
9
+ public class <%= plugin_name %> implements BridgeModule {
10
+ private final static String TAG = <%= plugin_name %>.class.getSimpleName();
11
11
 
12
12
  @Override
13
13
  public void onApplicationCreate(Context context) {
@@ -0,0 +1,28 @@
1
+ // swift-tools-version: 5.9
2
+ import PackageDescription
3
+
4
+ let package = Package(
5
+ name: "<%= plugin_name %>",
6
+ platforms: [.iOS("15.5")],
7
+ products: [
8
+ .library(name: "<%= plugin_name %>", targets: ["<%= plugin_name %>Wrapper"]),
9
+ ],
10
+ dependencies: [
11
+ .package(id: "median.go-native-core", from: "3.0.0"),
12
+ ],
13
+ targets: [
14
+ .target(
15
+ name: "<%= plugin_name %>Wrapper",
16
+ dependencies: [
17
+ "<%= plugin_name %>Binary",
18
+ .product(name: "GoNativeCore", package: "median.go-native-core"),
19
+ ],
20
+ path: "Wrappers"
21
+ ),
22
+ .binaryTarget(
23
+ name: "<%= plugin_name %>Binary",
24
+ url: "https://pods.median.co/<%= plugin_name %>/<%= plugin_name %>-PLACEHOLDER.zip",
25
+ checksum: "0000000000000000000000000000000000000000000000000000000000000000"
26
+ ),
27
+ ]
28
+ )
@@ -0,0 +1,44 @@
1
+ import ProjectDescription
2
+
3
+ let project = Project(
4
+ name: "<%= plugin_name %>",
5
+ packages: [
6
+ .remote(url: "median.go-native-core", requirement: .upToNextMajor(from: "3.0.0")),
7
+ ],
8
+ targets: [
9
+ .target(
10
+ name: "<%= plugin_name %>",
11
+ destinations: [.iPhone, .iPad],
12
+ product: .framework,
13
+ bundleId: "io.gonative.ios.<%= plugin_name %>",
14
+ deploymentTargets: .iOS("15.5"),
15
+ infoPlist: .file(path: "Info.plist"),
16
+ sources: [
17
+ "Classes/**",
18
+ ],
19
+ resources: [
20
+ "Resources/**",
21
+ ],
22
+ headers: .headers(
23
+ public: [
24
+ // Add public headers here
25
+ ],
26
+ project: [
27
+ // Add project headers here
28
+ ]
29
+ ),
30
+ dependencies: [
31
+ .package(product: "GoNativeCore"),
32
+ .sdk(name: "Foundation", type: .framework, status: .required),
33
+ .sdk(name: "UIKit", type: .framework, status: .required),
34
+ ],
35
+ settings: .settings(
36
+ base: [
37
+ "SWIFT_VERSION": "5.0",
38
+ "DEBUG_INFORMATION_FORMAT": "dwarf-with-dsym",
39
+ "DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT": "YES",
40
+ ]
41
+ )
42
+ ),
43
+ ]
44
+ )
@@ -0,0 +1,10 @@
1
+ // <%= plugin_name %> JavaScript API
2
+ (function() {
3
+ 'use strict';
4
+
5
+ if (!window.median) {
6
+ window.median = {};
7
+ }
8
+
9
+ // TODO: Add plugin methods here
10
+ })();
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1 @@
1
+ // Dummy implementation file for wrapper target
@@ -0,0 +1 @@
1
+ // Dummy header file for wrapper target
@@ -1,8 +1,8 @@
1
1
  //
2
- // GN#{plugin_name}.h
3
- // #{plugin_name}
2
+ // GN<%= plugin_name %>.h
3
+ // <%= plugin_name %>
4
4
  //
5
- // Created by Hunaid Hassan.
5
+ // Created by Median.
6
6
  //
7
7
 
8
8
  #import <Foundation/Foundation.h>
@@ -10,7 +10,7 @@
10
10
 
11
11
  NS_ASSUME_NONNULL_BEGIN
12
12
 
13
- @interface GN#{plugin_name} : GNEventEmitter
13
+ @interface GN<%= plugin_name %> : GNEventEmitter
14
14
 
15
15
  @end
16
16
 
@@ -0,0 +1,14 @@
1
+ //
2
+ // GN<%= plugin_name %>.m
3
+ // <%= plugin_name %>
4
+ //
5
+ // Created by Median.
6
+ //
7
+
8
+ #import "GN<%= plugin_name %>.h"
9
+
10
+ @implementation GN<%= plugin_name %>
11
+
12
+ GN_EXPORT_MODULE()
13
+
14
+ @end
@@ -0,0 +1,44 @@
1
+ import ProjectDescription
2
+
3
+ let project = Project(
4
+ name: "<%= plugin_name %>",
5
+ packages: [
6
+ .remote(url: "median.go-native-core", requirement: .upToNextMajor(from: "3.0.0")),
7
+ ],
8
+ targets: [
9
+ .target(
10
+ name: "<%= plugin_name %>",
11
+ destinations: [.iPhone, .iPad],
12
+ product: .framework,
13
+ bundleId: "io.gonative.ios.<%= plugin_name %>",
14
+ deploymentTargets: .iOS("15.5"),
15
+ infoPlist: .file(path: "Info.plist"),
16
+ sources: [
17
+ "Classes/**",
18
+ ],
19
+ resources: [
20
+ "Resources/**",
21
+ ],
22
+ headers: .headers(
23
+ public: [
24
+ "Classes/GN<%= plugin_name %>.h",
25
+ ],
26
+ project: [
27
+ "Classes/GN<%= plugin_name %>.m",
28
+ ]
29
+ ),
30
+ dependencies: [
31
+ .package(product: "GoNativeCore"),
32
+ .sdk(name: "Foundation", type: .framework, status: .required),
33
+ .sdk(name: "UIKit", type: .framework, status: .required),
34
+ ],
35
+ settings: .settings(
36
+ base: [
37
+ "SWIFT_VERSION": "5.0",
38
+ "DEBUG_INFORMATION_FORMAT": "dwarf-with-dsym",
39
+ "DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT": "YES",
40
+ ]
41
+ )
42
+ ),
43
+ ]
44
+ )
@@ -0,0 +1,12 @@
1
+ //
2
+ // GNSwiftModule.m
3
+ // <%= plugin_name %>
4
+ //
5
+ // Created by Median.
6
+ //
7
+
8
+ #import <GoNativeCore/GNEventEmitter.h>
9
+
10
+ @interface GN_EXTERN_MODULE(GN<%= plugin_name %>, GNEventEmitter)
11
+
12
+ @end
@@ -0,0 +1,14 @@
1
+ //
2
+ // GNSwiftModule.swift
3
+ // <%= plugin_name %>
4
+ //
5
+ // Created by Median.
6
+ //
7
+
8
+ import Foundation
9
+ import GoNativeCore
10
+
11
+ @objc(GN<%= plugin_name %>)
12
+ public class GN<%= plugin_name %>: GNEventEmitter {
13
+
14
+ }
@@ -0,0 +1,43 @@
1
+ import ProjectDescription
2
+
3
+ let project = Project(
4
+ name: "<%= plugin_name %>",
5
+ packages: [
6
+ .remote(url: "median.go-native-core", requirement: .upToNextMajor(from: "3.0.0")),
7
+ ],
8
+ targets: [
9
+ .target(
10
+ name: "<%= plugin_name %>",
11
+ destinations: [.iPhone, .iPad],
12
+ product: .framework,
13
+ bundleId: "io.gonative.ios.<%= plugin_name %>",
14
+ deploymentTargets: .iOS("15.5"),
15
+ infoPlist: .file(path: "Info.plist"),
16
+ sources: [
17
+ "Classes/**",
18
+ ],
19
+ resources: [
20
+ "Resources/**",
21
+ ],
22
+ headers: .headers(
23
+ public: [
24
+ ],
25
+ project: [
26
+ "Classes/GNSwiftModule.m",
27
+ ]
28
+ ),
29
+ dependencies: [
30
+ .package(product: "GoNativeCore"),
31
+ .sdk(name: "Foundation", type: .framework, status: .required),
32
+ .sdk(name: "UIKit", type: .framework, status: .required),
33
+ ],
34
+ settings: .settings(
35
+ base: [
36
+ "SWIFT_VERSION": "5.0",
37
+ "DEBUG_INFORMATION_FORMAT": "dwarf-with-dsym",
38
+ "DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT": "YES",
39
+ ]
40
+ )
41
+ ),
42
+ ]
43
+ )