gonative-cli 0.6.0 → 0.7.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: 0d7617eafaa04e3fb5a03bd016234479630b5d6ffd6c443d8a94e7e03c2d16d7
4
- data.tar.gz: 64e72111529ade7df6d6da73c902f8e4848e04339ddc71a555670f357d95af3f
3
+ metadata.gz: 55b0e7973184f8e9bc0ff3bc8bba55ef782da09c076b586b310f3ffbf53777d7
4
+ data.tar.gz: 9857622f12a738bd94ea83f7a481acecbf2f18b47d64e02c07f6aacc4900ea18
5
5
  SHA512:
6
- metadata.gz: 1f8d324a15a04236a1b0f4549f7b811cfb7faaa9de53ad1de899d9894d3b1d23bc937e84c9f15b1242b6998b04329fba699aef7f6d503ed1f785215f20014127
7
- data.tar.gz: 61f6dc8ca394e5c11652214811161aecb7c55bc59f34a7d31bbf323ba1b07dc6e09b3edee31542d1df3c718f8cbe766fb6b8be74c33d67cc72bee7d8d3519290
6
+ metadata.gz: e5ceef6920dd707f7e404be1ddae19020b0b20bb028fa49ed0c79e1094c5e7898d188e511b6988638be1b436f5ea8554b182aa14c62a45ed605cc6267e3c54b0
7
+ data.tar.gz: 26ffb12906aa1fb7d03c4cd62247e7e1eeecb48dd58b8425d776c002fc3978808721c2dcbd68e87f2b0655299489db8a9d89e825bfc3c535de61181287f43ccd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gonative-cli (0.5.6)
4
+ gonative-cli (0.6.0)
5
5
  activesupport (~> 6.0)
6
6
  cocoapods (~> 1.10)
7
7
  colorize (~> 0.8.0)
@@ -8,7 +8,8 @@ module GoNative
8
8
  option :skip_build, type: :boolean, default: false
9
9
 
10
10
  def call(skip_build:, **)
11
- Plugins::IOS::Verify.call unless skip_build
11
+ Plugins::IOS::Verify.call
12
+ Plugins::IOS::BuildFramework.call unless skip_build
12
13
  Plugins::IOS::Release.call
13
14
  end
14
15
  end
@@ -0,0 +1,78 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cocoapods'
4
+ require 'xcodeproj'
5
+
6
+ module GoNative
7
+ module Plugins
8
+ module IOS
9
+ class BuildFramework
10
+ autoload :FileUtils, 'fileutils'
11
+
12
+ extend DSL::Serviceable
13
+
14
+ BUILD_TEMPLATE_DIRECTORY_PATH = File.expand_path(File.join(__dir__, '../../../..', 'templates', 'build', 'ios'))
15
+
16
+ attr_reader :plugin_name
17
+
18
+ def initialize
19
+ @plugin_name = Utils::SanitizePluginName.call(FileUtils.pwd.split('/').last, 'ios')
20
+ end
21
+
22
+ def call
23
+ setup_dirs
24
+ create_framework_proj
25
+ move_template_files
26
+ run_pod_install
27
+ chmod_frameworks_script!
28
+ build_framework!
29
+ ensure
30
+ FileUtils.cd('..')
31
+ FileUtils.rm_rf('build')
32
+ end
33
+
34
+ def setup_dirs
35
+ FileUtils.cd(plugin_name)
36
+ build_dir = File.join(FileUtils.pwd, 'build')
37
+ FileUtils.mkdir(build_dir)
38
+ FileUtils.cd(build_dir)
39
+ end
40
+
41
+ def create_framework_proj
42
+ proj = Xcodeproj::Project.new(FileUtils.pwd)
43
+ target = proj.new_target(:framework, "#{plugin_name}Framework", :ios, '10.0')
44
+ main_group = proj.new_group(plugin_name, plugin_name)
45
+ classes_group = main_group.new_group('Classes', 'Classes')
46
+ references = Dir.glob("../#{plugin_name}/Classes/**").map{ |file| classes_group.new_file("../../#{file}") }
47
+ target.add_file_references(references)
48
+ target.build_configurations.each do |config|
49
+ config.build_settings['GENERATE_INFOPLIST_FILE'] = 'YES'
50
+ end
51
+ proj.save("#{plugin_name}.xcodeproj")
52
+ end
53
+
54
+ def move_template_files
55
+ spec = Pod::Specification.from_file("../#{plugin_name}.podspec")
56
+ plugin_dependencies = spec.dependencies.map{|d| ["pod '#{d.name}'", "'#{d.requirement}'"].compact.join(', ') } * "\n\t"
57
+ FileUtils.cp_r("#{BUILD_TEMPLATE_DIRECTORY_PATH}/.", '.')
58
+ Utils::TemplateInflator.new(plugin_name: plugin_name, plugin_dependencies: plugin_dependencies).call
59
+ end
60
+
61
+ def run_pod_install
62
+ system 'pod install'
63
+ end
64
+
65
+ def chmod_frameworks_script!
66
+ FileUtils.chmod 0755, 'create-framework.sh'
67
+ end
68
+
69
+ def build_framework!
70
+ Utils::UI.info 'Building framework'
71
+ return if system('sh create-framework.sh >/dev/null 2>/dev/null')
72
+
73
+ raise Error, "Error building framework. Please run the create-framework file manually to fix any errors"
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
@@ -1,14 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'xcodeproj'
4
3
  require 'active_support/core_ext/string/inflections'
