gonative-cli 0.5.4 → 0.7.0
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/android/create.rb +17 -0
- data/lib/gonative/commands/ios/create.rb +1 -1
- data/lib/gonative/commands/ios/publish.rb +2 -1
- data/lib/gonative/commands.rb +1 -0
- data/lib/gonative/plugins/android/create.rb +54 -0
- data/lib/gonative/plugins/ios/build_framework.rb +78 -0
- data/lib/gonative/plugins/ios/create.rb +1 -55
- data/lib/gonative/plugins/ios/release.rb +3 -3
- data/lib/gonative/plugins/ios/verify.rb +0 -8
- data/lib/gonative/utils/content_evaluator.rb +16 -0
- data/lib/gonative/utils/sanitize_plugin_name.rb +17 -0
- data/lib/gonative/utils/template_inflator.rb +38 -8
- data/lib/gonative/{plugins.rb → utils.rb} +1 -1
- data/lib/gonative/version.rb +1 -1
- data/templates/{plugins/ios/common → build/ios}/Podfile.tpl +3 -2
- data/templates/{plugins/ios/common → build/ios}/create-framework.sh.tpl +4 -4
- data/templates/plugins/android/build.gradle +33 -0
- data/templates/plugins/android/consumer-rules.pro +0 -0
- data/templates/plugins/android/plugin-metadata.json.tpl +7 -0
- data/templates/plugins/android/proguard-rules.pro +21 -0
- data/templates/plugins/android/src/main/AndroidManifest.xml.tpl +5 -0
- data/templates/plugins/android/src/main/java/io/gonative/android/plugins/JAVA_PACKAGE/PLUGIN_NAME.java.tpl +26 -0
- data/templates/plugins/ios/common/LICENSE +1 -19
- data/templates/plugins/ios/common/PLUGIN_NAME.podspec.tpl +9 -8
- data/templates/plugins/ios/common/plist/Info.plist +7 -0
- data/templates/plugins/ios/language-specific/objc/PLUGIN_NAME/Classes/GNPLUGIN_NAME.h.tpl +3 -3
- data/templates/plugins/ios/language-specific/objc/PLUGIN_NAME/Classes/GNPLUGIN_NAME.m.tpl +4 -4
- data/templates/plugins/ios/language-specific/swift/PLUGIN_NAME/Classes/GNSwiftModule.m.tpl +3 -3
- data/templates/plugins/ios/language-specific/swift/PLUGIN_NAME/Classes/GNSwiftModule.swift.tpl +4 -4
- metadata +17 -6
- data/templates/plugins/ios/common/js/info.plist.json.tpl +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55b0e7973184f8e9bc0ff3bc8bba55ef782da09c076b586b310f3ffbf53777d7
|
4
|
+
data.tar.gz: 9857622f12a738bd94ea83f7a481acecbf2f18b47d64e02c07f6aacc4900ea18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5ceef6920dd707f7e404be1ddae19020b0b20bb028fa49ed0c79e1094c5e7898d188e511b6988638be1b436f5ea8554b182aa14c62a45ed605cc6267e3c54b0
|
7
|
+
data.tar.gz: 26ffb12906aa1fb7d03c4cd62247e7e1eeecb48dd58b8425d776c002fc3978808721c2dcbd68e87f2b0655299489db8a9d89e825bfc3c535de61181287f43ccd
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module GoNative
|
4
|
+
module Commands
|
5
|
+
module Android
|
6
|
+
class Create < Base
|
7
|
+
desc 'Create a new android plugin'
|
8
|
+
|
9
|
+
argument :name, required: true, desc: 'Name of the plugin'
|
10
|
+
|
11
|
+
def call(name:, **)
|
12
|
+
Plugins::Android::Create.call(name)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -7,7 +7,7 @@ module GoNative
|
|
7
7
|
desc 'Create a new plugin'
|
8
8
|
|
9
9
|
argument :name, required: true, desc: 'Name of the plugin'
|
10
|
-
option :language, default: "objc",
|
10
|
+
option :language, default: "objc", options: Plugins::IOS::Create::LANGUAGES, desc: "Plugin's language"
|
11
11
|
|
12
12
|
def call(name:, language:, **)
|
13
13
|
Plugins::IOS::Create.call(name, language)
|
@@ -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
|
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
|
data/lib/gonative/commands.rb
CHANGED
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/core_ext/string/inflections'
|
4
|
+
|
5
|
+
module GoNative
|
6
|
+
module Plugins
|
7
|
+
module Android
|
8
|
+
class Create
|
9
|
+
autoload :FileUtils, 'fileutils'
|
10
|
+
|
11
|
+
extend DSL::Serviceable
|
12
|
+
|
13
|
+
TEMPLATE_DIRECTORY_PATH = File.expand_path(File.join(__dir__, '../../../..', 'templates', 'plugins', 'android'))
|
14
|
+
|
15
|
+
attr_reader :plugin_name
|
16
|
+
|
17
|
+
def initialize(plugin_name)
|
18
|
+
@plugin_name = Utils::SanitizePluginName.call(plugin_name, 'android')
|
19
|
+
end
|
20
|
+
|
21
|
+
def call
|
22
|
+
assert_not_exists!
|
23
|
+
set_working_dir!
|
24
|
+
cp_template_files!
|
25
|
+
Utils::TemplateInflator.new(plugin_name: capitalized_plugin_name, java_package: java_package).call
|
26
|
+
end
|
27
|
+
|
28
|
+
def assert_not_exists!
|
29
|
+
return unless File.directory?(plugin_name)
|
30
|
+
|
31
|
+
raise Error, "Directory #{plugin_name} already exists"
|
32
|
+
end
|
33
|
+
|
34
|
+
def set_working_dir!
|
35
|
+
FileUtils.mkdir(plugin_name)
|
36
|
+
FileUtils.cd(plugin_name)
|
37
|
+
end
|
38
|
+
|
39
|
+
def cp_template_files!
|
40
|
+
FileUtils.cp_r("#{TEMPLATE_DIRECTORY_PATH}/.", '.')
|
41
|
+
system('ditto', TEMPLATE_DIRECTORY_PATH, '.')
|
42
|
+
end
|
43
|
+
|
44
|
+
def capitalized_plugin_name
|
45
|
+
[plugin_name, 'plugin'].join('_').camelize
|
46
|
+
end
|
47
|
+
|
48
|
+
def java_package
|
49
|
+
plugin_name
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
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'))
|
@@ -27,10 +24,8 @@ module GoNative
|
|
27
24
|
assert_not_exists!
|
28
25
|
set_working_dir!
|
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,55 +44,6 @@ module GoNative
|
|
49
44
|
system('ditto', File.join(TEMPLATE_DIRECTORY_PATH, 'language-specific', language), '.')
|
50
45
|
end
|
51
46
|
|
52
|
-
def inflate_templates!
|
53
|
-
Dir.glob('*/').each do |dir|
|
54
|
-
FileUtils.cd(dir)
|
55
|
-
inflate_templates!
|
56
|
-
FileUtils.cd('..')
|
57
|
-
dir_name = dir.delete_suffix('/')
|
58
|
-
normalized_name = normalized_name(dir_name)
|
59
|
-
FileUtils.mv(dir_name, normalized_name) if dir_name != normalized_name
|
60
|
-
end
|
61
|
-
inflate_files
|
62
|
-
end
|
63
|
-
|
64
|
-
def chmod_frameworks_script!
|
65
|
-
FileUtils.chmod 0755, 'create-framework.sh'
|
66
|
-
end
|
67
|
-
|
68
|
-
def create_framework_proj!
|
69
|
-
proj = Xcodeproj::Project.new(FileUtils.pwd)
|
70
|
-
target = proj.new_target(:framework, "#{plugin_name}Framework", :ios, '10.0')
|
71
|
-
main_group = proj.new_group(plugin_name, plugin_name)
|
72
|
-
classes_group = main_group.new_group('Classes', 'Classes')
|
73
|
-
references = Dir.glob("#{plugin_name}/Classes/**").map{ |file| classes_group.new_file(file.split('/').last) }
|
74
|
-
main_group.new_file('Info.plist')
|
75
|
-
target.add_file_references(references)
|
76
|
-
target.build_configurations.each do |config|
|
77
|
-
config.build_settings['INFOPLIST_FILE'] = "$(SRCROOT)/#{plugin_name}/Info.plist"
|
78
|
-
end
|
79
|
-
proj.save("#{plugin_name}.xcodeproj")
|
80
|
-
end
|
81
|
-
|
82
|
-
def run_pod_install!
|
83
|
-
system 'pod install'
|
84
|
-
end
|
85
|
-
|
86
|
-
def inflate_files
|
87
|
-
Dir.glob("*#{TEMPLATE_FILES_EXTENSION}").each do |file|
|
88
|
-
File.write(normalized_name(file), contents(file))
|
89
|
-
FileUtils.rm(file)
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
def normalized_name(file)
|
94
|
-
file.gsub('PLUGIN_NAME', plugin_name).delete_suffix(TEMPLATE_FILES_EXTENSION)
|
95
|
-
end
|
96
|
-
|
97
|
-
def contents(file)
|
98
|
-
Utils::TemplateInflator.new(File.read(file)).call(PLUGIN_NAME: plugin_name, REPO_NAME: repo_name)
|
99
|
-
end
|
100
|
-
|
101
47
|
def repo_name
|
102
48
|
plugin_name.underscore.dasherize.prepend 'ios-'
|
103
49
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'cocoapods'
|
4
4
|
|
5
5
|
module GoNative
|
6
6
|
module Plugins
|
@@ -53,7 +53,7 @@ module GoNative
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def spec
|
56
|
-
@spec ||=
|
56
|
+
@spec ||= Pod::Specification.from_file(spec_name)
|
57
57
|
end
|
58
58
|
|
59
59
|
def source
|
@@ -61,7 +61,7 @@ module GoNative
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def sources_manager
|
64
|
-
|
64
|
+
Pod::Config.instance.sources_manager
|
65
65
|
end
|
66
66
|
end
|
67
67
|
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
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ostruct'
|
4
|
+
|
5
|
+
module GoNative
|
6
|
+
module Utils
|
7
|
+
class ContentEvaluator
|
8
|
+
class << self
|
9
|
+
def call(content, values)
|
10
|
+
o = OpenStruct.new(values)
|
11
|
+
o.instance_eval('"' + content.gsub('"', '\\\\"') + '"')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/core_ext/string/inflections'
|
4
|
+
|
5
|
+
module GoNative
|
6
|
+
module Utils
|
7
|
+
class SanitizePluginName
|
8
|
+
class << self
|
9
|
+
def call(raw_name, platform)
|
10
|
+
name_components = raw_name.underscore.dasherize.split('-') - ['plugin', platform]
|
11
|
+
|
12
|
+
name_components.join('-')
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -3,19 +3,49 @@
|
|
3
3
|
module GoNative
|
4
4
|
module Utils
|
5
5
|
class TemplateInflator
|
6
|
-
|
7
|
-
|
6
|
+
autoload :FileUtils, 'fileutils'
|
7
|
+
|
8
|
+
extend DSL::Serviceable
|
9
|
+
|
10
|
+
def initialize(options)
|
11
|
+
@options = options
|
8
12
|
end
|
9
|
-
|
10
|
-
def call
|
11
|
-
|
12
|
-
|
13
|
-
|
13
|
+
|
14
|
+
def call
|
15
|
+
Dir.glob('*/').each do |dir|
|
16
|
+
FileUtils.cd(dir)
|
17
|
+
call
|
18
|
+
FileUtils.cd('..')
|
19
|
+
dir_name = dir.delete_suffix('/')
|
20
|
+
normalized_name = normalized_name(dir_name)
|
21
|
+
FileUtils.mv(dir_name, normalized_name) if dir_name != normalized_name
|
22
|
+
end
|
23
|
+
inflate_files
|
24
|
+
end
|
25
|
+
|
26
|
+
def inflate_files
|
27
|
+
Dir.glob("*#{TEMPLATE_FILES_EXTENSION}").each do |file|
|
28
|
+
File.write(normalized_name(file), contents(file))
|
29
|
+
FileUtils.rm(file)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def contents(file)
|
34
|
+
content = File.read(file)
|
35
|
+
Utils::ContentEvaluator.call(content, options)
|
36
|
+
end
|
37
|
+
|
38
|
+
def normalized_name(file_name)
|
39
|
+
new_name = file_name.dup
|
40
|
+
options.each do |key, value|
|
41
|
+
new_name.gsub!(key.to_s.upcase, value)
|
42
|
+
end
|
43
|
+
new_name.delete_suffix(TEMPLATE_FILES_EXTENSION)
|
14
44
|
end
|
15
45
|
|
16
46
|
private
|
17
47
|
|
18
|
-
attr_reader :
|
48
|
+
attr_reader :options
|
19
49
|
end
|
20
50
|
end
|
21
51
|
end
|
data/lib/gonative/version.rb
CHANGED
@@ -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 '{
|
6
|
+
target '#{plugin_name}Framework' do
|
7
7
|
use_frameworks!
|
8
|
-
|
8
|
+
|
9
|
+
#{plugin_dependencies}
|
9
10
|
end
|
@@ -5,11 +5,11 @@ WORKING_DIR=$(pwd)
|
|
5
5
|
|
6
6
|
FRAMEWORK_FOLDER_NAME="XCFramework"
|
7
7
|
|
8
|
-
FRAMEWORK_NAME="{
|
8
|
+
FRAMEWORK_NAME="#{plugin_name}"
|
9
9
|
|
10
10
|
FRAMEWORK_PATH="${WORKING_DIR}/${FRAMEWORK_FOLDER_NAME}/${FRAMEWORK_NAME}.xcframework"
|
11
11
|
|
12
|
-
BUILD_SCHEME="{
|
12
|
+
BUILD_SCHEME="#{plugin_name}Framework"
|
13
13
|
|
14
14
|
SIMULATOR_ARCHIVE_PATH="${WORKING_DIR}/${FRAMEWORK_FOLDER_NAME}/simulator.xcarchive"
|
15
15
|
|
@@ -21,9 +21,9 @@ mkdir "${FRAMEWORK_FOLDER_NAME}"
|
|
21
21
|
echo "Created ${FRAMEWORK_FOLDER_NAME}"
|
22
22
|
echo "Archiving ${FRAMEWORK_NAME}"
|
23
23
|
|
24
|
-
xcodebuild -workspace "{
|
24
|
+
xcodebuild -workspace "#{plugin_name}.xcworkspace" archive ONLY_ACTIVE_ARCH=NO ARCHS="x86_64 arm64 i386" -scheme ${BUILD_SCHEME} -destination="generic/platform=iOS Simulator" -archivePath "${SIMULATOR_ARCHIVE_PATH}" -sdk iphonesimulator SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
|
25
25
|
|
26
|
-
xcodebuild archive -workspace "{
|
26
|
+
xcodebuild archive -workspace "#{plugin_name}.xcworkspace" -scheme ${BUILD_SCHEME} -destination="generic/platform=iOS" -archivePath "${IOS_DEVICE_ARCHIVE_PATH}" -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
|
27
27
|
|
28
28
|
xcodebuild -create-xcframework -framework ${SIMULATOR_ARCHIVE_PATH}/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework -framework ${IOS_DEVICE_ARCHIVE_PATH}/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework -output "${FRAMEWORK_PATH}"
|
29
29
|
|
@@ -0,0 +1,33 @@
|
|
1
|
+
plugins {
|
2
|
+
id 'com.android.library'
|
3
|
+
}
|
4
|
+
|
5
|
+
android {
|
6
|
+
compileSdkVersion 30
|
7
|
+
|
8
|
+
defaultConfig {
|
9
|
+
minSdkVersion 16
|
10
|
+
targetSdkVersion 30
|
11
|
+
versionCode 1
|
12
|
+
versionName "1.0"
|
13
|
+
|
14
|
+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
15
|
+
consumerProguardFiles "consumer-rules.pro"
|
16
|
+
}
|
17
|
+
|
18
|
+
buildTypes {
|
19
|
+
release {
|
20
|
+
minifyEnabled false
|
21
|
+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
22
|
+
}
|
23
|
+
}
|
24
|
+
compileOptions {
|
25
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
26
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
dependencies {
|
31
|
+
implementation "io.gonative.android:library:+"
|
32
|
+
api project(':gonative-core')
|
33
|
+
}
|
File without changes
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Add project specific ProGuard rules here.
|
2
|
+
# You can control the set of applied configuration files using the
|
3
|
+
# proguardFiles setting in build.gradle.
|
4
|
+
#
|
5
|
+
# For more details, see
|
6
|
+
# http://developer.android.com/guide/developing/tools/proguard.html
|
7
|
+
|
8
|
+
# If your project uses WebView with JS, uncomment the following
|
9
|
+
# and specify the fully qualified class name to the JavaScript interface
|
10
|
+
# class:
|
11
|
+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
12
|
+
# public *;
|
13
|
+
#}
|
14
|
+
|
15
|
+
# Uncomment this to preserve the line number information for
|
16
|
+
# debugging stack traces.
|
17
|
+
#-keepattributes SourceFile,LineNumberTable
|
18
|
+
|
19
|
+
# If you keep the line number information, uncomment this to
|
20
|
+
# hide the original source file name.
|
21
|
+
#-renamesourcefileattribute SourceFile
|
@@ -0,0 +1,26 @@
|
|
1
|
+
package io.gonative.android.plugins.#{java_package};
|
2
|
+
|
3
|
+
import android.app.Activity;
|
4
|
+
import android.content.Context;
|
5
|
+
|
6
|
+
import io.gonative.gonative_core.BridgeModule;
|
7
|
+
import io.gonative.gonative_core.GoNativeActivity;
|
8
|
+
|
9
|
+
public class #{plugin_name} implements BridgeModule {
|
10
|
+
private final static String TAG = #{plugin_name}.class.getSimpleName();
|
11
|
+
|
12
|
+
@Override
|
13
|
+
public void onApplicationCreate(Context context) {
|
14
|
+
|
15
|
+
}
|
16
|
+
|
17
|
+
@Override
|
18
|
+
public <T extends Activity & GoNativeActivity> void onActivityCreate(T activity, boolean isRoot) {
|
19
|
+
|
20
|
+
}
|
21
|
+
|
22
|
+
@Override
|
23
|
+
public <T extends Activity & GoNativeActivity> boolean shouldOverrideUrlLoading(T activity, Uri uri) {
|
24
|
+
return false;
|
25
|
+
}
|
26
|
+
}
|
@@ -1,19 +1 @@
|
|
1
|
-
|
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/
|
@@ -1,5 +1,5 @@
|
|
1
1
|
Pod::Spec.new do |s|
|
2
|
-
s.name = '{
|
2
|
+
s.name = '#{plugin_name}'
|
3
3
|
s.version = '0.1.0'
|
4
4
|
s.summary = 'Facebook plugin for GoNative.'
|
5
5
|
|
@@ -7,22 +7,23 @@ Pod::Spec.new do |s|
|
|
7
7
|
TODO: Add long description of the pod here.
|
8
8
|
DESC
|
9
9
|
|
10
|
-
s.homepage = 'https://github.com/gonativeio
|
11
|
-
s.license = { :type => '
|
10
|
+
s.homepage = 'https://github.com/gonativeio/#{plugin_name}'
|
11
|
+
s.license = { :type => 'Proprietary', :file => 'LICENSE' }
|
12
12
|
s.author = { 'hhunaid' => 'hhunaid@gmail.com' }
|
13
|
-
s.source = { :git => 'git@github.com:gonativeio
|
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
|
-
cs.source_files = '{
|
20
|
-
cs.resource_bundle = { 'JS' => 'js/*.{js,json}' }
|
20
|
+
cs.source_files = '#{plugin_name}/Classes/**/*.{h,m,swift}'
|
21
|
+
cs.resource_bundle = { '#{plugin_name}JS' => 'js/*.{js,json}' }
|
21
22
|
end
|
22
23
|
|
23
24
|
s.subspec 'Binary' do |cs|
|
24
|
-
cs.ios.vendored_frameworks = 'XCFramework
|
25
|
-
cs.resource_bundle = { 'JS' => 'js/*.{js,json}' }
|
25
|
+
cs.ios.vendored_frameworks = 'XCFramework/#{plugin_name}.xcframework'
|
26
|
+
cs.resource_bundle = { '#{plugin_name}JS' => 'js/*.{js,json}' }
|
26
27
|
end
|
27
28
|
|
28
29
|
s.default_subspec = 'Source'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
//
|
2
|
-
// GN{
|
3
|
-
// {
|
2
|
+
// GN#{plugin_name}.h
|
3
|
+
// #{plugin_name}
|
4
4
|
//
|
5
5
|
// Created by Hunaid Hassan.
|
6
6
|
//
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
NS_ASSUME_NONNULL_BEGIN
|
12
12
|
|
13
|
-
@interface GN{
|
13
|
+
@interface GN#{plugin_name} : GNEventEmitter
|
14
14
|
|
15
15
|
@end
|
16
16
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
//
|
2
|
-
// GN{
|
3
|
-
// {
|
2
|
+
// GN#{plugin_name}.m
|
3
|
+
// #{plugin_name}
|
4
4
|
//
|
5
5
|
// Created by Hunaid Hassan.
|
6
6
|
//
|
7
7
|
|
8
|
-
#import "GN{
|
8
|
+
#import "GN#{plugin_name}.h"
|
9
9
|
|
10
|
-
@implementation GN{
|
10
|
+
@implementation GN#{plugin_name}
|
11
11
|
|
12
12
|
GN_EXPORT_MODULE()
|
13
13
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
//
|
2
|
-
// GN{
|
3
|
-
// {
|
2
|
+
// GN#{plugin_name}.m
|
3
|
+
// #{plugin_name}
|
4
4
|
//
|
5
5
|
// Created by Hunaid Hassan.
|
6
6
|
//
|
7
7
|
|
8
8
|
#import <GoNativeCore/GNEventEmitter.h>
|
9
9
|
|
10
|
-
@interface GN_EXTERN_MODULE(GN{
|
10
|
+
@interface GN_EXTERN_MODULE(GN#{plugin_name}, GNEventEmitter)
|
11
11
|
|
12
12
|
@end
|
data/templates/plugins/ios/language-specific/swift/PLUGIN_NAME/Classes/GNSwiftModule.swift.tpl
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
//
|
2
|
-
// GN{
|
3
|
-
// {
|
2
|
+
// GN#{plugin_name}.swift
|
3
|
+
// #{plugin_name}
|
4
4
|
//
|
5
5
|
// Created by Hunaid Hassan on.
|
6
6
|
//
|
@@ -8,7 +8,7 @@
|
|
8
8
|
import Foundation
|
9
9
|
import GoNativeCore
|
10
10
|
|
11
|
-
@objc(GN{
|
12
|
-
public class GN{
|
11
|
+
@objc(GN#{plugin_name})
|
12
|
+
public class GN#{plugin_name}: GNEventEmitter {
|
13
13
|
|
14
14
|
}
|
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.
|
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
|
+
date: 2021-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-cli
|
@@ -187,27 +187,38 @@ files:
|
|
187
187
|
- gonative-cli.gemspec
|
188
188
|
- lib/gonative.rb
|
189
189
|
- lib/gonative/commands.rb
|
190
|
+
- lib/gonative/commands/android/create.rb
|
190
191
|
- lib/gonative/commands/base.rb
|
191
192
|
- lib/gonative/commands/ios/create.rb
|
192
193
|
- lib/gonative/commands/ios/publish.rb
|
193
194
|
- lib/gonative/commands/version.rb
|
194
195
|
- lib/gonative/dsl/error_catchable.rb
|
195
196
|
- lib/gonative/dsl/serviceable.rb
|
196
|
-
- lib/gonative/plugins.rb
|
197
|
+
- lib/gonative/plugins/android/create.rb
|
198
|
+
- lib/gonative/plugins/ios/build_framework.rb
|
197
199
|
- lib/gonative/plugins/ios/create.rb
|
198
200
|
- lib/gonative/plugins/ios/release.rb
|
199
201
|
- lib/gonative/plugins/ios/verify.rb
|
202
|
+
- lib/gonative/utils.rb
|
203
|
+
- lib/gonative/utils/content_evaluator.rb
|
204
|
+
- lib/gonative/utils/sanitize_plugin_name.rb
|
200
205
|
- lib/gonative/utils/template_inflator.rb
|
201
206
|
- lib/gonative/utils/ui.rb
|
202
207
|
- lib/gonative/version.rb
|
208
|
+
- templates/build/ios/Podfile.tpl
|
209
|
+
- templates/build/ios/create-framework.sh.tpl
|
210
|
+
- templates/plugins/android/build.gradle
|
211
|
+
- templates/plugins/android/consumer-rules.pro
|
212
|
+
- templates/plugins/android/plugin-metadata.json.tpl
|
213
|
+
- templates/plugins/android/proguard-rules.pro
|
214
|
+
- templates/plugins/android/src/main/AndroidManifest.xml.tpl
|
215
|
+
- templates/plugins/android/src/main/java/io/gonative/android/plugins/JAVA_PACKAGE/PLUGIN_NAME.java.tpl
|
203
216
|
- templates/plugins/ios/common/.gitignore
|
204
217
|
- templates/plugins/ios/common/LICENSE
|
205
218
|
- templates/plugins/ios/common/PLUGIN_NAME.podspec.tpl
|
206
219
|
- templates/plugins/ios/common/PLUGIN_NAME/Info.plist
|
207
|
-
- templates/plugins/ios/common/Podfile.tpl
|
208
|
-
- templates/plugins/ios/common/create-framework.sh.tpl
|
209
|
-
- templates/plugins/ios/common/js/info.plist.json.tpl
|
210
220
|
- templates/plugins/ios/common/js/polyfill.js.tpl
|
221
|
+
- templates/plugins/ios/common/plist/Info.plist
|
211
222
|
- templates/plugins/ios/language-specific/objc/PLUGIN_NAME/Classes/GNPLUGIN_NAME.h.tpl
|
212
223
|
- templates/plugins/ios/language-specific/objc/PLUGIN_NAME/Classes/GNPLUGIN_NAME.m.tpl
|
213
224
|
- templates/plugins/ios/language-specific/swift/PLUGIN_NAME/Classes/GNSwiftModule.m.tpl
|
@@ -1 +0,0 @@
|
|
1
|
-
{}
|