gonative-cli 1.2.0 → 1.2.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: 696be1b5e8b71bb4605450974d039505571a2dd5ab57635c3bf9e76673ac7847
4
- data.tar.gz: 460e006f8a03e7f557e7dd0ea8f6fc4fb0c981c6e078b5eaf8fd33d1e040e4d4
3
+ metadata.gz: 2b6ecdffb0ef7622a9e2c4bbab226dcfabb7fcfd6c2b812f0e9d4492af2ab78c
4
+ data.tar.gz: 61205ced579aa0787db3fc4cf88fd958d916c4a00a6aece6381f8114b234c4b0
5
5
  SHA512:
6
- metadata.gz: c0088b9718dddb755e9cb8994a5bb80a3b07168938dbf2b604bcc3b1d96d6c721b77060c19a7b4916d4f30cbc6782ce5fbeecc00e1ab73b1c6df24dc77901e2e
7
- data.tar.gz: 5d69260b7d62293d491bfcc8decac1cc6ddf6c9995dd1f3a54328c72d79ed2b5f6899ebc3b85110eac6e9da2b1965e86f0d8fcc90b211166fcf25d539222d41e
6
+ metadata.gz: 2ebb2cf3a39e5e4a4390a4427b74443aff3f4f4bfdadb2b9e409e88fe4009340608a34ad801dc52e2e66bf622f9c74f2f27b7d3af85ed5a29e196d87eecbaace
7
+ data.tar.gz: 9703f0d27285ee645e3311cead965481442957b47bc0d1e9396c95667a87dc780d9250b8af70af30434f9f55499a97c889fb34b078445ddda508edd78223248c
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.6
2
+ TargetRubyVersion: 3.1
3
3
 
4
4
  Style/StringLiterals:
5
5
  Enabled: true
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gonative-cli (1.2.0)
4
+ gonative-cli (1.2.2)
5
5
  activesupport (~> 6.0)
6
6
  cocoapods (~> 1.10)
7
7
  colorize (~> 0.8.0)
@@ -29,10 +29,10 @@ GEM
29
29
  atomos (0.1.3)
30
30
  byebug (11.1.3)
31
31
  claide (1.1.0)
32
- cocoapods (1.12.0)
32
+ cocoapods (1.12.1)
33
33
  addressable (~> 2.8)
34
34
  claide (>= 1.0.2, < 2.0)
35
- cocoapods-core (= 1.12.0)
35
+ cocoapods-core (= 1.12.1)
36
36
  cocoapods-deintegrate (>= 1.0.3, < 2.0)
37
37
  cocoapods-downloader (>= 1.6.0, < 2.0)
38
38
  cocoapods-plugins (>= 1.0.0, < 2.0)
@@ -47,7 +47,7 @@ GEM
47
47
  nap (~> 1.0)
48
48
  ruby-macho (>= 2.3.0, < 3.0)
49
49
  xcodeproj (>= 1.21.0, < 2.0)
50
- cocoapods-core (1.12.0)
50
+ cocoapods-core (1.12.1)
51
51
  activesupport (>= 5.0, < 8)
52
52
  addressable (~> 2.8)
53
53
  algoliasearch (~> 1.0)
@@ -144,7 +144,7 @@ GEM
144
144
  colored2 (~> 3.1)
145
145
  nanaimo (~> 0.3.0)
146
146
  rexml (~> 3.2.4)
147
- zeitwerk (2.6.7)
147
+ zeitwerk (2.6.8)
148
148
 
149
149
  PLATFORMS
150
150
  arm64-darwin-21
@@ -20,7 +20,7 @@ module GoNative
20
20
  private
21
21
 
22
22
  def gradle_files
23
- @gradle_files ||= `find . -iname build.gradle`.split("\n")
23
+ @gradle_files ||= `find . -maxdepth 2 -iname build.gradle`.split("\n")
24
24
  end
25
25
 
26
26
  def version
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GoNative
4
+ module Commands
5
+ module IOS
6
+ class Version < Base
7
+ desc 'Rename an iOS project'
8
+
9
+ def call
10
+ Plugins::IOS::Version.call
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -11,6 +11,7 @@ module GoNative
11
11
  register 'ios embed-extensions', IOS::EmbedExtensions
12
12
  register 'ios set-bundle-id', IOS::SetBundleId
13
13
  register 'ios rename', IOS::Rename
14
+ register 'ios version', IOS::Version
14
15
 
15
16
  register 'android create', Android::Create
16
17
  register 'android publish', Android::Publish
@@ -1,4 +1,3 @@
1
-
2
1
  # frozen_string_literal: true
3
2
 
4
3
  module GoNative
@@ -7,8 +6,9 @@ module GoNative
7
6
  def call(...)
8
7
  super(...)
9
8
  rescue Error => e
10
- warn e.message
9
+ Utils::UI.error e.message
10
+ exit 1
11
11
  end
12
12
  end
13
13
  end
14
- end
14
+ end
@@ -8,4 +8,4 @@ module GoNative
8
8
  end
9
9
  end
10
10
  end