5
4
 
6
5
  module GoNative
7
6
  module Plugins
8
7
  module IOS
9
8
  class Create
10
- autoload :FileUtils, 'fileutils'
11
-
12
9
  extend DSL::Serviceable
13
10
 
14
11
  TEMPLATE_DIRECTORY_PATH = File.expand_path(File.join(__dir__, '../../../..', 'templates', 'plugins', 'ios'))
@@ -29,8 +26,6 @@ module GoNative
29
26
  cp_template_files!
30
27
  Utils::TemplateInflator.new(plugin_name: plugin_name).call
31
28
  chmod_frameworks_script!
32
- create_framework_proj!
33
- run_pod_install!
34
29
  end
35
30
 
36
31
  def assert_not_exists!
@@ -49,29 +44,6 @@ module GoNative
49
44
  system('ditto', File.join(TEMPLATE_DIRECTORY_PATH, 'language-specific', language), '.')
50
45
  end
51
46
 
52
- def chmod_frameworks_script!
53
- FileUtils.chmod 0755, 'create-framework.sh'
54
- end
55
-
56
- def create_framework_proj!
57
- proj = Xcodeproj::Project.new(FileUtils.pwd)
58
- target = proj.new_target(:framework, "#{plugin_name}Framework", :ios, '10.0')
59
- main_group = proj.new_group(plugin_name, plugin_name)
60
- classes_group = main_group.new_group('Classes', 'Classes')
61
- references = Dir.glob("#{plugin_name}/Classes/**").map{ |file| classes_group.new_file(file.split('/').last) }
62
- main_group.new_file('Info.plist')
63
- target.add_file_references(references)
64
- target.build_configurations.each do |config|
65
- config.build_settings['INFOPLIST_FILE'] = "$(SRCROOT)/#{plugin_name}/Info.plist"
66
- end
67
- proj.save("#{plugin_name}.xcodeproj")
68
- end
69
-
70
- def run_pod_install!
71
- system 'pod install'
72
- end
73
-
74
-
75
47
  def repo_name
76
48
  plugin_name.underscore.dasherize.prepend 'ios-'
77
49
  end
@@ -9,7 +9,6 @@ module GoNative
9
9
  def call
10
10
  assert_valid_plugin!
11
11
  assert_staging_clear!
12
- build_framework!
13
12
  end
14
13
 
15
14
  def assert_valid_plugin!
@@ -23,13 +22,6 @@ module GoNative
23
22
 
24
23
  raise Error, "There are uncommitted changes in the repository"
25
24
  end
