gonative-cli 0.5.0 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb6548942f64dc18c96d0468c4073592bb6e894c2fb0e76f564e6d5e8cb6b88e
4
- data.tar.gz: 163fd2f3918cff7e0433beb1330abcc9bfa44f943a4574942b50a77178cd61db
3
+ metadata.gz: 78bc2e39f0e47add3dc19a36627177d195e16d6d7d26b3a43eb6113756177550
4
+ data.tar.gz: b7ab3025bc73a810bf3926028617235faf394916e65a7a9d005c3680d14f4637
5
5
  SHA512:
6
- metadata.gz: bbcd4a57a19c23c90007da2687d45e1cd226f55f99aba8d6c8875dbf54431d5d919d5ed731cf6b8154f76cc8559bbdba7db957047611d3cf732c4c7824fc7cac
7
- data.tar.gz: 360016fa4b68fc7672adc8e516ed102595c4ef272567b8b53b7df6ba50e72bfc72d835c0ca69689c96cc2d2b990cff96e12afbef136ed895ac759cab38d511c7
6
+ metadata.gz: edc83d42ec4523aa47f7eef8f69590b705cb9e6b549a65e8fc9506cef199861d84df26375897c5f37c616ded20f2e4d46b9c9173d7cf00b11dc81073b0b2a200
7
+ data.tar.gz: 98ea6a626bfae04fbf99a0a88466d47fdda946a55cccf0f10f60e2c44ac78246956789e9333b9fb786e5a132fde9a7fd5d765361497069e094190e1a4c0a4b73
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gonative-cli (0.4.5)
4
+ gonative-cli (0.5.3)
5
+ activesupport (~> 6.0)
5
6
  cocoapods (~> 1.10)
6
7
  colorize (~> 0.8.0)
7
8
  dry-cli (~> 0.7)
data/README.md CHANGED
@@ -1,22 +1,23 @@
1
1
  # Gonative::Cli
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/gonative/cli`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ This cli is a tool to create/publish new plugins for GoNative apps.
6
4
 
7
5
  ## Installation
8
6
 
9
- Add this line to your application's Gemfile:
7
+ This gem has a minimum Ruby version requirement which is 2.7.0+ macOS comes with Ruby 2.6 and so built-in Ruby cannot be used for this gem.
8
+
9
+ ### Homebrew
10
10
 
11
- ```ruby
12
- gem 'gonative-cli'
13
- ```
11
+ You can install newer versions of Ruby using homebrew by using
12
+
13
+ $ brew install ruby
14
+ $ echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshrc
14
15
 
15
- And then execute:
16
+ After that you will need to restart the terminal application for changes to take effect.
16
17
 
17
- $ bundle install
18
+ Confirm the installation by running `ruby -v`
18
19
 
19
- Or install it yourself as:
20
+ Install the gem now using:
20
21
 
21
22
  $ gem install gonative-cli
22
23
 
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'
@@ -4,10 +4,12 @@ module GoNative
4
4
  module Commands
5
5
  module IOS
6
6
  class Publish < Base
7
- desc 'Publish a new version'
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::Publish.call
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
@@ -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
@@ -94,7 +95,11 @@ module GoNative
94
95
  end
95
96
 
96
97
  def contents(file)
97
- 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-'
98
103
  end
99
104
  end
100
105
  end
@@ -5,21 +5,22 @@ require 'cocoapods'
5
5
  module GoNative
6
6
  module Plugins
7
7
  module IOS
8
- class Publish
9
- module Release
10
- GONATIVE_SOURCE_NAME = 'gonative-specs'.freeze
11
-
12
- def release_pod!
13
- Utils::UI.info 'Linting and releasing pod'
14
- assert_spec_exists!
15
- sources_manager.update(GONATIVE_SOURCE_NAME)
16
- assert_not_pushed!
17
- create_and_push_tag!
18
- push_to_pod_repo!
19
- end
20
-
21
- private
22
-
8
+ class Release
9
+ extend DSL::Serviceable
10
+
11
+ GONATIVE_SOURCE_NAME = 'gonative-specs'.freeze
12
+
13
+ def call
14
+ Utils::UI.info 'Linting and releasing pod'
15
+ assert_spec_exists!
16
+ sources_manager.update(GONATIVE_SOURCE_NAME)
17
+ assert_not_pushed!
18
+ create_and_push_tag!
19
+ push_to_pod_repo!
20
+ end
21
+
22
+ private
23
+
23
24
  def assert_spec_exists!
24
25
  return if spec_name
25
26
 
@@ -62,7 +63,6 @@ module GoNative
62
63
  def sources_manager
63
64
  Pod::Config.instance.sources_manager
64
65
  end
65
- end
66
66
  end
67
67
  end
68
68
  end
@@ -3,15 +3,13 @@
3
3
  module GoNative
4
4
  module Plugins
5
5
  module IOS
6
- class Publish
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!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GoNative
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.5"
5
5
  end
@@ -10,19 +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/{{PLUGIN_NAME}}.git', :tag => s.version.to_s }
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
19
  cs.source_files = '{{PLUGIN_NAME}}/Classes/**/*.{h,m,swift}'
20
- cs.resource_bundle = { 'JS' => 'js/*.{js}' }
20
+ cs.resource_bundle = { 'JS' => 'js/*.{js,json}' }
21
21
  end
22
22
 
23
23
  s.subspec 'Binary' do |cs|
24
24
  cs.ios.vendored_frameworks = 'XCFramework/{{PLUGIN_NAME}}.xcframework'
25
- cs.resource_bundle = { 'JS' => 'js/*.{js}' }
25
+ cs.resource_bundle = { 'JS' => 'js/*.{js,json}' }
26
26
  end
27
27
 
28
28
  s.default_subspec = 'Source'
@@ -3,7 +3,6 @@ platform :ios, '10.0'
3
3
  source 'https://cdn.cocoapods.org/'
4
4
  source 'git@github.com:gonativeio/gonative-specs.git'
5
5
 
6
-
7
6
  target '{{PLUGIN_NAME}}Framework' do
8
7
  use_frameworks!
9
8
  pod '{{PLUGIN_NAME}}', path: '.'
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.5.0
4
+ version: 0.5.5
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-09-28 00:00:00.000000000 Z
11
+ date: 2021-10-12 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
@@ -181,8 +195,8 @@ files:
181
195
  - lib/gonative/dsl/serviceable.rb
182
196
  - lib/gonative/plugins.rb
183
197
  - lib/gonative/plugins/ios/create.rb
184
- - lib/gonative/plugins/ios/publish.rb
185
- - lib/gonative/plugins/ios/publish/release.rb
198
+ - lib/gonative/plugins/ios/release.rb
199
+ - lib/gonative/plugins/ios/verify.rb
186
200
  - lib/gonative/utils/template_inflator.rb
187
201
  - lib/gonative/utils/ui.rb
188
202
  - lib/gonative/version.rb
@@ -192,6 +206,7 @@ files:
192
206
  - templates/plugins/ios/common/PLUGIN_NAME/Info.plist
193
207
  - templates/plugins/ios/common/Podfile.tpl
194
208
  - templates/plugins/ios/common/create-framework.sh.tpl
209
+ - templates/plugins/ios/common/js/info.plist.json.tpl
195
210
  - templates/plugins/ios/common/js/polyfill.js.tpl
196
211
  - templates/plugins/ios/language-specific/objc/PLUGIN_NAME/Classes/GNPLUGIN_NAME.h.tpl
197
212
  - templates/plugins/ios/language-specific/objc/PLUGIN_NAME/Classes/GNPLUGIN_NAME.m.tpl