gonative-cli 1.3.4 → 1.3.6
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_language.rb +16 -0
- data/lib/gonative/commands/ios/embed_scripts.rb +15 -0
- data/lib/gonative/commands.rb +2 -0
- data/lib/gonative/plugins/ios/add_language.rb +28 -0
- data/lib/gonative/plugins/ios/embed_scripts.rb +55 -0
- data/lib/gonative/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b8750e6f8ce04f30fa5de7a9d9b33c26383db072687e6e0df1c989eb803d6d1
|
4
|
+
data.tar.gz: dc9cff9b0d587eb192a6e72050c089df4345bb8b210caf733ff9f8881f07c6bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae9a9eb0dbcf1f247ca78071fd83dc66f5569f29b3389fdab21bbf0388f602f273f0e672275c4bcd7c3993ea879f34d778e70200edc7f3f287a1070de6f1866d
|
7
|
+
data.tar.gz: 7f3e36fb8db7180f05c38a6851d7959baec4021eb697b5868669df6fdea6d942ebfd8a63cdb0b082ddd9f0b0034c278e79e0e806722bb9a02c2ca13c51655864
|
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 AddLanguage < Base
|
7
|
+
desc 'Add language to the project'
|
8
|
+
|
9
|
+
argument :language, required: true, desc: 'Language code you want to add to the project.'
|
10
|
+
def call(language:, **)
|
11
|
+
Plugins::IOS::AddLanguage.call(language)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/gonative/commands.rb
CHANGED
@@ -9,9 +9,11 @@ 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
|
16
|
+
register 'ios add-language', IOS::AddLanguage
|
15
17
|
|
16
18
|
register 'android create', Android::Create
|
17
19
|
register 'android publish', Android::Publish
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'xcodeproj'
|
4
|
+
|
5
|
+
module GoNative
|
6
|
+
module Plugins
|
7
|
+
module IOS
|
8
|
+
class AddLanguage
|
9
|
+
extend DSL::Serviceable
|
10
|
+
|
11
|
+
attr_reader :language
|
12
|
+
|
13
|
+
def initialize(language)
|
14
|
+
@language = language
|
15
|
+
end
|
16
|
+
|
17
|
+
def call
|
18
|
+
proj = Xcodeproj::Project.open('MedianIOS.xcodeproj')
|
19
|
+
file = proj.new_file("#{language}.lproj")
|
20
|
+
file.move(proj.groups.first)
|
21
|
+
proj.targets.first.add_resources([file])
|
22
|
+
|
23
|
+
proj.save
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -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
|
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.3.
|
4
|
+
version: 1.3.6
|
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-
|
11
|
+
date: 2023-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-cli
|
@@ -190,8 +190,10 @@ files:
|
|
190
190
|
- lib/gonative/commands/android/create.rb
|
191
191
|
- lib/gonative/commands/android/publish.rb
|
192
192
|
- lib/gonative/commands/base.rb
|
193
|
+
- lib/gonative/commands/ios/add_language.rb
|
193
194
|
- lib/gonative/commands/ios/create.rb
|
194
195
|
- lib/gonative/commands/ios/embed_extensions.rb
|
196
|
+
- lib/gonative/commands/ios/embed_scripts.rb
|
195
197
|
- lib/gonative/commands/ios/extract_extensions.rb
|
196
198
|
- lib/gonative/commands/ios/publish.rb
|
197
199
|
- lib/gonative/commands/ios/rename.rb
|
@@ -201,9 +203,11 @@ files:
|
|
201
203
|
- lib/gonative/dsl/error_catchable.rb
|
202
204
|
- lib/gonative/dsl/serviceable.rb
|
203
205
|
- lib/gonative/plugins/android/create.rb
|
206
|
+
- lib/gonative/plugins/ios/add_language.rb
|
204
207
|
- lib/gonative/plugins/ios/build_framework.rb
|
205
208
|
- lib/gonative/plugins/ios/create.rb
|
206
209
|
- lib/gonative/plugins/ios/embed_extensions.rb
|
210
|
+
- lib/gonative/plugins/ios/embed_scripts.rb
|
207
211
|
- lib/gonative/plugins/ios/extract_extensions.rb
|
208
212
|
- lib/gonative/plugins/ios/helpers.rb
|
209
213
|
- lib/gonative/plugins/ios/helpers/spec_reader.rb
|