gonative-cli 0.1.0 → 0.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2663848bf1f2a69d93a5c24fced1c78012e8f406607bc7066f7193ac0f5af91
4
- data.tar.gz: 6e443dcbfbfcc891dbf52d38d149c701494ae05f9a8c83fe0b93c87275e66e9e
3
+ metadata.gz: 4d2deeca61426ae85c2bdc6fbbf17cdcbf9c24e0ef0fdd53693ecc04cc8ead11
4
+ data.tar.gz: 0f8fa560093401a7f9e8bb8ba51d212ce118d0d49cd93c24540ffea45a8d8fec
5
5
  SHA512:
6
- metadata.gz: 4cf523cb8f7071f1a92c742e0df7bc0b7bd786e478f38c99a6f8def717e96b50a67cbd6d3d7bc9e538ac450f2b381c61ffdd847543224fe1698a2013742ea182
7
- data.tar.gz: 77dfb8932b1e9ff5cd63963d16279162e67601650af3cf140a28be597185b9e357e264940b0530a7e4ebe142780625db4fd618bfb0ead4582711b217787923cb
6
+ metadata.gz: a0d269e6ae5ffae5da6c39563f20868ed79532683457805ab7483443aa8e4d1efcb724886c5bf5d393a87b8d7df31d8e1685984b9e9a60134d5c886a58cd9210
7
+ data.tar.gz: d1cb1ec74d7c03bfb7ac0d2c870aa7fa8a47ee0b1b40d1b5d81c474d26eede9d11a9ed0b3e20c1572a5253aa3b4be3c020e9b45d112eb622a68882063765aee1
@@ -0,0 +1,29 @@
1
+ Pod::Spec.new do |s|
2
+ s.name = 'FacebookPlugin'
3
+ s.version = '1.0.0'
4
+ s.summary = 'Facebook plugin for GoNative.'
5
+
6
+ s.description = <<-DESC
7
+ TODO: Add long description of the pod here.
8
+ DESC
9
+
10
+ s.homepage = 'https://github.com/gonativeio/FacebookPlugin'
11
+ s.license = { :type => 'MIT', :file => 'LICENSE' }
12
+ s.author = { 'hhunaid' => 'hhunaid@gmail.com' }
13
+ s.source = { :git => 'https://github.com/gonativeio/FacebookPlugin.git', :tag => s.version.to_s }
14
+
15
+ s.ios.deployment_target = '10.0'
16
+ s.swift_versions = '5.0'
17
+
18
+ s.subspec 'Source' do |cs|
19
+ cs.source_files = 'FacebookPlugin/Classes/**/*'
20
+ end
21
+
22
+ s.subspec 'Binary' do |cs|
23
+ cs.ios.vendored_frameworks = 'XCFramework/FacebookPlugin.xcframework'
24
+ end
25
+
26
+ s.default_subspec = 'Source'
27
+ s.dependency 'FBSDKCoreKit', '~> 9.1.0'
28
+ s.dependency 'GoNativeCore'
29
+ end
data/Gemfile.lock CHANGED
@@ -1,7 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gonative-cli (0.1.0)
4
+ gonative-cli (0.4.0)
5
+ cocoapods (~> 1.10)
6
+ colorize
5
7
  dry-cli (~> 0.7)
6
8
  xcodeproj (~> 1.20)
7
9
  zeitwerk (~> 2.4)
@@ -10,16 +12,80 @@ GEM
10
12
  remote: https://rubygems.org/
11
13
  specs:
12
14
  CFPropertyList (3.0.3)
15
+ activesupport (5.2.6)
16
+ concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ i18n (>= 0.7, < 2)
18
+ minitest (~> 5.1)
19
+ tzinfo (~> 1.1)
20
+ addressable (2.8.0)
21
+ public_suffix (>= 2.0.2, < 5.0)
22
+ algoliasearch (1.27.5)
23
+ httpclient (~> 2.8, >= 2.8.3)
24
+ json (>= 1.5.1)
13
25
  ast (2.4.2)
14
26
  atomos (0.1.3)
15
27
  byebug (11.1.3)
16
28
  claide (1.0.3)
