gonative-cli 1.0.6 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -1
- data/Gemfile.lock +10 -10
- data/lib/gonative/plugins/ios/build_framework.rb +40 -18
- data/lib/gonative/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fda44fd4c9e5bcc3420c6af9d1235f5730d5934ed9a8e514a6011955e5707904
|
4
|
+
data.tar.gz: af363b41f0ede93117ae8b6c005bb44e83d382217470f45e3c69923df3266f47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 372e878724aa0c97715f3ea1d075f4c759810c7ea84dd84482b060b4fac84baf8faccd1c58b7f61d6b47ac7a944a32d733384439a3d71890b818908de41862ee
|
7
|
+
data.tar.gz: d491faf524af2f5f8772fe37f813a5e07bcc754b3357f5886770553f8f0e1325a6b4fd0bf0c661d7859cc3bff21dc83bf9c18211be6dee9477cd8519c0e4ee23
|
data/.rubocop.yml
CHANGED
@@ -3,11 +3,14 @@ AllCops:
|
|
3
3
|
|
4
4
|
Style/StringLiterals:
|
5
5
|
Enabled: true
|
6
|
-
EnforcedStyle:
|
6
|
+
EnforcedStyle: single_quotes
|
7
7
|
|
8
8
|
Style/StringLiteralsInInterpolation:
|
9
9
|
Enabled: true
|
10
10
|
EnforcedStyle: double_quotes
|
11
11
|
|
12
|
+
Style/Documentation:
|
13
|
+
Enabled: false
|
14
|
+
|
12
15
|
Layout/LineLength:
|
13
16
|
Max: 120
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gonative-cli (1.
|
4
|
+
gonative-cli (1.1.1)
|
5
5
|
activesupport (~> 6.0)
|
6
6
|
cocoapods (~> 1.10)
|
7
7
|
colorize (~> 0.8.0)
|
@@ -29,15 +29,15 @@ GEM
|
|
29
29
|
atomos (0.1.3)
|
30
30
|
byebug (11.1.3)
|
31
31
|
claide (1.1.0)
|
32
|
-
cocoapods (1.
|
32
|
+
cocoapods (1.12.0)
|
33
33
|
addressable (~> 2.8)
|
34
34
|
claide (>= 1.0.2, < 2.0)
|
35
|
-
cocoapods-core (= 1.
|
35
|
+
cocoapods-core (= 1.12.0)
|
36
36
|
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
37
|
-
cocoapods-downloader (>= 1.
|
37
|
+
cocoapods-downloader (>= 1.6.0, < 2.0)
|
38
38
|
cocoapods-plugins (>= 1.0.0, < 2.0)
|
39
39
|
cocoapods-search (>= 1.0.0, < 2.0)
|
40
|
-
cocoapods-trunk (>= 1.
|
40
|
+
cocoapods-trunk (>= 1.6.0, < 2.0)
|
41
41
|
cocoapods-try (>= 1.1.0, < 2.0)
|
42
42
|
colored2 (~> 3.1)
|
43
43
|
escape (~> 0.0.4)
|
@@ -45,10 +45,10 @@ GEM
|
|
45
45
|
gh_inspector (~> 1.0)
|
46
46
|
molinillo (~> 0.8.0)
|
47
47
|
nap (~> 1.0)
|
48
|
-
ruby-macho (>=
|
48
|
+
ruby-macho (>= 2.3.0, < 3.0)
|
49
49
|
xcodeproj (>= 1.21.0, < 2.0)
|
50
|
-
cocoapods-core (1.
|
51
|
-
activesupport (>= 5.0, <
|
50
|
+
cocoapods-core (1.12.0)
|
51
|
+
activesupport (>= 5.0, < 8)
|
52
52
|
addressable (~> 2.8)
|
53
53
|
algoliasearch (~> 1.0)
|
54
54
|
concurrent-ruby (~> 1.1)
|
@@ -69,7 +69,7 @@ GEM
|
|
69
69
|
coderay (1.1.3)
|
70
70
|
colored2 (3.1.2)
|
71
71
|
colorize (0.8.1)
|
72
|
-
concurrent-ruby (1.2.
|
72
|
+
concurrent-ruby (1.2.2)
|
73
73
|
diff-lcs (1.4.4)
|
74
74
|
dry-cli (0.7.0)
|
75
75
|
escape (0.0.4)
|
@@ -144,7 +144,7 @@ GEM
|
|
144
144
|
colored2 (~> 3.1)
|
145
145
|
nanaimo (~> 0.3.0)
|
146
146
|
rexml (~> 3.2.4)
|
147
|
-
zeitwerk (2.6.
|
147
|
+
zeitwerk (2.6.7)
|
148
148
|
|
149
149
|
PLATFORMS
|
150
150
|
arm64-darwin-21
|
@@ -9,26 +9,26 @@ module GoNative
|
|
9
9
|
module IOS
|
10
10
|
class BuildFramework
|
11
11
|
autoload :FileUtils, 'fileutils'
|
12
|
-
|
12
|
+
|
13
13
|
extend DSL::Serviceable
|
14
14
|
|
15
15
|
BUILD_TEMPLATE_DIRECTORY_PATH = File.expand_path(File.join(__dir__, '../../../..', 'templates', 'build', 'ios'))
|
16
|
-
|
16
|
+
|
17
17
|
attr_reader :plugin_name, :archs, :persist_build_dir
|
18
18
|
|
19
19
|
def initialize(archs, persist_build_dir)
|
20
20
|
podspec_file = Dir["./*.podspec"].first
|
21
21
|
raise Error, "No podspec exists." unless podspec_file
|
22
|
-
|
22
|
+
|
23
23
|
@plugin_name = File.basename(podspec_file, '.podspec')
|
24
24
|
@archs = archs.gsub(',', ' ')
|
25
25
|
@persist_build_dir = persist_build_dir
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
def call
|
29
29
|
setup_dirs
|
30
30
|
create_framework_proj
|
31
|
-
move_template_files
|
31
|
+
move_template_files!
|
32
32
|
run_pod_install
|
33
33
|
chmod_frameworks_script!
|
34
34
|
build_framework!
|
@@ -37,13 +37,13 @@ module GoNative
|
|
37
37
|
FileUtils.cd('..')
|
38
38
|
FileUtils.rm_rf('build') unless persist_build_dir
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
def setup_dirs
|
42
42
|
build_dir = File.join(FileUtils.pwd, 'build')
|
43
43
|
FileUtils.mkdir(build_dir)
|
44
44
|
FileUtils.cd(build_dir)
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
def create_framework_proj
|
48
48
|
proj = Xcodeproj::Project.new(FileUtils.pwd)
|
49
49
|
target = proj.new_target(:framework,
|
@@ -51,15 +51,9 @@ module GoNative
|
|
51
51
|
:ios,
|
52
52
|
deployment_target)
|
53
53
|
main_group = proj.new_group(plugin_name, plugin_name)
|
54
|
-
|
55
|
-
|
56
|
-
target
|
57
|
-
references = Dir.glob("../#{plugin_name}/Classes/**/*.h").map{ |file| classes_group.new_file("../../#{file}") }
|
58
|
-
header_files = target.add_file_references(references)
|
59
|
-
header_files << target.headers_build_phase.add_file_reference(main_group.new_file("../#{plugin_name}-umbrella.h"))
|
60
|
-
header_files.each do |header|
|
61
|
-
header.settings = { 'ATTRIBUTES' => ['Public'] }
|
62
|
-
end
|
54
|
+
add_classes(target, main_group)
|
55
|
+
add_frameworks(target, main_group)
|
56
|
+
add_headers(target, main_group)
|
63
57
|
target.build_configurations.each do |config|
|
64
58
|
config.build_settings['GENERATE_INFOPLIST_FILE'] = 'YES'
|
65
59
|
config.build_settings['MODULEMAP_FILE'] = "#{plugin_name}.modulemap"
|
@@ -67,8 +61,36 @@ module GoNative
|
|
67
61
|
end
|
68
62
|
proj.save("#{plugin_name}.xcodeproj")
|
69
63
|
end
|
70
|
-
|
71
|
-
def
|
64
|
+
|
65
|
+
def add_classes(target, group)
|
66
|
+
classes_group = group.new_group('Classes', 'Classes')
|
67
|
+
references = Dir.glob("../#{plugin_name}/Classes/**/*.{m,swift}").map do |file|
|
68
|
+
classes_group.new_file("../../#{file}")
|
69
|
+
end
|
70
|
+
target.add_file_references(references)
|
71
|
+
end
|
72
|
+
|
73
|
+
def add_frameworks(target, group)
|
74
|
+
frameworks_group = group.new_group('Frameworks', 'Frameworks')
|
75
|
+
references = Dir.glob("../#{plugin_name}/Frameworks/*.{framework,xcframework}").map do |file|
|
76
|
+
frameworks_group.new_file("../../#{file}")
|
77
|
+
end
|
78
|
+
return unless references.length
|
79
|
+
|
80
|
+
references.each { |ref| target.frameworks_build_phase.add_file_reference(ref) }
|
81
|
+
end
|
82
|
+
|
83
|
+
def add_headers(target, group)
|
84
|
+
headers_group = group.new_group('Headers', 'Headers')
|
85
|
+
references = Dir.glob("../#{plugin_name}/Classes/**/*.h").map { |file| headers_group.new_file("../../#{file}") }
|
86
|
+
header_files = target.add_file_references(references)
|
87
|
+
header_files << target.headers_build_phase.add_file_reference(main_group.new_file("../#{plugin_name}-umbrella.h"))
|
88
|
+
header_files.each do |header|
|
89
|
+
header.settings = { 'ATTRIBUTES' => ['Public'] }
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
def move_template_files!
|
72
94
|
plugin_dependencies = spec.dependencies.map{|d| ["pod '#{d.name}'", "'#{d.requirement}'"].compact.join(', ') } * "\n\t"
|
73
95
|
FileUtils.cp_r("#{BUILD_TEMPLATE_DIRECTORY_PATH}/.", '.')
|
74
96
|
headers = Dir.glob("../#{plugin_name}/Classes/**/*.h").map{ |f| "#import \"#{File.basename(f)}\"" } * "\n"
|
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.1.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: 2023-02
|
11
|
+
date: 2023-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-cli
|