gonative-cli 1.3.9 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/gonative/commands/ios/add_files.rb +16 -0
- data/lib/gonative/commands.rb +1 -0
- data/lib/gonative/plugins/ios/add_files.rb +43 -0
- data/lib/gonative/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16b3c19dee4afcbb644ea40184c8148ea90afba067e35c5497440fedd860d8b3
|
4
|
+
data.tar.gz: 46d0665eaa153382c087e1d9201268053e9084c9f725662b1f54ab0774018ee3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 903ebef8bf1a1aead292f33cfc5abc9145144996eb36053251fc2299089e9bcf0d04c342fd723c316eff7516f78e4fe41dff02960a58a3f5c03ae7e97c8e63e0
|
7
|
+
data.tar.gz: 63a0957d99e2b85cae86ddff6463ad84c46ced61d9e9dd1ce20a029dbf561af0bb114a024886acd2c72f58a0ce9d51e33cfbcc2265c83d7d773056a56256f1fe
|
data/Gemfile.lock
CHANGED
@@ -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
|
data/lib/gonative/commands.rb
CHANGED
@@ -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
|
data/lib/gonative/version.rb
CHANGED
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.
|
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-
|
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
|