gonative-cli 1.0.5 → 1.1.0

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: e0e069a9d419de934125aa9a4fe89224c83d0a85d8402542781e0e6f675d980c
4
- data.tar.gz: 8600827abe689021828dc9edc6575c5a9f47722c9291bbd39bb0c4f8d55c3632
3
+ metadata.gz: 6d510d2aaada6015794dc3dc673655b8065691ecb35149e5f35a309ddd58db26
4
+ data.tar.gz: 303374a89b1f6e1d56f0352e165961b72dd62df01265123a30204d6407dd30a9
5
5
  SHA512:
6
- metadata.gz: d97a108fbe118000f4d50860932235053c9b0a596af18d1e10c345cd4ebf92133a18d235ed277fe3105474a806e7a8a1bec17221b06d9d833e30774d3dc39a0f
7
- data.tar.gz: cd2484f3b45cb2e13c859842e7269c0fe282fbf585411202bbf38161d153a02eb52921cb54bd47d0561edb7ffb0950c4cf94e61279ecf19ba354db93ed71fa2f
6
+ metadata.gz: e2dcf59344e6e14804acb3f3cf63f638b61864f9513fdb32c6916319f4c56300aa00082ad8f5115fe2c3783237bc4d5f26c490b284918417274f991a3060e5e6
7
+ data.tar.gz: 18b36dfbb22f946940680e6d98fea1d74e2e30e85e02856b68e0d9dbd42463ad65d7f13e013210666639fd5cd9c4488da963a0a2d06645e16b4f6dda126b8cd4
data/.rubocop.yml CHANGED
@@ -3,11 +3,14 @@ AllCops:
3
3
 
4
4
  Style/StringLiterals:
5
5
  Enabled: true
6
- EnforcedStyle: double_quotes
6
+ EnforcedStyle: single_quotes
7
7
 
8
8
  Style/StringLiteralsInInterpolation:
9
9
  Enabled: true
10
10
  EnforcedStyle: double_quotes
11
11
 
12
+ Style/Documentation:
13
+ Enabled: false
14
+
12
15
  Layout/LineLength:
13
16
  Max: 120
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gonative-cli (1.0.4)
4
+ gonative-cli (1.1.0)
5
5
  activesupport (~> 6.0)
6
6
  cocoapods (~> 1.10)
7
7
  colorize (~> 0.8.0)
@@ -14,14 +14,14 @@ GEM
14
14
  specs:
15
15
  CFPropertyList (3.0.5)
16
16
  rexml
17
- activesupport (6.1.6.1)
17
+ activesupport (6.1.7)
18
18
  concurrent-ruby (~> 1.0, >= 1.0.2)
19
19
  i18n (>= 1.6, < 2)
20
20
  minitest (>= 5.1)
21
21
  tzinfo (~> 2.0)
22
22
  zeitwerk (~> 2.3)
23
- addressable (2.8.0)
24
- public_suffix (>= 2.0.2, < 5.0)
23
+ addressable (2.8.1)
24
+ public_suffix (>= 2.0.2, < 6.0)
25
25
  algoliasearch (1.27.5)
26
26
  httpclient (~> 2.8, >= 2.8.3)
27
27
  json (>= 1.5.1)
@@ -29,15 +29,15 @@ GEM
29
29
  atomos (0.1.3)
30
30
  byebug (11.1.3)
31
31
  claide (1.1.0)
32
- cocoapods (1.11.3)
32
+ cocoapods (1.12.0)
33
33
  addressable (~> 2.8)
34
34
  claide (>= 1.0.2, < 2.0)
35
- cocoapods-core (= 1.11.3)
35
+ cocoapods-core (= 1.12.0)
36
36
  cocoapods-deintegrate (>= 1.0.3, < 2.0)
37
- cocoapods-downloader (>= 1.4.0, < 2.0)
37
+ cocoapods-downloader (>= 1.6.0, < 2.0)
38
38
  cocoapods-plugins (>= 1.0.0, < 2.0)
39
39
  cocoapods-search (>= 1.0.0, < 2.0)
40
- cocoapods-trunk (>= 1.4.0, < 2.0)
40
+ cocoapods-trunk (>= 1.6.0, < 2.0)
41
41
  cocoapods-try (>= 1.1.0, < 2.0)
42
42
  colored2 (~> 3.1)
43
43
  escape (~> 0.0.4)
