gonative-cli 1.3.9 → 1.4.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: 4a4429a1d50824e2a48f24d4a7e0f5097299712eb2deec5d36f8e9161b929f54
4
- data.tar.gz: 9e6fc1f60b1b1ecc3bd6fa463c74657f27bc190d75c6304a0dcf3c2c04806288
3
+ metadata.gz: 16b3c19dee4afcbb644ea40184c8148ea90afba067e35c5497440fedd860d8b3
4
+ data.tar.gz: 46d0665eaa153382c087e1d9201268053e9084c9f725662b1f54ab0774018ee3
5
5
  SHA512:
6
- metadata.gz: 27c9c14b150a7af8104f8045bd09574936ca7218064c2ab4eece20e12b11ce3e0592ab033864722cf2886eb746bc101955054e2305396db33ef2378c938706ba
7
- data.tar.gz: d1c32e059b64b1d43693080c2cb65ccc1711f211ea55246c940817ce6afbf456a664a437d81ca37400bde884fbe3bc6a786f67a8d5959f813734a03f74860190
6
+ metadata.gz: 903ebef8bf1a1aead292f33cfc5abc9145144996eb36053251fc2299089e9bcf0d04c342fd723c316eff7516f78e4fe41dff02960a58a3f5c03ae7e97c8e63e0
7
+ data.tar.gz: 63a0957d99e2b85cae86ddff6463ad84c46ced61d9e9dd1ce20a029dbf561af0bb114a024886acd2c72f58a0ce9d51e33cfbcc2265c83d7d773056a56256f1fe
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.0)
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
@@ -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.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.3.9
4
+ version: 1.4.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: 2024-08-08 00:00:00.000000000 Z
11
+ date: 2024-08-29 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