26
-
27
- def build_framework!
28
- Utils::UI.info 'Building framework'
29
- return if system('sh create-framework.sh >/dev/null 2>/dev/null')
30
-
31
- raise Error, "Error building framework. Please run the create-framework file manually to fix any errors"
32
- end
33
25
  end
34
26
  end
35
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GoNative
4
- VERSION = "0.6.0"
4
+ VERSION = "0.7.0"
5
5
  end
@@ -5,5 +5,6 @@ source 'git@github.com:gonativeio/gonative-specs.git'
5
5
 
6
6
  target '#{plugin_name}Framework' do
7
7
  use_frameworks!
8
- pod '#{plugin_name}', path: '.'
8
+
9
+ #{plugin_dependencies}
9
10
  end
@@ -1,19 +1 @@
1
- Copyright (c) 2021 pureblood <hhunaid@gmail.com>
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
1
+ Licensing information available at https://gonative.io/
@@ -8,12 +8,13 @@ TODO: Add long description of the pod here.
8
8
  DESC
9
9
 
10
10
  s.homepage = 'https://github.com/gonativeio/#{plugin_name}'
11
- s.license = { :type => 'MIT', :file => 'LICENSE' }
11
+ s.license = { :type => 'Proprietary', :file => 'LICENSE' }
12
12
  s.author = { 'hhunaid' => 'hhunaid@gmail.com' }
13
13
  s.source = { :git => 'git@github.com:gonativeio/#{repo_name}.git', :tag => s.version.to_s }
14
14
 
15
15
  s.ios.deployment_target = '10.0'
16
16
  s.swift_versions = '5.0'
17
+ s.preserve_paths = 'plist/*.{plist}'
17
18
 
18
19
  s.subspec 'Source' do |cs|
19
20
  cs.source_files = '#{plugin_name}/Classes/**/*.{h,m,swift}'
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+
6
+ </dict>
7
+ </plist>
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: 0.6.0
4
+ version: 0.7.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: 2021-11-23 00:00:00.000000000 Z
11
+ date: 2021-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -195,6 +195,7 @@ files:
195
195
  - lib/gonative/dsl/error_catchable.rb
196
196
  - lib/gonative/dsl/serviceable.rb
197
197
  - lib/gonative/plugins/android/create.rb
198
+ - lib/gonative/plugins/ios/build_framework.rb
198
199
  - lib/gonative/plugins/ios/create.rb
199
200
  - lib/gonative/plugins/ios/release.rb
200
201
  - lib/gonative/plugins/ios/verify.rb
@@ -204,6 +205,8 @@ files:
204
205
  - lib/gonative/utils/template_inflator.rb
205
206
  - lib/gonative/utils/ui.rb
206
207
  - lib/gonative/version.rb
208
+ - templates/build/ios/Podfile.tpl
209
+ - templates/build/ios/create-framework.sh.tpl
207
210
  - templates/plugins/android/build.gradle
208
211
  - templates/plugins/android/consumer-rules.pro
209
212
  - templates/plugins/android/plugin-metadata.json.tpl
@@ -214,9 +217,8 @@ files:
214
217
  - templates/plugins/ios/common/LICENSE
215
218
  - templates/plugins/ios/common/PLUGIN_NAME.podspec.tpl
216
219
  - templates/plugins/ios/common/PLUGIN_NAME/Info.plist
217
- - templates/plugins/ios/common/Podfile.tpl
218
- - templates/plugins/ios/common/create-framework.sh.tpl
219
220
  - templates/plugins/ios/common/js/polyfill.js.tpl
221
+ - templates/plugins/ios/common/plist/Info.plist
220
222
  - templates/plugins/ios/language-specific/objc/PLUGIN_NAME/Classes/GNPLUGIN_NAME.h.tpl
221
223
  - templates/plugins/ios/language-specific/objc/PLUGIN_NAME/Classes/GNPLUGIN_NAME.m.tpl
222
224
  - templates/plugins/ios/language-specific/swift/PLUGIN_NAME/Classes/GNSwiftModule.m.tpl