gonative-cli 1.3.4 → 1.3.5

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: 94b317942c90bb00d730654df5b2b8dd2affcd57cd354fa10f8737f81c4850e4
4
- data.tar.gz: 89df4858f9133fcf52eedea2a77cc92869ef1edd7be5477f069f2f8b26066ecf
3
+ metadata.gz: f42b092dc883417d5ef7e77808a421ec5ab97e8d25a7b8e7fff947920a28272a
4
+ data.tar.gz: d740e585b5cafaa70f1b65510e9672f8e250b5753c15f6b357ee7c54b22b943a
5
5
  SHA512:
6
- metadata.gz: 50c202324e6a27e916e16d2dd3764d2f99b52a0b3c69a5b8372e856bf200d7131484fe67eeb080d3b9ed326c7a9aeb9f9449570394c1cf8867344dcb9cb58bb2
7
- data.tar.gz: e0deef3dac770b7f54ded9e3b958c4adcd2df198e9b05614a6d6f8ee2412f51166836ffa966482553a41556a5007d129a1aa04922d553a0cb2ace577f0dc69a2
6
+ metadata.gz: a689ff2f8f58ac5f6f0f660d7a01f7774fa4cb5db19ab893acf4860aef006afabcfdb1bdbbcd1792a77d8057cabd725904c580fe3de28aea8527473598652179
7
+ data.tar.gz: 1f0d62246fc9823a3dfd987c203b0d7a479c8de9efbb2f47863b01eee7a9aef55ae6bd20e15e800d3cf37289de9fe6defcd038ac072f5067b9fac90ab0bbaf30
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gonative-cli (1.3.4)
4
+ gonative-cli (1.3.5)
5
5
  activesupport (~> 6.0)
6
6
  cocoapods (~> 1.10)
7
7
  colorize (~> 0.8.0)
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GoNative
4
+ module Commands
5
+ module IOS
6
+ class EmbedScripts < Base
7
+ desc 'Embeds target scripts in a project'
8
+
9
+ def call(**)
10
+ Plugins::IOS::EmbedScripts.call
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -9,6 +9,7 @@ module GoNative
9
9
  register 'ios publish', IOS::Publish
10
10
  register 'ios extract-extensions', IOS::ExtractExtensions
11
11
  register 'ios embed-extensions', IOS::EmbedExtensions
12
+ register 'ios embed-scripts', IOS::EmbedScripts
12
13
  register 'ios set-bundle-id', IOS::SetBundleId
13
14
  register 'ios rename', IOS::Rename
14
15
  register 'ios version', IOS::Version
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'yaml'
4
+ require 'xcodeproj'
5
+
6
+ module GoNative
7
+ module Plugins
8
+ module IOS
9
+ class EmbedScripts
10
+ TARGET_SCRIPTS_FILE_NAME = 'target_scripts.yml'
11
+
12
+ extend DSL::Serviceable
13
+ autoload :FileUtils, 'fileutils'
14
+
15
+ attr_reader :scripts
16
+
17
+ def call
18
+ prepare_scripts
19
+ return unless scripts?
20
+
21
+ embed_in_project
22
+ end
23
+
24
+ def scripts?
25
+ !scripts.empty?
26
+ end
27
+
28
+ def prepare_scripts
29
+ scripts_paths = `find ./Pods -name #{TARGET_SCRIPTS_FILE_NAME}`.split("\n")
30
+ @scripts = scripts_paths
31
+ .map { |path| YAML.load_file(path)['scripts'] }
32
+ .flatten
33
+ end
34
+
35
+ def embed_in_project
36
+ proj = Xcodeproj::Project.open('MedianIOS.xcodeproj')
37
+ app_target = proj.native_targets.first
38
+ scripts.each do |script|
39
+ app_target.project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase).tap do |phase|
40
+ phase.name = script['name'] || 'New Run Script Phase'
41
+ phase.input_paths = script['input_paths']
42
+ phase.output_paths = script['output_paths']
43
+ phase.shell_path = script['shell_path']
44
+ phase.shell_script = script['shell_script']
45
+
46
+ app_target.build_phases << phase
47
+ end
48
+ end
49
+
50
+ proj.save
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GoNative
4
- VERSION = '1.3.4'
4
+ VERSION = '1.3.5'
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.4
4
+ version: 1.3.5
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-11-24 00:00:00.000000000 Z
11
+ date: 2023-11-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/base.rb
193
193
  - lib/gonative/commands/ios/create.rb
194
194
  - lib/gonative/commands/ios/embed_extensions.rb
195
+ - lib/gonative/commands/ios/embed_scripts.rb
195
196
  - lib/gonative/commands/ios/extract_extensions.rb
196
197
  - lib/gonative/commands/ios/publish.rb
197
198
  - lib/gonative/commands/ios/rename.rb
@@ -204,6 +205,7 @@ files:
204
205
  - lib/gonative/plugins/ios/build_framework.rb
205
206
  - lib/gonative/plugins/ios/create.rb
206
207
  - lib/gonative/plugins/ios/embed_extensions.rb
208
+ - lib/gonative/plugins/ios/embed_scripts.rb
207
209
  - lib/gonative/plugins/ios/extract_extensions.rb
208
210
  - lib/gonative/plugins/ios/helpers.rb
209
211
  - lib/gonative/plugins/ios/helpers/spec_reader.rb