@@ -45,10 +45,10 @@ GEM
45
45
  gh_inspector (~> 1.0)
46
46
  molinillo (~> 0.8.0)
47
47
  nap (~> 1.0)
48
- ruby-macho (>= 1.0, < 3.0)
48
+ ruby-macho (>= 2.3.0, < 3.0)
49
49
  xcodeproj (>= 1.21.0, < 2.0)
50
- cocoapods-core (1.11.3)
51
- activesupport (>= 5.0, < 7)
50
+ cocoapods-core (1.12.0)
51
+ activesupport (>= 5.0, < 8)
52
52
  addressable (~> 2.8)
53
53
  algoliasearch (~> 1.0)
54
54
  concurrent-ruby (~> 1.1)
@@ -69,7 +69,7 @@ GEM
69
69
  coderay (1.1.3)
70
70
  colored2 (3.1.2)
71
71
  colorize (0.8.1)
72
- concurrent-ruby (1.1.10)
72
+ concurrent-ruby (1.2.2)
73
73
  diff-lcs (1.4.4)
74
74
  dry-cli (0.7.0)
75
75
  escape (0.0.4)
@@ -84,7 +84,7 @@ GEM
84
84
  concurrent-ruby (~> 1.0)
85
85
  json (2.6.2)
86
86
  method_source (1.0.0)
87
- minitest (5.16.2)
87
+ minitest (5.16.3)
88
88
  molinillo (0.8.0)
89
89
  nanaimo (0.3.0)
90
90
  nap (1.1.0)
@@ -144,9 +144,10 @@ GEM
144
144
  colored2 (~> 3.1)
145
145
  nanaimo (~> 0.3.0)
146
146
  rexml (~> 3.2.4)
147
- zeitwerk (2.6.0)
147
+ zeitwerk (2.6.1)
148
148
 
149
149
  PLATFORMS
150
+ arm64-darwin-21
150
151
  x86_64-darwin-19
151
152
  x86_64-darwin-21
152
153
 
data/README.md CHANGED
@@ -23,7 +23,9 @@ Install the gem now using:
23
23
 
24
24
  ## Usage
25
25
 
26
- TODO: Write usage instructions here
26
+ You can get all possible usage commands by typing
27
+
28
+ gonative help
27
29
 
28
30
  ## Development
29
31
 
@@ -9,26 +9,26 @@ module GoNative
9
9
  module IOS
10
10
  class BuildFramework
11
11
  autoload :FileUtils, 'fileutils'
12
-
12
+
13
13
  extend DSL::Serviceable
14
14
 
15
15
  BUILD_TEMPLATE_DIRECTORY_PATH = File.expand_path(File.join(__dir__, '../../../..', 'templates', 'build', 'ios'))
16
-
16
+
17
17
  attr_reader :plugin_name, :archs, :persist_build_dir
18
18
 
19
19
  def initialize(archs, persist_build_dir)
20
20
  podspec_file = Dir["./*.podspec"].first
21
21
  raise Error, "No podspec exists." unless podspec_file
22
-
22
+
23
23
  @plugin_name = File.basename(podspec_file, '.podspec')
24
24
  @archs = archs.gsub(',', ' ')
25
25
  @persist_build_dir = persist_build_dir
26
26
  end
27
-
27
+
28
28
  def call
29
29
  setup_dirs
30
30
  create_framework_proj
31
- move_template_files
31
+ move_template_files!
32
32
  run_pod_install
33
33
  chmod_frameworks_script!
34
34
  build_framework!
@@ -37,13 +37,13 @@ module GoNative
37
37
  FileUtils.cd('..')
38
38
  FileUtils.rm_rf('build') unless persist_build_dir
39
39
  end
40
-
40
+
41
41
  def setup_dirs
42
42
  build_dir = File.join(FileUtils.pwd, 'build')
43
43
  FileUtils.mkdir(build_dir)
44
44
  FileUtils.cd(build_dir)
45
45
  end
46
-
46
+
47
47
  def create_framework_proj
48
48
  proj = Xcodeproj::Project.new(FileUtils.pwd)
49
49
  target = proj.new_target(:framework,
@@ -51,15 +51,9 @@ module GoNative
51
51
  :ios,
52
52
  deployment_target)
53
53
  main_group = proj.new_group(plugin_name, plugin_name)