29
+ cocoapods (1.10.2)
30
+ addressable (~> 2.6)
31
+ claide (>= 1.0.2, < 2.0)
32
+ cocoapods-core (= 1.10.2)
33
+ cocoapods-deintegrate (>= 1.0.3, < 2.0)
34
+ cocoapods-downloader (>= 1.4.0, < 2.0)
35
+ cocoapods-plugins (>= 1.0.0, < 2.0)
36
+ cocoapods-search (>= 1.0.0, < 2.0)
37
+ cocoapods-trunk (>= 1.4.0, < 2.0)
38
+ cocoapods-try (>= 1.1.0, < 2.0)
39
+ colored2 (~> 3.1)
40
+ escape (~> 0.0.4)
41
+ fourflusher (>= 2.3.0, < 3.0)
42
+ gh_inspector (~> 1.0)
43
+ molinillo (~> 0.6.6)
44
+ nap (~> 1.0)
45
+ ruby-macho (~> 1.4)
46
+ xcodeproj (>= 1.19.0, < 2.0)
47
+ cocoapods-core (1.10.2)
48
+ activesupport (> 5.0, < 6)
49
+ addressable (~> 2.6)
50
+ algoliasearch (~> 1.0)
51
+ concurrent-ruby (~> 1.1)
52
+ fuzzy_match (~> 2.0.4)
53
+ nap (~> 1.0)
54
+ netrc (~> 0.11)
55
+ public_suffix
56
+ typhoeus (~> 1.0)
57
+ cocoapods-deintegrate (1.0.4)
58
+ cocoapods-downloader (1.4.0)
59
+ cocoapods-plugins (1.0.0)
60
+ nap
61
+ cocoapods-search (1.0.0)
62
+ cocoapods-trunk (1.5.0)
63
+ nap (>= 0.8, < 2.0)
64
+ netrc (~> 0.11)
65
+ cocoapods-try (1.2.0)
17
66
  coderay (1.1.3)
18
67
  colored2 (3.1.2)
68
+ colorize (0.8.1)
69
+ concurrent-ruby (1.1.9)
19
70
  diff-lcs (1.4.4)
20
71
  dry-cli (0.7.0)
72
+ escape (0.0.4)
73
+ ethon (0.14.0)
74
+ ffi (>= 1.15.0)
75
+ ffi (1.15.3)
76
+ fourflusher (2.3.1)
77
+ fuzzy_match (2.0.4)
78
+ gh_inspector (1.1.3)
79
+ httpclient (2.8.3)
80
+ i18n (1.8.10)
81
+ concurrent-ruby (~> 1.0)
82
+ json (2.5.1)
21
83
  method_source (1.0.0)
84
+ minitest (5.14.4)
85
+ molinillo (0.6.6)
22
86
  nanaimo (0.3.0)
87
+ nap (1.1.0)
88
+ netrc (0.11.0)
23
89
  parallel (1.20.1)
24
90
  parser (3.0.2.0)
25
91
  ast (~> 2.4.1)
@@ -29,6 +95,7 @@ GEM
29
95
  pry-byebug (3.9.0)
30
96
  byebug (~> 11.0)
31
97
  pry (~> 0.13.0)
98
+ public_suffix (4.0.6)
32
99
  rainbow (3.0.0)
33
100
  rake (13.0.6)
34
101
  regexp_parser (2.1.1)
@@ -60,7 +127,13 @@ GEM
60
127
  rubocop-performance (1.11.4)
61
128
  rubocop (>= 1.7.0, < 2.0)
62
129
  rubocop-ast (>= 0.4.0)
130
+ ruby-macho (1.4.0)
63
131
  ruby-progressbar (1.11.0)
132
+ thread_safe (0.3.6)
133
+ typhoeus (1.4.0)
134
+ ethon (>= 0.9.0)
135
+ tzinfo (1.2.9)
136
+ thread_safe (~> 0.1)
64
137
  unicode-display_width (2.0.0)
65
138
  xcodeproj (1.20.0)
66
139
  CFPropertyList (>= 2.3.3, < 4.0)
data/gonative-cli.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = "Create and manage gonative plugin projects using cli."
13
13
  spec.homepage = "https://www.github.com/gonativeio/gonative-cli"
14
14
  spec.license = "MIT"
15
- spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
15
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
16
16
 
17
17
  spec.metadata["homepage_uri"] = spec.homepage
