gonative-cli 0.3.0 → 0.4.2

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: 3083872f1c9594eb4960a669de5d2374e4911f6cba3cfa27d26e30edc3b1fa47
4
- data.tar.gz: 76ba3d5dc2220a237170f85ddffde6bce4c2d77499fca35d9b741e0d2c2bfa21
3
+ metadata.gz: 0ed6fc209dcb54b6ff39fa6d292fdcc47e0ec08c163977b035453910921a15d3
4
+ data.tar.gz: 94d5007ab0d24868898f0ab16c4b393efdfbb4b4baca121f924b422181ac0ee1
5
5
  SHA512:
6
- metadata.gz: fc86e31ccd7ec5f2dab9faad2b30aaf59bf405fd5a0dedaf05af5b50e2a53f0a93fa38d0a084df204c637b6a542ba6f11de34b70a07d54d0cc0927d28fd8cbc1
7
- data.tar.gz: d747a8dd31c174fc62c4ef1140d4a071389496e17844d3137a3409257eb14941cb23d32b729fbe0add4958ad5968457fc71e58d7bb75bed7f19b5ad6d481b371
6
+ metadata.gz: 6abf2f2e2dfaa049dbef91b2d1c84e5698b2ac93e161a9968f8c76643b376605c4b5187e60493ce56a9f833266d41765e4a9b4bb1d3410e073769627c9df7d67
7
+ data.tar.gz: c2aca1855f62cd0f63f695fe4c95fb2421a88e5b303b50427f19248828fdf68105865e07d0d10a3ee0075593941ad74673a173a66d2ad86fe01160dca603aa3a
@@ -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,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gonative-cli (0.2.0)
5
- cocoapods-release
4
+ gonative-cli (0.4.1)
5
+ cocoapods (~> 1.10)
6
6
  colorize
7
7
  dry-cli (~> 0.7)
8
8
  xcodeproj (~> 1.20)
@@ -12,18 +12,80 @@ GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
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)
15
25
  ast (2.4.2)
16
26
  atomos (0.1.3)
17
27
  byebug (11.1.3)
18
28
  claide (1.0.3)
19
- cocoapods-release (0.3.1)
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)
20
66
  coderay (1.1.3)
21
67
  colored2 (3.1.2)
22
68
  colorize (0.8.1)
69
+ concurrent-ruby (1.1.9)
23
70
  diff-lcs (1.4.4)
24
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)
25
83
  method_source (1.0.0)
84
+ minitest (5.14.4)
85
+ molinillo (0.6.6)
26
86
  nanaimo (0.3.0)
87
+ nap (1.1.0)
88
+ netrc (0.11.0)
27
89
  parallel (1.20.1)
28
90
  parser (3.0.2.0)
29
91
  ast (~> 2.4.1)
@@ -33,6 +95,7 @@ GEM
33
95
  pry-byebug (3.9.0)
34
96
  byebug (~> 11.0)
35
97
  pry (~> 0.13.0)
98
+ public_suffix (4.0.6)
36
99
  rainbow (3.0.0)
37
100
  rake (13.0.6)
38
101
  regexp_parser (2.1.1)
@@ -64,7 +127,13 @@ GEM
64
127
  rubocop-performance (1.11.4)
65
128
  rubocop (>= 1.7.0, < 2.0)
66
129
  rubocop-ast (>= 0.4.0)
130
+ ruby-macho (1.4.0)
67
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)
68
137
  unicode-display_width (2.0.0)
69
138
  xcodeproj (1.20.0)
70
139
  CFPropertyList (>= 2.3.3, < 4.0)
data/gonative-cli.gemspec CHANGED
@@ -29,8 +29,8 @@ 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'
33
- spec.add_dependency 'cocoapods-release'
34
34
  spec.add_dependency 'colorize'
35
35
 
36
36
  spec.add_development_dependency 'rspec', '~> 3.10'
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
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'xcodeproj'
3
4
 
4
5
  module GoNative
@@ -4,13 +4,13 @@ module GoNative
4
4
  module Plugins
5
5
  module IOS
6
6
  class Publish
