gonative-cli 1.5.6 → 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.
- checksums.yaml +4 -4
- data/Gemfile.lock +33 -21
- data/lib/gonative/commands/ios/build.rb +19 -0
- data/lib/gonative/commands/ios/publish.rb +20 -5
- data/lib/gonative/commands/ios/version.rb +3 -5
- data/lib/gonative/commands.rb +1 -0
- data/lib/gonative/plugins/ios/build_framework.rb +223 -117
- data/lib/gonative/plugins/ios/create.rb +5 -2
- data/lib/gonative/plugins/ios/release.rb +162 -24
- data/lib/gonative/plugins/ios/verify.rb +1 -7
- data/lib/gonative/plugins/ios/version.rb +8 -8
- data/lib/gonative/utils/template_inflator.rb +8 -4
- data/lib/gonative/utils.rb +1 -1
- data/lib/gonative/version.rb +1 -1
- data/templates/plugins/android/plugin-metadata.json.erb +7 -0
- data/templates/plugins/android/src/main/{AndroidManifest.xml.tpl → AndroidManifest.xml.erb} +2 -2
- data/templates/plugins/android/src/main/java/io/gonative/android/plugins/JAVA_PACKAGE/{PLUGIN_NAME.java.tpl → PLUGIN_NAME.java.erb} +3 -3
- data/templates/plugins/ios/common/Package.swift.erb +28 -0
- data/templates/plugins/ios/common/Project.swift.erb +44 -0
- data/templates/plugins/ios/common/Resources/polyfill.js.erb +10 -0
- data/templates/plugins/ios/common/VERSION +1 -0
- data/templates/plugins/ios/common/Wrappers/dummy.m +1 -0
- data/templates/plugins/ios/common/Wrappers/include/dummy.h +1 -0
- data/templates/plugins/ios/language-specific/objc/{PLUGIN_NAME/Classes/GNPLUGIN_NAME.h.tpl → Classes/GNPLUGIN_NAME.h.erb} +4 -4
- data/templates/plugins/ios/language-specific/objc/Classes/GNPLUGIN_NAME.m.erb +14 -0
- data/templates/plugins/ios/language-specific/objc/Project.swift.erb +44 -0
- data/templates/plugins/ios/language-specific/swift/Classes/GNSwiftModule.m.erb +12 -0
- data/templates/plugins/ios/language-specific/swift/Classes/GNSwiftModule.swift.erb +14 -0
- data/templates/plugins/ios/language-specific/swift/Project.swift.erb +43 -0
- metadata +22 -25
- data/lib/gonative/utils/content_evaluator.rb +0 -16
- data/templates/build/ios/Info.plist +0 -28
- data/templates/build/ios/PLUGIN_NAME-umbrella.h.tpl +0 -16
- data/templates/build/ios/PLUGIN_NAME.modulemap.tpl +0 -6
- data/templates/build/ios/Podfile.tpl +0 -10
- data/templates/build/ios/create-framework.sh.tpl +0 -36
- data/templates/plugins/android/plugin-metadata.json.tpl +0 -7
- data/templates/plugins/ios/common/PLUGIN_NAME/Classes/Dummy.swift +0 -6
- data/templates/plugins/ios/common/PLUGIN_NAME/Resources/polyfill.js.tpl +0 -0
- data/templates/plugins/ios/common/PLUGIN_NAME.podspec.tpl +0 -30
- data/templates/plugins/ios/language-specific/objc/PLUGIN_NAME/Classes/GNPLUGIN_NAME.m.tpl +0 -14
- data/templates/plugins/ios/language-specific/swift/PLUGIN_NAME/Classes/GNSwiftModule.m.tpl +0 -12
- data/templates/plugins/ios/language-specific/swift/PLUGIN_NAME/Classes/GNSwiftModule.swift.tpl +0 -14
- /data/templates/plugins/ios/common/{PLUGIN_NAME/Frameworks → Frameworks}/.keep +0 -0
- /data/templates/plugins/ios/common/{PLUGIN_NAME/Info.plist → Info.plist} +0 -0
- /data/templates/plugins/ios/common/{PLUGIN_NAME/LICENSE → LICENSE} +0 -0
|
@@ -1,53 +1,191 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require '
|
|
3
|
+
require 'aws-sdk-s3'
|
|
4
|
+
require 'digest'
|
|
5
|
+
require 'json'
|
|
6
|
+
require 'net/http'
|
|
7
|
+
require 'shellwords'
|
|
4
8
|
|
|
5
9
|
module GoNative
|
|
6
10
|
module Plugins
|
|
7
11
|
module IOS
|
|
8
12
|
class Release
|
|
9
|
-
|
|
13
|
+
autoload :FileUtils, 'fileutils'
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
extend DSL::Serviceable
|
|
12
16
|
|
|
13
|
-
attr_reader :
|
|
17
|
+
attr_reader :version, :scope, :registry_url, :project_root
|
|
14
18
|
|
|
15
|
-
def initialize(
|
|
16
|
-
@
|
|
17
|
-
@
|
|
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)
|
|
18
24
|
end
|
|
19
25
|
|
|
20
26
|
def call
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
assert_not_published!
|
|
28
|
+
zip_frameworks!
|
|
29
|
+
upload_frameworks!
|
|
30
|
+
publish_to_registry!
|
|
31
|
+
ensure
|
|
32
|
+
cleanup!
|
|
25
33
|
end
|
|
26
34
|
|
|
27
35
|
private
|
|
28
36
|
|
|
29
|
-
def
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
42
|
+
|
|
43
|
+
match[1]
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
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')
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def extensions_dir
|
|
68
|
+
File.join(project_root, 'Extensions')
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def zips_dir
|
|
72
|
+
File.join(project_root, '.build', 'zips')
|
|
73
|
+
end
|
|
74
|
+
|
|
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
|
|
32
93
|
|
|
33
|
-
|
|
94
|
+
# Compute hash-based filename
|
|
95
|
+
checksum = Digest::SHA256.file(temp_zip).hexdigest
|
|
96
|
+
hash = checksum[0..7]
|
|
97
|
+
final_name = "#{name}-#{hash}.zip"
|
|
34
98
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def upload_frameworks!
|
|
110
|
+
s3 = Aws::S3::Client.new(
|
|
111
|
+
region: ENV['S3_REGION'],
|
|
112
|
+
access_key_id: ENV['ACCESS_KEY_ID'],
|
|
113
|
+
secret_access_key: ENV['SECRET_ACCESS_KEY']
|
|
114
|
+
)
|
|
115
|
+
|
|
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])
|
|
38
145
|
end
|
|
146
|
+
|
|
147
|
+
File.write(package_swift_path, content)
|
|
39
148
|
end
|
|
40
149
|
|
|
41
|
-
|
|
42
|
-
|
|
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
|
|
43
158
|
end
|
|
44
159
|
|
|
45
|
-
def
|
|
46
|
-
|
|
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
|
|
47
184
|
end
|
|
48
185
|
|
|
49
|
-
def
|
|
50
|
-
|
|
186
|
+
def cleanup!
|
|
187
|
+
FileUtils.rm_rf(File.join(project_root, '.build', 'zips'))
|
|
188
|
+
FileUtils.rm_rf(File.join(project_root, '.build', 'publish'))
|
|
51
189
|
end
|
|
52
190
|
end
|
|
53
191
|
end
|
|
@@ -7,13 +7,7 @@ module GoNative
|
|
|
7
7
|
extend DSL::Serviceable
|
|
8
8
|
|
|
9
9
|
def call
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
end
|
|
15
|
+
version = File.read(path).strip
|
|
16
|
+
raise Error, 'VERSION file is empty' if version.empty?
|
|
16
17
|
|
|
17
|
-
|
|
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
|
-
|
|
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)
|
data/lib/gonative/utils.rb
CHANGED
data/lib/gonative/version.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package io.gonative.android.plugins
|
|
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
|
|
10
|
-
private final static String TAG =
|
|
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 @@
|
|
|
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
|
|
3
|
-
//
|
|
2
|
+
// GN<%= plugin_name %>.h
|
|
3
|
+
// <%= plugin_name %>
|
|
4
4
|
//
|
|
5
|
-
// Created by
|
|
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
|
|
13
|
+
@interface GN<%= plugin_name %> : GNEventEmitter
|
|
14
14
|
|
|
15
15
|
@end
|
|
16
16
|
|
|
@@ -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,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
|
+
)
|