18
18
  spec.metadata["source_code_uri"] = "https://www.github.com/gonativeio/gonative-cli"
@@ -29,7 +29,9 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  spec.add_dependency 'dry-cli', '~> 0.7'
31
31
  spec.add_dependency 'zeitwerk', '~> 2.4'
32
+ spec.add_dependency 'cocoapods', '~> 1.10'
32
33
  spec.add_dependency 'xcodeproj', '~> 1.20'
34
+ spec.add_dependency 'colorize'
33
35
 
34
36
  spec.add_development_dependency 'rspec', '~> 3.10'
35
37
  spec.add_development_dependency 'pry-byebug', '~> 3.9'
data/lib/gonative.rb CHANGED
@@ -7,6 +7,7 @@ Zeitwerk::Loader.for_gem.tap do |loader|
7
7
  loader.inflector.inflect 'gonative' => 'GoNative'
8
8
  loader.inflector.inflect 'dsl' => 'DSL'
9
9
  loader.inflector.inflect 'ios' => 'IOS'
10
+ loader.inflector.inflect 'ui' => 'UI'
10
11
  loader.setup
11
12
  end
12
13
 
@@ -5,6 +5,7 @@ module GoNative
5
5
  extend Dry::CLI::Registry
6
6
 
7
7
  register 'version', Version, aliases: %w[--version -v]
8
- register 'plugin ios', Plugin::IOS
8
+ register 'ios create', IOS::Create
9
+ register 'ios publish', IOS::Publish
9
10
  end
10
11
  end
@@ -2,16 +2,16 @@
2
2
 
3
3
  module GoNative
4
4
  module Commands
5
- module Plugin
6
- class IOS < Base
7
- desc 'Create a new app'
8
-
5
+ module IOS
6
+ class Create < Base
7
+ desc 'Create a new plugin'
8
+
9
9
  argument :name, required: true, desc: 'Name of the plugin'
10
-
10
+
11
11
  def call(name:, **)
12
12
  Plugins::IOS::Create.call(name)
13
13
  end
14
14
  end
15
15
  end
16
16
  end
17
- end
17
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GoNative
4
+ module Commands
5
+ module IOS
6
+ class Publish < Base
7
+ desc 'Publish a new version'
8
+
9
+ def call
10
+ Plugins::IOS::Publish.call
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'xcodeproj'
3
- require 'pry'
4
4
 
5
5
  module GoNative
6
6
  module Plugins
@@ -23,7 +23,9 @@ module GoNative
23
23
  set_working_dir!
24
24
  cp_template_files!
25
25
  inflate_templates!
26
+ chmod_frameworks_script!
26
27
  create_framework_proj!
28
+ run_pod_install!
27
29
  end
28
30
 
29
31
  def assert_not_exists!
@@ -53,6 +55,10 @@ module GoNative
53
55
  inflate_files
54
56
  end
55
57
 
58
+ def chmod_frameworks_script!
59
+ FileUtils.chmod 0755, 'create-framework.sh'
60
+ end
61
+
56
62
  def create_framework_proj!
57
63
  proj = Xcodeproj::Project.new(FileUtils.pwd)