7
- autoload :FileUtils, 'fileutils'
8
-
9
7
  extend DSL::Serviceable
10
-
11
-
8
+ include Release
9
+
12
10
  def call
13
11
  assert_valid_plugin!
12
+ assert_staging_clear!
13
+ build_framework!
14
14
  release_pod!
15
15
  end
16
16
 
@@ -20,14 +20,17 @@ module GoNative
20
20
  raise Error, "File 'create-framework.sh' does not exist. Please make sure this is a valid GoNative plugin directory"
21
21
  end
22
22
 
23
- def build_framework!
24
- puts 'Building framework'.colorize(:green)
25
- system('sh create-framework.sh')
23
+ def assert_staging_clear!
24
+ return if `git status --porcelain`.empty?
25
+
26
+ raise Error, "There are uncommitted changes in the repository"
26
27
  end
27
28
 
28
- def release_pod!
29
- puts 'Linting and releasing pod'.colorize(:green)
30
- system('pod release')
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"
31
34
  end
32
35
  end
33
36
  end
@@ -0,0 +1,69 @@
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
+ create_and_push_tag!
18
+ push_to_pod_repo!
19
+ end
20
+
21
+ private
22
+
23
+ def assert_spec_exists!
24
+ return if spec_name
25
+
26
+ raise Error, "No podspec file exists"
27
+ end
28
+
29
+ def assert_not_pushed!
30
+ version = spec.version
31
+ name = spec.name
32
+
33
+ pushed_versions = source.versions(name).collect(&:to_s)
34
+
35
+ raise Error, "#{name} (#{version}) has already been pushed to #{source.name}" if pushed_versions.include? version.to_s
36
+ end
37
+
38
+ def create_and_push_tag!
39
+ unless system("git tag | grep #{spec.version} > /dev/null")
40
+ system "git add -A && git commit -m \"Releases #{spec.version}.\""
41
+ system "git tag #{spec.version}"
42
+ system "git push && git push --tags"
43
+ end
44
+ end
45
+
46
+ def push_to_pod_repo!
47
+ system "pod repo push #{GONATIVE_SOURCE_NAME} #{spec_name} --private"
48
+ end
49
+
50
+ def spec_name
51
+ @spec_name ||= Dir.entries(".").select { |s| s.end_with? ".podspec" }.first
52
+ end
53
+
54
+ def spec
55
+ @spec ||= Pod::Specification.from_file(spec_name)
56
+ end
57
+
58
+ def source
59
+ @source ||= sources_manager.source_with_name_or_url(GONATIVE_SOURCE_NAME)
60
+ end
61
+
62
+ def sources_manager
63
+ Pod::Config.instance.sources_manager
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
69
+ 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.3.0"
4
+ VERSION = "0.4.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gonative-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hunaid Hassan
@@ -39,33 +39,33 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2.4'
41
41
  - !ruby/object:Gem::Dependency
42
- name: xcodeproj
42
+ name: cocoapods
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.20'
47
+ version: '1.10'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.20'
54
+ version: '1.10'
55
55
  - !ruby/object:Gem::Dependency
56
- name: cocoapods-release
56
+ name: xcodeproj
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '1.20'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '1.20'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: colorize
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -162,6 +162,7 @@ files:
162
162
  - ".rspec"
163
163
  - ".rubocop.yml"
164
164
  - CODE_OF_CONDUCT.md
165
+ - FacebookPlugin.podspec
165
166
  - Gemfile
166
167
  - Gemfile.lock
167
168
  - LICENSE.txt
@@ -182,7 +183,9 @@ files:
182
183
  - lib/gonative/plugins.rb
183
184
  - lib/gonative/plugins/ios/create.rb
184
185
  - lib/gonative/plugins/ios/publish.rb
186
+ - lib/gonative/plugins/ios/publish/release.rb
185
187
  - lib/gonative/utils/template_inflator.rb
188
+ - lib/gonative/utils/ui.rb
186
189
  - lib/gonative/version.rb
187
190
  - templates/plugins/ios/.gitignore
188
191
  - templates/plugins/ios/LICENSE