11
- end
11
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cocoapods'
4
+
5
+ module GoNative
6
+ module Plugins
7
+ module IOS
8
+ module Helpers
9
+ module SpecReader
10
+ def spec_name
11
+ @spec_name ||= Dir.entries('.').select { |s| s.end_with? '.podspec' }.first
12
+ end
13
+
14
+ def spec
15
+ @spec ||= Pod::Specification.from_file(spec_name)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GoNative
4
+ module Plugins
5
+ module IOS
6
+ module Helpers
7
+ end
8
+ end
9
+ end
10
+ end
@@ -7,8 +7,9 @@ module GoNative
7
7
  module IOS
8
8
  class Release
9
9
  extend DSL::Serviceable
10
+ include Helpers::SpecReader
10
11
 
11
- GONATIVE_SOURCE_NAME = 'gonative-specs'.freeze
12
+ GONATIVE_SOURCE_NAME = 'gonative-specs'
12
13
 
13
14
  def call
14
15
  Utils::UI.info 'Linting and releasing pod'
@@ -24,7 +25,7 @@ module GoNative
24
25
  def assert_spec_exists!
25
26
  return if spec_name
26
27
 
27
- raise Error, "No podspec file exists"
28
+ raise Error, 'No podspec file exists'
28
29
  end
29
30
 
30
31
  def assert_not_pushed!
@@ -33,30 +34,24 @@ module GoNative
33
34
 
34
35
  pushed_versions = source.versions(name)&.collect(&:to_s)
35
36
 
36
- raise Error,
37
- "#{name} (#{version}) has already been pushed to #{source.name}" if pushed_versions&.include? version.to_s
37
+ if pushed_versions&.include? version.to_s
38
+ raise Error,
39
+ "#{name} (#{version}) has already been pushed to #{source.name}"
40
+ end
38
41
  end
39
42
 
40
43
  def create_and_push_tag!
41
- unless system("git tag | grep #{spec.version} > /dev/null")
42
- system "git add -A && git commit -m \"Releases #{spec.version}.\""
43
- system "git tag #{spec.version}"
44
- system "git push && git push --tags"
45
- end
44
+ return if system("git tag | grep #{spec.version} > /dev/null")
45
+
46
+ system "git add -A && git commit -m \"Releases #{spec.version}.\""
47
+ system "git tag #{spec.version}"
48
+ system 'git push && git push --tags'
46
49
  end
47
50
 
48
51
  def push_to_pod_repo!
49
52
  system "pod repo push #{GONATIVE_SOURCE_NAME} #{spec_name} --private --allow-warnings"
50
53
  end
51
54
 
52
- def spec_name
53
- @spec_name ||= Dir.entries(".").select { |s| s.end_with? ".podspec" }.first
54
- end
55
-
56
- def spec
57
- @spec ||= Pod::Specification.from_file(spec_name)
58
- end
59
-
60
55
  def source
61
56
  @source ||= sources_manager.source_with_name_or_url(GONATIVE_SOURCE_NAME)
62
57
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cocoapods'
4
+
5
+ module GoNative
6
+ module Plugins
7
+ module IOS
8
+ class Version
9
+ extend DSL::Serviceable
10
+ include Helpers::SpecReader
11
+
12
+ def call
13
+ Utils::UI.output(spec.version)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # frozen_string_literal: true\
2
4
 
3
5
  require 'colorize'
@@ -9,6 +11,14 @@ module GoNative
9
11
  def info(msg)
10
12
  puts msg.colorize(:green)
11
13
  end
14
+
15
+ def output(msg)
16
+ puts msg
17
+ end
18
+
19
+ def error(msg)
20
+ puts msg.colorize(:red)
21
+ end
12
22
  end
13
23
  end
14
24
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GoNative
4
- VERSION = '1.2.0'
4
+ VERSION = '1.2.2'
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: 1.2.0
4
+ version: 1.2.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: 2023-04-18 00:00:00.000000000 Z
11
+ date: 2023-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -196,6 +196,7 @@ files:
196
196
  - lib/gonative/commands/ios/publish.rb
197
197
  - lib/gonative/commands/ios/rename.rb
198
198
  - lib/gonative/commands/ios/set_bundle_id.rb
199
+ - lib/gonative/commands/ios/version.rb
199
200
  - lib/gonative/commands/version.rb
200
201
  - lib/gonative/dsl/error_catchable.rb
201
202
  - lib/gonative/dsl/serviceable.rb
@@ -204,10 +205,13 @@ files:
204
205
  - lib/gonative/plugins/ios/create.rb
205
206
  - lib/gonative/plugins/ios/embed_extensions.rb
206
207
  - lib/gonative/plugins/ios/extract_extensions.rb
208
+ - lib/gonative/plugins/ios/helpers.rb
209
+ - lib/gonative/plugins/ios/helpers/spec_reader.rb
207
210
  - lib/gonative/plugins/ios/release.rb
208
211
  - lib/gonative/plugins/ios/rename.rb
209
212
  - lib/gonative/plugins/ios/set_bundle_id.rb
210
213
  - lib/gonative/plugins/ios/verify.rb
214
+ - lib/gonative/plugins/ios/version.rb
211
215
  - lib/gonative/utils.rb
212
216
  - lib/gonative/utils/content_evaluator.rb
213
217
  - lib/gonative/utils/sanitize_plugin_name.rb