gonative-cli 1.0.6 → 1.1.0

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: 6178fe6ef55bb30d95242037998fe89c3e011ca95dbdcad898cc64bf028e4815
4
- data.tar.gz: 422a57c1f3f3af2122fa1a81d7d0347741218aab5ef250b87fdb621a9d08b83e
3
+ metadata.gz: 6d510d2aaada6015794dc3dc673655b8065691ecb35149e5f35a309ddd58db26
4
+ data.tar.gz: 303374a89b1f6e1d56f0352e165961b72dd62df01265123a30204d6407dd30a9
5
5
  SHA512:
6
- metadata.gz: 8ee760673f579b91bd59683b36cbe689bc75f6de7cb958eb262356712d1a80b4de3036aa31ac557f86a87f254078dce23ed74ae3b391f5d2ac7846161df8c8e7
7
- data.tar.gz: 40fdf89762074e9e0e8e40dd5ca1c7e667db8a281ae6e7758d42fdd6f9573ebf86373ae4525f271c94e6a2fc41041a11b0ca8b5be1adec916357a1535c31fd66
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.6)
4
+ gonative-cli (1.1.0)
5
5
  activesupport (~> 6.0)
6
6
  cocoapods (~> 1.10)
7
7
  colorize (~> 0.8.0)
@@ -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.2.0)
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)
@@ -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.6"
4
+ VERSION = '1.1.0'
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.0.6
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: 2023-02-17 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