gonative-cli 0.3.1 → 0.4.3

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: 690305498ca8ab6181d0e80242d605e1b0e5973baa6a3fca46fe50b397dc1198
4
- data.tar.gz: dc5ed22127d3202d50fe568b566de50a18437b8824c69e89ccb97de6088b06e0
3
+ metadata.gz: d90f88288b08ceebc3697467d14f2f795c894ac3c2d119a55c33f11585ccf62f
4
+ data.tar.gz: 6535d61f19c52c1c4e6c3467015caf2acc2d2ab595540ff8c4837e04ee29b528
5
5
  SHA512:
6
- metadata.gz: d925ca5a5452a8e8f2ccbbf7d59afd6a69d098cfe3a64cceb03b497176c30725530ccb767b7d283efdbbff9542e3db894854c96232f765f6487aad0ffcf22211
7
- data.tar.gz: 71d61a4112ad9a67545f846071952b27f353b5d019b89c59ae08b73015f031ea8e27ae1ae6bd41df9df35a91ea11d25dcff27ab52b70d9d0c432c1ab9d6ee038
6
+ metadata.gz: 8365af89cbe8ca5543b0badad76e2cb905fe0e8c6ecb24bd95831a577aced6f92f3a03430f1d7b2240024e1c26747aabbe0f0ba93e764a43bee66e301a446d78
7
+ data.tar.gz: 73449adaedf999be05a081e8e35a0431cc3f3cf4812c3330bf6ad4c939240a1d029021ebbcd94083ff6cd7b2aa9923e2d3977c0314a07923eca1494819d981a6
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gonative-cli (0.3.0)
5
- cocoapods-release
4
+ gonative-cli (0.4.3)
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,9 +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'
33
- spec.add_dependency 'cocoapods-release'
34
- spec.add_dependency 'colorize'
34
+ spec.add_dependency 'colorize', '~> 0.8.0'
35
35
 
36
36
  spec.add_development_dependency 'rspec', '~> 3.10'
37
37
  spec.add_development_dependency 'pry-byebug', '~> 3.9'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'xcodeproj'
3
4
 
4
5
  module GoNative
@@ -4,13 +4,12 @@ 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!
14
13
  build_framework!
15
14
  release_pod!
16
15
  end
@@ -21,19 +20,18 @@ module GoNative
21
20
  raise Error, "File 'create-framework.sh' does not exist. Please make sure this is a valid GoNative plugin directory"
22
21
  end
23
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
+
24
29
  def build_framework!
25
30
  Utils::UI.info 'Building framework'
26
31
  return if system('sh create-framework.sh >/dev/null 2>/dev/null')
27
32
 
28
33
  raise Error, "Error building framework. Please run the create-framework file manually to fix any errors"
29
34
  end
30
-
31
- def release_pod!
32
- Utils::UI.info 'Linting and releasing pod'
33
- return if system('pod release')
34
-
35
- raise Error, "Failed to release pod"
36
- end
37
35
  end
38
36
  end
39
37
  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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GoNative
4
- VERSION = "0.3.1"
4
+ VERSION = "0.4.3"
5
5
  end
@@ -10,7 +10,7 @@ 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 => 'https://github.com/gonativeio/{{PLUGIN_NAME}}.git', :tag => s.version.to_s }
13
+ s.source = { :git => 'git@github.com:gonativeio/{{PLUGIN_NAME}}.git', :tag => s.version.to_s }
14
14
 
15
15
  s.ios.deployment_target = '10.0'
16
16
  s.swift_versions = '5.0'
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.3.1
4
+ version: 0.4.3
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-11 00:00:00.000000000 Z
11
+ date: 2021-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -39,47 +39,47 @@ 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
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 0.8.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 0.8.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -182,6 +182,7 @@ files:
182
182
  - lib/gonative/plugins.rb
183
183
  - lib/gonative/plugins/ios/create.rb
184
184
  - lib/gonative/plugins/ios/publish.rb
185
+ - lib/gonative/plugins/ios/publish/release.rb
185
186
  - lib/gonative/utils/template_inflator.rb
186
187
  - lib/gonative/utils/ui.rb
187
188
  - lib/gonative/version.rb