gonative-cli 1.3.9 → 1.4.1

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: 4a4429a1d50824e2a48f24d4a7e0f5097299712eb2deec5d36f8e9161b929f54
4
- data.tar.gz: 9e6fc1f60b1b1ecc3bd6fa463c74657f27bc190d75c6304a0dcf3c2c04806288
3
+ metadata.gz: a7a7465e4576b65e4c983f4f420e3f19b658b37fc9a7e80e81f6620f913a4810
4
+ data.tar.gz: a5c3dd7216761ac731794b99eed4a38458c346f505094223bd935b90167dc7e5
5
5
  SHA512:
6
- metadata.gz: 27c9c14b150a7af8104f8045bd09574936ca7218064c2ab4eece20e12b11ce3e0592ab033864722cf2886eb746bc101955054e2305396db33ef2378c938706ba
7
- data.tar.gz: d1c32e059b64b1d43693080c2cb65ccc1711f211ea55246c940817ce6afbf456a664a437d81ca37400bde884fbe3bc6a786f67a8d5959f813734a03f74860190
6
+ metadata.gz: 27189c9ca970e01bb2e6b60de95623aba7ccb1b33f2b19101c48556329ff8e8e54ae609510ce2658593a74b55ccf2b9eca0fc4695b6eae89f786dda1c98a322a
7
+ data.tar.gz: d4e2c029b68fffd959a5435575bb0c4cd328bbf900266f863da1ff14bc7a927e0d08cfe95608ede98df7f8c212da10ff4a1700194b0a8083ae0a2dde5853102b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gonative-cli (1.3.9)
4
+ gonative-cli (1.4.1)
5
5
  activesupport (~> 6.0)
6
6
  cocoapods (~> 1.10)
7
7
  colorize (~> 0.8.0)
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GoNative
4
+ module Commands
5
+ module IOS
6
+ class AddFiles < Base
7
+ desc 'Add language to the project'
8
+
9
+ argument :path, required: true
10
+ def call(path:, **)
11
+ Plugins::IOS::AddFiles.call(path)
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -14,6 +14,7 @@ module GoNative
14
14
  register 'ios rename', IOS::Rename
15
15
  register 'ios version', IOS::Version
16
16
  register 'ios add-language', IOS::AddLanguage
17
+ register 'ios add-files', IOS::AddFiles
17
18
 
18
19
  register 'android create', Android::Create
19
20
  register 'android publish', Android::Publish
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'xcodeproj'
4
+
5
+ module GoNative
6
+ module Plugins
7
+ module IOS
8
+ class AddFiles
9
+ extend DSL::Serviceable
10
+
11
+ attr_reader :file_paths
12
+
13
+ def initialize(path)
14
+ @file_paths = Dir.glob(path)
15
+ end
16
+
17
+ def call
18
+ return if file_paths.empty?
19
+
20
+ project = Xcodeproj::Project.open('MedianIOS.xcodeproj')
21
+ target = project.native_targets.first
22
+
23
+ resources_directory = File.join(FileUtils.pwd, 'Resources')
24
+ FileUtils.mkdir_p(resources_directory)
25
+
26
+ resources_group = project.main_group['Resources'] || project.main_group.new_group('Resources')
27
+
28
+ file_paths.each do |file_path|
29
+ file_name = File.basename(file_path)
30
+ destination_path = File.join(resources_directory, file_name)
31
+ FileUtils.cp(file_path, destination_path)
32
+
33
+ relative_path = File.join('Resources', file_name)
34
+ file_ref = resources_group.new_file(relative_path)
35
+ target.resources_build_phase.add_file_reference(file_ref)
36
+ end
37
+
38
+ project.save
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -11,7 +11,7 @@ module GoNative
11
11
  attr_reader :name, :proj
12
12
 
13
13
  def initialize(name)
14
- @name = name
14
+ @name = name.gsub(/[^0-9a-zA-Z]/, '')
15
15
  end
16
16
 
17
17
  def call
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GoNative
4
- VERSION = '1.3.9'
4
+ VERSION = '1.4.1'
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.3.9
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hunaid Hassan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-08 00:00:00.000000000 Z
11
+ date: 2024-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -192,6 +192,7 @@ files:
192
192
  - lib/gonative/commands/android/publish.rb
193
193
  - lib/gonative/commands/android/version.rb
194
194
  - lib/gonative/commands/base.rb
195
+ - lib/gonative/commands/ios/add_files.rb
195
196
  - lib/gonative/commands/ios/add_language.rb
196
197
  - lib/gonative/commands/ios/create.rb
197
198
  - lib/gonative/commands/ios/embed_extensions.rb
@@ -205,6 +206,7 @@ files:
205
206
  - lib/gonative/dsl/error_catchable.rb
206
207
  - lib/gonative/dsl/serviceable.rb
207
208
  - lib/gonative/plugins/android/create.rb
209
+ - lib/gonative/plugins/ios/add_files.rb
208
210
  - lib/gonative/plugins/ios/add_language.rb
209
211
  - lib/gonative/plugins/ios/build_framework.rb
210
212
  - lib/gonative/plugins/ios/create.rb