gonative-cli 0.4.3 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +22 -21
- data/gonative-cli.gemspec +1 -0
- data/lib/gonative/commands/ios/create.rb +3 -2
- data/lib/gonative/commands/ios/publish.rb +5 -3
- data/lib/gonative/commands/ios/release.rb +0 -0
- data/lib/gonative/plugins/ios/create.rb +14 -4
- data/lib/gonative/plugins/ios/{publish/release.rb → release.rb} +18 -20
- data/lib/gonative/plugins/ios/{publish.rb → verify.rb} +1 -3
- data/lib/gonative/version.rb +1 -1
- data/templates/plugins/ios/{.gitignore → common/.gitignore} +0 -0
- data/templates/plugins/ios/{LICENSE → common/LICENSE} +0 -0
- data/templates/plugins/ios/{PLUGIN_NAME → common/PLUGIN_NAME}/Info.plist +0 -0
- data/templates/plugins/ios/{PLUGIN_NAME.podspec.tpl → common/PLUGIN_NAME.podspec.tpl} +4 -2
- data/templates/plugins/ios/{Podfile.tpl → common/Podfile.tpl} +1 -1
- data/templates/plugins/ios/{create-framework.sh.tpl → common/create-framework.sh.tpl} +0 -0
- data/templates/plugins/ios/common/js/polyfill.js.tpl +0 -0
- data/templates/plugins/ios/{PLUGIN_NAME → language-specific/objc/PLUGIN_NAME}/Classes/GNPLUGIN_NAME.h.tpl +1 -1
- data/templates/plugins/ios/{PLUGIN_NAME → language-specific/objc/PLUGIN_NAME}/Classes/GNPLUGIN_NAME.m.tpl +1 -1
- data/templates/plugins/ios/language-specific/swift/PLUGIN_NAME/Classes/GNSwiftModule.m.tpl +12 -0
- data/templates/plugins/ios/language-specific/swift/PLUGIN_NAME/Classes/GNSwiftModule.swift.tpl +14 -0
- metadata +30 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7f014a29a265e0718e44dca943691b7f3dae9b342ab512c0e1e7201fb298501
|
4
|
+
data.tar.gz: 90ad03cbdc87c2aaedf571d213a1ddce73fd3308d76e0588f0431e71650ba5d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a5bb74b4107fe12f04cddaff523dc83f83944a94a9865088cfb292689852c193f520c84ecffe28ad6b292e66bd2add6ee81e04a81080c92321e547f6ece57ac
|
7
|
+
data.tar.gz: b6890ee87cd88145fe1d76f9ad46be36f85d48993266c0e3e8e77cd695b1c05c19d4a05f11acf6282f1b802b11c6fcd9eaedf00a18f8b13b6b416023245576c6
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gonative-cli (0.
|
4
|
+
gonative-cli (0.5.1)
|
5
|
+
activesupport (~> 6.0)
|
5
6
|
cocoapods (~> 1.10)
|
6
|
-
colorize
|
7
|
+
colorize (~> 0.8.0)
|
7
8
|
dry-cli (~> 0.7)
|
8
9
|
xcodeproj (~> 1.20)
|
9
10
|
zeitwerk (~> 2.4)
|
@@ -12,11 +13,12 @@ GEM
|
|
12
13
|
remote: https://rubygems.org/
|
13
14
|
specs:
|
14
15
|
CFPropertyList (3.0.3)
|
15
|
-
activesupport (
|
16
|
+
activesupport (6.1.3)
|
16
17
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
|
-
i18n (>=
|
18
|
-
minitest (
|
19
|
-
tzinfo (~>
|
18
|
+
i18n (>= 1.6, < 2)
|
19
|
+
minitest (>= 5.1)
|
20
|
+
tzinfo (~> 2.0)
|
21
|
+
zeitwerk (~> 2.3)
|
20
22
|
addressable (2.8.0)
|
21
23
|
public_suffix (>= 2.0.2, < 5.0)
|
22
24
|
algoliasearch (1.27.5)
|
@@ -26,10 +28,10 @@ GEM
|
|
26
28
|
atomos (0.1.3)
|
27
29
|
byebug (11.1.3)
|
28
30
|
claide (1.0.3)
|
29
|
-
cocoapods (1.
|
30
|
-
addressable (~> 2.
|
31
|
+
cocoapods (1.11.2)
|
32
|
+
addressable (~> 2.8)
|
31
33
|
claide (>= 1.0.2, < 2.0)
|
32
|
-
cocoapods-core (= 1.
|
34
|
+
cocoapods-core (= 1.11.2)
|
33
35
|
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
34
36
|
cocoapods-downloader (>= 1.4.0, < 2.0)
|
35
37
|
cocoapods-plugins (>= 1.0.0, < 2.0)
|
@@ -40,19 +42,19 @@ GEM
|
|
40
42
|
escape (~> 0.0.4)
|
41
43
|
fourflusher (>= 2.3.0, < 3.0)
|
42
44
|
gh_inspector (~> 1.0)
|
43
|
-
molinillo (~> 0.
|
45
|
+
molinillo (~> 0.8.0)
|
44
46
|
nap (~> 1.0)
|
45
|
-
ruby-macho (
|
46
|
-
xcodeproj (>= 1.
|
47
|
-
cocoapods-core (1.
|
48
|
-
activesupport (
|
49
|
-
addressable (~> 2.
|
47
|
+
ruby-macho (>= 1.0, < 3.0)
|
48
|
+
xcodeproj (>= 1.21.0, < 2.0)
|
49
|
+
cocoapods-core (1.11.2)
|
50
|
+
activesupport (>= 5.0, < 7)
|
51
|
+
addressable (~> 2.8)
|
50
52
|
algoliasearch (~> 1.0)
|
51
53
|
concurrent-ruby (~> 1.1)
|
52
54
|
fuzzy_match (~> 2.0.4)
|
53
55
|
nap (~> 1.0)
|
54
56
|
netrc (~> 0.11)
|
55
|
-
public_suffix
|
57
|
+
public_suffix (~> 4.0)
|
56
58
|
typhoeus (~> 1.0)
|
57
59
|
cocoapods-deintegrate (1.0.4)
|
58
60
|
cocoapods-downloader (1.4.0)
|
@@ -82,7 +84,7 @@ GEM
|
|
82
84
|
json (2.5.1)
|
83
85
|
method_source (1.0.0)
|
84
86
|
minitest (5.14.4)
|
85
|
-
molinillo (0.
|
87
|
+
molinillo (0.8.0)
|
86
88
|
nanaimo (0.3.0)
|
87
89
|
nap (1.1.0)
|
88
90
|
netrc (0.11.0)
|
@@ -129,13 +131,12 @@ GEM
|
|
129
131
|
rubocop-ast (>= 0.4.0)
|
130
132
|
ruby-macho (1.4.0)
|
131
133
|
ruby-progressbar (1.11.0)
|
132
|
-
thread_safe (0.3.6)
|
133
134
|
typhoeus (1.4.0)
|
134
135
|
ethon (>= 0.9.0)
|
135
|
-
tzinfo (
|
136
|
-
|
136
|
+
tzinfo (2.0.4)
|
137
|
+
concurrent-ruby (~> 1.0)
|
137
138
|
unicode-display_width (2.0.0)
|
138
|
-
xcodeproj (1.
|
139
|
+
xcodeproj (1.21.0)
|
139
140
|
CFPropertyList (>= 2.3.3, < 4.0)
|
140
141
|
atomos (~> 0.1.3)
|
141
142
|
claide (>= 1.0.2, < 2.0)
|
data/gonative-cli.gemspec
CHANGED
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_dependency 'cocoapods', '~> 1.10'
|
33
33
|
spec.add_dependency 'xcodeproj', '~> 1.20'
|
34
34
|
spec.add_dependency 'colorize', '~> 0.8.0'
|
35
|
+
spec.add_dependency 'activesupport', '~> 6.0'
|
35
36
|
|
36
37
|
spec.add_development_dependency 'rspec', '~> 3.10'
|
37
38
|
spec.add_development_dependency 'pry-byebug', '~> 3.9'
|
@@ -7,9 +7,10 @@ module GoNative
|
|
7
7
|
desc 'Create a new plugin'
|
8
8
|
|
9
9
|
argument :name, required: true, desc: 'Name of the plugin'
|
10
|
+
option :language, default: "objc", values: Plugins::IOS::Create::LANGUAGES, desc: "Plugin's language"
|
10
11
|
|
11
|
-
def call(name:, **)
|
12
|
-
Plugins::IOS::Create.call(name)
|
12
|
+
def call(name:, language:, **)
|
13
|
+
Plugins::IOS::Create.call(name, language)
|
13
14
|
end
|
14
15
|
end
|
15
16
|
end
|
@@ -4,10 +4,12 @@ module GoNative
|
|
4
4
|
module Commands
|
5
5
|
module IOS
|
6
6
|
class Publish < Base
|
7
|
-
desc '
|
7
|
+
desc 'Verify, build and release a new version'
|
8
|
+
option :skip_build, type: :boolean, default: false
|
8
9
|
|
9
|
-
def call
|
10
|
-
Plugins::IOS::
|
10
|
+
def call(skip_build:, **)
|
11
|
+
Plugins::IOS::Verify.call unless skip_build
|
12
|
+
Plugins::IOS::Release.call
|
11
13
|
end
|
12
14
|
end
|
13
15
|
end
|
File without changes
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'xcodeproj'
|
4
|
+
require 'active_support/core_ext/string/inflections'
|
4
5
|
|
5
6
|
module GoNative
|
6
7
|
module Plugins
|
@@ -11,11 +12,15 @@ module GoNative
|
|
11
12
|
extend DSL::Serviceable
|
12
13
|
|
13
14
|
TEMPLATE_DIRECTORY_PATH = File.expand_path(File.join(__dir__, '../../../..', 'templates', 'plugins', 'ios'))
|
15
|
+
COMMON_TEMPLATES_PATH = File.join(TEMPLATE_DIRECTORY_PATH, 'common')
|
14
16
|
|
15
|
-
|
17
|
+
LANGUAGES = %w[objc swift].freeze
|
16
18
|
|
17
|
-
|
19
|
+
attr_reader :plugin_name, :language
|
20
|
+
|
21
|
+
def initialize(plugin_name, language)
|
18
22
|
@plugin_name = plugin_name
|
23
|
+
@language = language
|
19
24
|
end
|
20
25
|
|
21
26
|
def call
|
@@ -40,7 +45,8 @@ module GoNative
|
|
40
45
|
end
|
41
46
|
|
42
47
|
def cp_template_files!
|
43
|
-
FileUtils.cp_r("#{
|
48
|
+
FileUtils.cp_r("#{COMMON_TEMPLATES_PATH}/.", '.')
|
49
|
+
system('ditto', File.join(TEMPLATE_DIRECTORY_PATH, 'language-specific', language), '.')
|
44
50
|
end
|
45
51
|
|
46
52
|
def inflate_templates!
|
@@ -89,7 +95,11 @@ module GoNative
|
|
89
95
|
end
|
90
96
|
|
91
97
|
def contents(file)
|
92
|
-
Utils::TemplateInflator.new(File.read(file)).call(PLUGIN_NAME: plugin_name)
|
98
|
+
Utils::TemplateInflator.new(File.read(file)).call(PLUGIN_NAME: plugin_name, REPO_NAME: repo_name)
|
99
|
+
end
|
100
|
+
|
101
|
+
def repo_name
|
102
|
+
plugin_name.underscore.dasherize.prepend 'ios-'
|
93
103
|
end
|
94
104
|
end
|
95
105
|
end
|
@@ -1,25 +1,24 @@
|
|
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
|
-
class
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
6
|
+
class Release
|
7
|
+
extend DSL::Serviceable
|
8
|
+
|
9
|
+
GONATIVE_SOURCE_NAME = 'gonative-specs'.freeze
|
10
|
+
|
11
|
+
def call
|
12
|
+
Utils::UI.info 'Linting and releasing pod'
|
13
|
+
assert_spec_exists!
|
14
|
+
sources_manager.update(GONATIVE_SOURCE_NAME)
|
15
|
+
assert_not_pushed!
|
16
|
+
create_and_push_tag!
|
17
|
+
push_to_pod_repo!
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
23
22
|
def assert_spec_exists!
|
24
23
|
return if spec_name
|
25
24
|
|
@@ -30,9 +29,9 @@ module GoNative
|
|
30
29
|
version = spec.version
|
31
30
|
name = spec.name
|
32
31
|
|
33
|
-
pushed_versions = source.versions(name)
|
32
|
+
pushed_versions = source.versions(name)&.collect(&:to_s)
|
34
33
|
|
35
|
-
raise Error, "#{name} (#{version}) has already been pushed to #{source.name}" if pushed_versions
|
34
|
+
raise Error, "#{name} (#{version}) has already been pushed to #{source.name}" if pushed_versions&.include? version.to_s
|
36
35
|
end
|
37
36
|
|
38
37
|
def create_and_push_tag!
|
@@ -62,7 +61,6 @@ module GoNative
|
|
62
61
|
def sources_manager
|
63
62
|
Pod::Config.instance.sources_manager
|
64
63
|
end
|
65
|
-
end
|
66
64
|
end
|
67
65
|
end
|
68
66
|
end
|
@@ -3,15 +3,13 @@
|
|
3
3
|
module GoNative
|
4
4
|
module Plugins
|
5
5
|
module IOS
|
6
|
-
class
|
6
|
+
class Verify
|
7
7
|
extend DSL::Serviceable
|
8
|
-
include Release
|
9
8
|
|
10
9
|
def call
|
11
10
|
assert_valid_plugin!
|
12
11
|
assert_staging_clear!
|
13
12
|
build_framework!
|
14
|
-
release_pod!
|
15
13
|
end
|
16
14
|
|
17
15
|
def assert_valid_plugin!
|
data/lib/gonative/version.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
@@ -10,17 +10,19 @@ TODO: Add long description of the pod here.
|
|
10
10
|
s.homepage = 'https://github.com/gonativeio/{{PLUGIN_NAME}}'
|
11
11
|
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
12
12
|
s.author = { 'hhunaid' => 'hhunaid@gmail.com' }
|
13
|
-
s.source = { :git => 'git@github.com:gonativeio/{{
|
13
|
+
s.source = { :git => 'git@github.com:gonativeio/{{REPO_NAME}}.git', :tag => s.version.to_s }
|
14
14
|
|
15
15
|
s.ios.deployment_target = '10.0'
|
16
16
|
s.swift_versions = '5.0'
|
17
17
|
|
18
18
|
s.subspec 'Source' do |cs|
|
19
|
-
cs.source_files = '{{PLUGIN_NAME}}/Classes
|
19
|
+
cs.source_files = '{{PLUGIN_NAME}}/Classes/**/*.{h,m,swift}'
|
20
|
+
cs.resource_bundle = { 'JS' => 'js/*.{js}' }
|
20
21
|
end
|
21
22
|
|
22
23
|
s.subspec 'Binary' do |cs|
|
23
24
|
cs.ios.vendored_frameworks = 'XCFramework/{{PLUGIN_NAME}}.xcframework'
|
25
|
+
cs.resource_bundle = { 'JS' => 'js/*.{js}' }
|
24
26
|
end
|
25
27
|
|
26
28
|
s.default_subspec = 'Source'
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gonative-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hunaid Hassan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-cli
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 0.8.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: activesupport
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '6.0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '6.0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: rspec
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -176,24 +190,28 @@ files:
|
|
176
190
|
- lib/gonative/commands/base.rb
|
177
191
|
- lib/gonative/commands/ios/create.rb
|
178
192
|
- lib/gonative/commands/ios/publish.rb
|
193
|
+
- lib/gonative/commands/ios/release.rb
|
179
194
|
- lib/gonative/commands/version.rb
|
180
195
|
- lib/gonative/dsl/error_catchable.rb
|
181
196
|
- lib/gonative/dsl/serviceable.rb
|
182
197
|
- lib/gonative/plugins.rb
|
183
198
|
- lib/gonative/plugins/ios/create.rb
|
184
|
-
- lib/gonative/plugins/ios/
|
185
|
-
- lib/gonative/plugins/ios/
|
199
|
+
- lib/gonative/plugins/ios/release.rb
|
200
|
+
- lib/gonative/plugins/ios/verify.rb
|
186
201
|
- lib/gonative/utils/template_inflator.rb
|
187
202
|
- lib/gonative/utils/ui.rb
|
188
203
|
- lib/gonative/version.rb
|
189
|
-
- templates/plugins/ios/.gitignore
|
190
|
-
- templates/plugins/ios/LICENSE
|
191
|
-
- templates/plugins/ios/PLUGIN_NAME.podspec.tpl
|
192
|
-
- templates/plugins/ios/PLUGIN_NAME/
|
193
|
-
- templates/plugins/ios/
|
194
|
-
- templates/plugins/ios/
|
195
|
-
- templates/plugins/ios/
|
196
|
-
- templates/plugins/ios/
|
204
|
+
- templates/plugins/ios/common/.gitignore
|
205
|
+
- templates/plugins/ios/common/LICENSE
|
206
|
+
- templates/plugins/ios/common/PLUGIN_NAME.podspec.tpl
|
207
|
+
- templates/plugins/ios/common/PLUGIN_NAME/Info.plist
|
208
|
+
- templates/plugins/ios/common/Podfile.tpl
|
209
|
+
- templates/plugins/ios/common/create-framework.sh.tpl
|
210
|
+
- templates/plugins/ios/common/js/polyfill.js.tpl
|
211
|
+
- templates/plugins/ios/language-specific/objc/PLUGIN_NAME/Classes/GNPLUGIN_NAME.h.tpl
|
212
|
+
- templates/plugins/ios/language-specific/objc/PLUGIN_NAME/Classes/GNPLUGIN_NAME.m.tpl
|
213
|
+
- templates/plugins/ios/language-specific/swift/PLUGIN_NAME/Classes/GNSwiftModule.m.tpl
|
214
|
+
- templates/plugins/ios/language-specific/swift/PLUGIN_NAME/Classes/GNSwiftModule.swift.tpl
|
197
215
|
homepage: https://www.github.com/gonativeio/gonative-cli
|
198
216
|
licenses:
|
199
217
|
- MIT
|