gonative-cli 0.6.0 → 0.7.3

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: a7fe385bb7b91cc2a04c38299a0303e95b1b662ed2107cefc55beb6c0963b833
4
+ data.tar.gz: 3b6a4fb67df32ce8241b0f606799cdf9d4d40da95ba93b237a5a8fdb4ec934aa
5
5
  SHA512:
6
- metadata.gz: 1f8d324a15a04236a1b0f4549f7b811cfb7faaa9de53ad1de899d9894d3b1d23bc937e84c9f15b1242b6998b04329fba699aef7f6d503ed1f785215f20014127
7
- data.tar.gz: 61f6dc8ca394e5c11652214811161aecb7c55bc59f34a7d31bbf323ba1b07dc6e09b3edee31542d1df3c718f8cbe766fb6b8be74c33d67cc72bee7d8d3519290
6
+ metadata.gz: e0f823c2455d016c2f274c63ebaf786655095d03b95dd44bf02846d9e9a7f1873559940c2a8809da675104056d8fe292c3b1488ffd3fa0eaac27116fa37aa3c4
7
+ data.tar.gz: 00b1ce09d6eba836fcdd56fc82338551809fe195efa5e092c7a547faaa9ea67a66ccd60e6562af4fe7fbf2a9557212d6732aaea447bcc26602fda04305d54a9e
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.7.2)
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,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cocoapods'
4
+ require 'xcodeproj'
5
+ require 'active_support/core_ext/string/inflections'
6
+
7
+ module GoNative
8
+ module Plugins
9
+ module IOS
10
+ class BuildFramework
11
+ autoload :FileUtils, 'fileutils'
12
+
13
+ extend DSL::Serviceable
14
+
15
+ BUILD_TEMPLATE_DIRECTORY_PATH = File.expand_path(File.join(__dir__, '../../../..', 'templates', 'build', 'ios'))
16
+
17
+ attr_reader :plugin_name
18
+
19
+ def initialize
20
+ @plugin_name = Utils::SanitizePluginName.call(FileUtils.pwd.split('/').last, 'ios').capitalize + 'Plugin'
21
+ end
22
+
23
+ def call
24
+ setup_dirs
25
+ create_framework_proj
26
+ move_template_files
27
+ run_pod_install
28
+ chmod_frameworks_script!
29
+ build_framework!
30
+ move_framework_file
31
+ ensure
32
+ FileUtils.cd('..')
33
+ FileUtils.rm_rf('build')
34
+ end
35
+
36
+ def setup_dirs
37
+ build_dir = File.join(FileUtils.pwd, 'build')
38
+ FileUtils.mkdir(build_dir)
39
+ FileUtils.cd(build_dir)
40
+ end
41
+
42
+ def create_framework_proj
43
+ proj = Xcodeproj::Project.new(FileUtils.pwd)
44
+ target = proj.new_target(:framework, "#{plugin_name}", :ios, '10.0')
45
+ main_group = proj.new_group(plugin_name, plugin_name)
46
+ classes_group = main_group.new_group('Classes', 'Classes')
47
+ references = Dir.glob("../#{plugin_name}/Classes/**").map{ |file| classes_group.new_file("../../#{file}") }
48
+ target.add_file_references(references)
49
+ target.build_configurations.each do |config|
50
+ config.build_settings['GENERATE_INFOPLIST_FILE'] = 'YES'
51
+ end
52
+ proj.save("#{plugin_name}.xcodeproj")
53
+ end
54
+
55
+ def move_template_files
56
+ spec = Pod::Specification.from_file("../#{plugin_name}.podspec")
57
+ plugin_dependencies = spec.dependencies.map{|d| ["pod '#{d.name}'", "'#{d.requirement}'"].compact.join(', ') } * "\n\t"
58
+ FileUtils.cp_r("#{BUILD_TEMPLATE_DIRECTORY_PATH}/.", '.')
59
+ Utils::TemplateInflator.new(plugin_name: plugin_name, plugin_dependencies: plugin_dependencies).call
60
+ end
61
+
62
+ def run_pod_install
63
+ system 'pod install'
64
+ end
65
+
66
+ def chmod_frameworks_script!
67
+ FileUtils.chmod 0755, 'create-framework.sh'
68
+ end
69
+
70
+ def build_framework!
71
+ Utils::UI.info 'Building framework'
72
+ return if system('sh create-framework.sh >/dev/null 2>/dev/null')
73
+
74
+ raise Error, "Error building framework. Please run the create-framework file manually to fix any errors"
75
+ end
76
+
77
+ def move_framework_file
78
+ FileUtils.mv("XCFramework", '..', force: true)
79
+ end
80
+ end
81
+ end
82
+ end
83
+ 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
@@ -7,15 +7,7 @@ module GoNative
7
7
  extend DSL::Serviceable
8
8
 
9
9
  def call
10
- assert_valid_plugin!
11
10
  assert_staging_clear!
12
- build_framework!
13
- end
14
-
15
- def assert_valid_plugin!
16
- return if File.file?('create-framework.sh')
17
-
18
- raise Error, "File 'create-framework.sh' does not exist. Please make sure this is a valid GoNative plugin directory"
19
11
  end
20
12
 
21
13
  def assert_staging_clear!
@@ -23,13 +15,6 @@ module GoNative
23
15
 
24
16
  raise Error, "There are uncommitted changes in the repository"
25
17
  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
18
  end
34
19
  end
35
20
  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.3"
5
5
  end
@@ -3,7 +3,8 @@ platform :ios, '10.0'
3
3
  source 'https://cdn.cocoapods.org/'
4
4
  source 'git@github.com:gonativeio/gonative-specs.git'
5
5
 
6
- target '#{plugin_name}Framework' do
6
+ target '#{plugin_name}' do
7
7
  use_frameworks!
8
- pod '#{plugin_name}', path: '.'
8
+
9
+ #{plugin_dependencies}
9
10
  end
@@ -9,7 +9,7 @@ FRAMEWORK_NAME="#{plugin_name}"
9
9
 
10
10
  FRAMEWORK_PATH="${WORKING_DIR}/${FRAMEWORK_FOLDER_NAME}/${FRAMEWORK_NAME}.xcframework"
11
11
 
12
- BUILD_SCHEME="#{plugin_name}Framework"
12
+ BUILD_SCHEME="#{plugin_name}"
13
13
 
14
14
  SIMULATOR_ARCHIVE_PATH="${WORKING_DIR}/${FRAMEWORK_FOLDER_NAME}/simulator.xcarchive"
15
15
 
@@ -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.3
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