58
64
  target = proj.new_target(:framework, "#{plugin_name}Framework", :ios, '10.0')
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GoNative
4
+ module Plugins
5
+ module IOS
6
+ class Publish
7
+ extend DSL::Serviceable
8
+ include Release
9
+
10
+ def call
11
+ assert_valid_plugin!
12
+ assert_staging_clear!
13
+ build_framework!
14
+ release_pod!
15
+ end
16
+
17
+ def assert_valid_plugin!
18
+ return if File.file?('create-framework.sh')
19
+
20
+ raise Error, "File 'create-framework.sh' does not exist. Please make sure this is a valid GoNative plugin directory"
21
+ end
22
+
23
+ def assert_staging_clear!
24
+ return if `git status --porcelain`.empty?
25
+
26
+ raise Error, "There are uncommitted changes in the repository"
27
+ end
28
+
29
+ def build_framework!
30
+ Utils::UI.info 'Building framework'
31
+ return if system('sh create-framework.sh >/dev/null 2>/dev/null')
32
+
33
+ raise Error, "Error building framework. Please run the create-framework file manually to fix any errors"
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cocoapods'
4
+
5
+ module GoNative
6
+ module Plugins
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
+ verify_lib!
18
+ create_and_push_tag!
19
+ push_to_pod_repo!
20
+ end
21
+
22
+ private
23
+
24
+ def assert_spec_exists!
25
+ return if spec_name
26
+
27
+ raise Error, "No podspec file exists"
28
+ end
29
+
30
+ def assert_not_pushed!
31
+ version = spec.version
32
+ name = spec.name
33
+
34
+ pushed_versions = source.versions(name).collect(&:to_s)
35
+
36
+ raise Error, "#{name} (#{version}) has already been pushed to #{source.name}" if pushed_versions.include? version.to_s
37
+ end
38
+
39
+ def verify_lib!
40
+ raise Error, "pod lib lint failed" unless system("pod lib lint #{spec_name} --private")
41
+ end
42
+
43
+ def create_and_push_tag!
44
+ unless system("git tag | grep #{spec.version} > /dev/null")
45
+ system "git add -A && git commit -m \"Releases #{spec.version}.\""
46
+ system "git tag #{spec.version}"
47
+ system "git push && git push --tags"
48
+ end
49
+ end
50
+
51
+ def push_to_pod_repo!
52
+ system "pod repo push #{GONATIVE_SOURCE_NAME} #{spec_name} --private"
53
+ end
54
+
55
+ def spec_name
56
+ @spec_name ||= Dir.entries(".").select { |s| s.end_with? ".podspec" }.first
57
+ end
58
+
59
+ def spec
60
+ @spec ||= Pod::Specification.from_file(spec_name)
61
+ end
62
+
63
+ def source
64
+ @source ||= sources_manager.source_with_name_or_url(GONATIVE_SOURCE_NAME)
65
+ end
66
+
67
+ def sources_manager
68
+ Pod::Config.instance.sources_manager
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true\
2
+
3
+ require 'colorize'
4
+
5
+ module GoNative
6
+ module Utils
7
+ module UI
8
+ class << self
9
+ def info(msg)
10
+ puts msg.colorize(:green)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GoNative
4
- VERSION = "0.1.0"
4
+ VERSION = "0.4.1"
5
5
  end
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.1.0
4
+ version: 0.4.1
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-08-10 00:00:00.000000000 Z
11
+ date: 2021-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2.4'
41
+ - !ruby/object:Gem::Dependency
42
+ name: cocoapods
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.10'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.10'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: xcodeproj
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +66,20 @@ dependencies:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
68
  version: '1.20'
69
+ - !ruby/object:Gem::Dependency
70
+ name: colorize
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: rspec
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -134,6 +162,7 @@ files:
134
162
  - ".rspec"
135
163
  - ".rubocop.yml"
136
164
  - CODE_OF_CONDUCT.md
165
+ - FacebookPlugin.podspec
137
166
  - Gemfile
138
167
  - Gemfile.lock
139
168
  - LICENSE.txt
@@ -146,13 +175,17 @@ files:
146
175
  - lib/gonative.rb
147
176
  - lib/gonative/commands.rb
148
177
  - lib/gonative/commands/base.rb
149
- - lib/gonative/commands/plugin/ios.rb
178
+ - lib/gonative/commands/ios/create.rb
179
+ - lib/gonative/commands/ios/publish.rb
150
180
  - lib/gonative/commands/version.rb
151
181
  - lib/gonative/dsl/error_catchable.rb
152
182
  - lib/gonative/dsl/serviceable.rb
153
183
  - lib/gonative/plugins.rb
154
184
  - lib/gonative/plugins/ios/create.rb
185
+ - lib/gonative/plugins/ios/publish.rb
186
+ - lib/gonative/plugins/ios/publish/release.rb
155
187
  - lib/gonative/utils/template_inflator.rb
188
+ - lib/gonative/utils/ui.rb
156
189
  - lib/gonative/version.rb
157
190
  - templates/plugins/ios/.gitignore
158
191
  - templates/plugins/ios/LICENSE
@@ -178,7 +211,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
178
211
  requirements:
179
212
  - - ">="
180
213
  - !ruby/object:Gem::Version
181
- version: 2.6.0
214
+ version: 2.7.0
182
215
  required_rubygems_version: !ruby/object:Gem::Requirement
183
216
  requirements:
184
217
  - - ">="