54
- classes_group = main_group.new_group('Classes', 'Classes')
55
- references = Dir.glob("../#{plugin_name}/Classes/**/*.{m,swift}").map{ |file| classes_group.new_file("../../#{file}") }
56
- target.add_file_references(references)
57
- references = Dir.glob("../#{plugin_name}/Classes/**/*.h").map{ |file| classes_group.new_file("../../#{file}") }
58
- header_files = target.add_file_references(references)
59
- header_files << target.headers_build_phase.add_file_reference(main_group.new_file("../#{plugin_name}-umbrella.h"))
60
- header_files.each do |header|
61
- header.settings = { 'ATTRIBUTES' => ['Public'] }
62
- end
54
+ add_classes(target, main_group)
55
+ add_frameworks(target, main_group)
56
+ add_headers(target, main_group)
63
57
  target.build_configurations.each do |config|
64
58
  config.build_settings['GENERATE_INFOPLIST_FILE'] = 'YES'
65
59
  config.build_settings['MODULEMAP_FILE'] = "#{plugin_name}.modulemap"
@@ -67,8 +61,34 @@ module GoNative
67
61
  end
68
62
  proj.save("#{plugin_name}.xcodeproj")
69
63
  end
70
-
71
- def move_template_files
64
+
65
+ def add_classes(target, group)
66
+ classes_group = group.new_group('Classes', 'Classes')
67
+ references = Dir.glob("../#{plugin_name}/Classes/**/*.{m,swift}").map do |file|
68
+ classes_group.new_file("../../#{file}")
69
+ end
70
+ target.add_file_references(references)
71
+ end
72
+
73
+ def add_frameworks(target, group)
74
+ frameworks_group = group.new_group('Frameworks', 'Frameworks')
75
+ references = Dir.glob("../#{plugin_name}/Frameworks/*.{framework,xcframework}").map do |file|
76
+ frameworks_group.new_file("../../#{file}")
77
+ end
78
+ target.frameworks_build_phase.add_file_references(references) if references.length
79
+ end
80
+
81
+ def add_headers(target, group)
82
+ headers_group = group.new_group('Headers', 'Headers')
83
+ references = Dir.glob("../#{plugin_name}/Classes/**/*.h").map { |file| headers_group.new_file("../../#{file}") }
84
+ header_files = target.add_file_references(references)
85
+ header_files << target.headers_build_phase.add_file_reference(main_group.new_file("../#{plugin_name}-umbrella.h"))
86
+ header_files.each do |header|
87
+ header.settings = { 'ATTRIBUTES' => ['Public'] }
88
+ end
89
+ end
90
+
91
+ def move_template_files!
72
92
  plugin_dependencies = spec.dependencies.map{|d| ["pod '#{d.name}'", "'#{d.requirement}'"].compact.join(', ') } * "\n\t"
73
93
  FileUtils.cp_r("#{BUILD_TEMPLATE_DIRECTORY_PATH}/.", '.')
74
94
  headers = Dir.glob("../#{plugin_name}/Classes/**/*.h").map{ |f| "#import \"#{File.basename(f)}\"" } * "\n"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GoNative
4
- VERSION = "1.0.5"
4
+ VERSION = '1.1.0'
5
5
  end
@@ -1,3 +1,7 @@
1
+ def safeExtGet(prop, fallback) {
2
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
3
+ }
4
+
1
5
  plugins {
2
6
  id 'com.android.library'
3
7
  }
@@ -28,6 +32,6 @@ android {
28
32
  }
29
33
 
30
34
  dependencies {
31
- implementation 'com.github.gonativeio:gonative-android-library:+'
32
- implementation 'com.github.gonativeio:gonative-android-core:+'
35
+ implementation "com.github.gonativeio:gonative-android-library:${safeExtGet('libraryVersion', '1.2.+')}"
36
+ implementation "com.github.gonativeio:gonative-android-core:${safeExtGet('coreVersion', '1.3.+')}"
33
37
  }
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.0.5
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hunaid Hassan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-13 00:00:00.000000000 Z
11
+ date: 2023-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -255,7 +255,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
255
255
  - !ruby/object:Gem::Version
256
256
  version: '0'
257
257
  requirements: []
258
- rubygems_version: 3.2.22
258
+ rubygems_version: 3.3.7
259
259
  signing_key:
260
260
  specification_version: 4
261
261
  summary: CLI to create gonative plugins.