fastlane-plugin-xamarin_native 0.1.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 +7 -0
- data/LICENSE +21 -0
- data/README.md +66 -0
- data/lib/fastlane/plugin/xamarin_native/actions/bump_code.rb +114 -0
- data/lib/fastlane/plugin/xamarin_native/actions/bump_version.rb +157 -0
- data/lib/fastlane/plugin/xamarin_native/actions/msbuild.rb +187 -0
- data/lib/fastlane/plugin/xamarin_native/actions/nuget.rb +45 -0
- data/lib/fastlane/plugin/xamarin_native/helper/xamarin_native_helper.rb +45 -0
- data/lib/fastlane/plugin/xamarin_native/version.rb +5 -0
- data/lib/fastlane/plugin/xamarin_native.rb +16 -0
- metadata +219 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d4666af6955d74348e9baca8a898f1165b66a22a5cd93dbab5319ff73f7f0e4c
|
4
|
+
data.tar.gz: dd18f6a4fc75e2918dc9400745ec6c1ed32524d767b66cf3cacde6164d3079ce
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 48ac2ba499c20ec16a41d44a187e0eb4218b0d3c33bf22def6510d3695caadcdab0beea37f31858fd0ff9944811ffb1e1a5b35324c142f337f4379b93326aee8
|
7
|
+
data.tar.gz: 33e7e429cb81f46d26e3ddd1b4dd2c24d3a025fd516e80e8569e428a43ba5fe17951dab2760a93b147c60e5de78f695b7f039bb6fdaa54cd3f7962ea5e135ae3
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2023 Anna Gulich <ag@nordic-it.com>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# xamarin_native plugin
|
2
|
+
|
3
|
+
[](https://rubygems.org/gems/fastlane-plugin-xamarin_native)
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-xamarin_native`, add it to your project by running:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
fastlane add_plugin xamarin_native
|
11
|
+
```
|
12
|
+
|
13
|
+
## About xamarin_native
|
14
|
+
|
15
|
+
Plugin for Xamarin.Native iOS and Android projects
|
16
|
+
|
17
|
+
## Actions
|
18
|
+
|
19
|
+
### nuget
|
20
|
+
|
21
|
+
restore NuGet packages for solution
|
22
|
+
|
23
|
+
### msbuild
|
24
|
+
|
25
|
+
build Xamarin.Native.iOS or Xamarin.Native.Android project or solution using msbuild tool
|
26
|
+
|
27
|
+
### bump_version
|
28
|
+
|
29
|
+
increment project version (for iOS increment CFBundleShortVersionString in info plist, for Android - android:versionName in AndroidManifest.xml)
|
30
|
+
|
31
|
+
### bump_code
|
32
|
+
|
33
|
+
increment project build number (for iOS increment CFBundleVersion in info plist, for Android - android:versionCode in AndroidManifest.xml)
|
34
|
+
|
35
|
+
## Example
|
36
|
+
|
37
|
+
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
38
|
+
|
39
|
+
## Run tests for this plugin
|
40
|
+
|
41
|
+
To run both the tests, and code style validation, run
|
42
|
+
|
43
|
+
```
|
44
|
+
rake
|
45
|
+
```
|
46
|
+
|
47
|
+
To automatically fix many of the styling issues, use
|
48
|
+
```
|
49
|
+
rubocop -a
|
50
|
+
```
|
51
|
+
|
52
|
+
## Issues and Feedback
|
53
|
+
|
54
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
55
|
+
|
56
|
+
## Troubleshooting
|
57
|
+
|
58
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
59
|
+
|
60
|
+
## Using _fastlane_ Plugins
|
61
|
+
|
62
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
63
|
+
|
64
|
+
## About _fastlane_
|
65
|
+
|
66
|
+
_fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,114 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require 'plist'
|
3
|
+
require 'nokogiri'
|
4
|
+
require_relative '../helper/xamarin_native_helper'
|
5
|
+
|
6
|
+
module Fastlane
|
7
|
+
module Actions
|
8
|
+
class BumpCodeAction < Action
|
9
|
+
|
10
|
+
PLATFORM = %w(iOS Android).freeze
|
11
|
+
|
12
|
+
def self.run(params)
|
13
|
+
if params[:platform] == 'iOS'
|
14
|
+
bump_build_number_ios(params)
|
15
|
+
else
|
16
|
+
bump_build_number_android(params)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.description
|
21
|
+
"Increments project build number"
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.authors
|
25
|
+
["illania"]
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
def self.bump_build_number_ios(params)
|
30
|
+
begin
|
31
|
+
params[:info_plist_pathes].each do |path|
|
32
|
+
current_build_number = get_info_plist_build_number(path)
|
33
|
+
new_build_number = (current_build_number.to_i+1).to_s
|
34
|
+
set_info_plist_build_number(path, new_build_number)
|
35
|
+
end
|
36
|
+
rescue => ex
|
37
|
+
UI.error(ex)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.get_info_plist_build_number(path)
|
42
|
+
begin
|
43
|
+
path = File.expand_path(path)
|
44
|
+
plist = File.open(path) { |f| Plist.parse_xml(f) }
|
45
|
+
value = plist['CFBundleVersion']
|
46
|
+
return value
|
47
|
+
rescue => ex
|
48
|
+
UI.error(ex)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.set_info_plist_build_number(path, new_build_number)
|
53
|
+
begin
|
54
|
+
path = File.expand_path(path)
|
55
|
+
plist = Plist.parse_xml(path)
|
56
|
+
plist['CFBundleVersion'] = new_build_number
|
57
|
+
new_plist = Plist::Emit.dump(plist)
|
58
|
+
File.write(path, new_plist)
|
59
|
+
rescue => ex
|
60
|
+
UI.error(ex)
|
61
|
+
UI.user_error!("Unable to set build number '#{new_build_number}' to plist file at '#{path}'")
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
|
66
|
+
def self.bump_build_number_android(params)
|
67
|
+
begin
|
68
|
+
doc = File.open(params[:manifest_file_path]) { |f|
|
69
|
+
@doc = Nokogiri::XML(f)
|
70
|
+
manifest_node = @doc.xpath('//manifest')
|
71
|
+
current_build_number = @doc.at('//manifest/@android:versionCode').text
|
72
|
+
new_build_number = (current_build_number.to_i+1).to_s
|
73
|
+
manifest_node.attr('android:versionCode', new_build_number)
|
74
|
+
File.write(params[:manifest_file_path], @doc.to_xml)
|
75
|
+
}
|
76
|
+
rescue => ex
|
77
|
+
UI.error(ex)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.available_options
|
82
|
+
[
|
83
|
+
FastlaneCore::ConfigItem.new(
|
84
|
+
key: :platform,
|
85
|
+
env_name: 'FL_XN_BUILD_VERSION_PLATFORM',
|
86
|
+
description: 'iOS or Android',
|
87
|
+
type: String,
|
88
|
+
optional: false
|
89
|
+
),
|
90
|
+
FastlaneCore::ConfigItem.new(
|
91
|
+
key: :info_plist_pathes,
|
92
|
+
env_name: 'FL_XN_BUILD_VERSION_INFO_PLIST_PATHES',
|
93
|
+
description: 'Info plist pathes',
|
94
|
+
type: Array,
|
95
|
+
optional: false
|
96
|
+
),
|
97
|
+
FastlaneCore::ConfigItem.new(
|
98
|
+
key: :manifest_file_path,
|
99
|
+
env_name: 'FL_XN_BUILD_VERSION_MANIFEST_FILE_PATH',
|
100
|
+
description: 'Android Manifest file path',
|
101
|
+
type: String,
|
102
|
+
optional: false
|
103
|
+
)
|
104
|
+
]
|
105
|
+
end
|
106
|
+
|
107
|
+
def self.is_supported?(platform)
|
108
|
+
[:ios, :android].include?(platform)
|
109
|
+
true
|
110
|
+
end
|
111
|
+
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
@@ -0,0 +1,157 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require 'plist'
|
3
|
+
require 'nokogiri'
|
4
|
+
require_relative '../helper/xamarin_native_helper'
|
5
|
+
|
6
|
+
module Fastlane
|
7
|
+
module Actions
|
8
|
+
class BumpVersionAction < Action
|
9
|
+
|
10
|
+
PLATFORM = %w(iOS Android).freeze
|
11
|
+
VERSION_TYPE = %w(major minor patch).freeze
|
12
|
+
|
13
|
+
def self.run(params)
|
14
|
+
if params[:platform] == 'iOS'
|
15
|
+
bump_version_ios(params)
|
16
|
+
else
|
17
|
+
bump_version_android(params)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.description
|
22
|
+
"Increments project version"
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.authors
|
26
|
+
["illania"]
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.bump(current_version,type)
|
30
|
+
begin
|
31
|
+
components = current_version.split('.')
|
32
|
+
major = components[0].to_i
|
33
|
+
minor = components[1].to_i
|
34
|
+
patch = components[2].to_i
|
35
|
+
|
36
|
+
if type == "major"
|
37
|
+
major += 1
|
38
|
+
minor = 0
|
39
|
+
patch = 0
|
40
|
+
elsif type == "minor"
|
41
|
+
minor += 1
|
42
|
+
patch = 0
|
43
|
+
elsif type == "patch"
|
44
|
+
patch += 1
|
45
|
+
else
|
46
|
+
abort("Unknown version bump type: #{type}\nValid options: major, minor, patch.")
|
47
|
+
end
|
48
|
+
|
49
|
+
return new_version = [major, minor, patch].join('.')
|
50
|
+
rescue => ex
|
51
|
+
UI.error(ex)
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.bump_version_ios(params)
|
57
|
+
begin
|
58
|
+
info_plist = params[:info_plist_pathes]
|
59
|
+
info_plist.each do |path|
|
60
|
+
current_version = get_info_plist_version(path)
|
61
|
+
new_version = bump(current_version, params[:type])
|
62
|
+
set_info_plist_version(path, new_version)
|
63
|
+
end
|
64
|
+
rescue => ex
|
65
|
+
UI.error(ex)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.get_info_plist_version(path)
|
70
|
+
begin
|
71
|
+
path = File.expand_path(path)
|
72
|
+
plist = File.open(path) { |f| Plist.parse_xml(f) }
|
73
|
+
value = plist['CFBundleShortVersionString']
|
74
|
+
return value
|
75
|
+
rescue => ex
|
76
|
+
UI.error(ex)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def self.set_info_plist_version(path, new_version)
|
81
|
+
begin
|
82
|
+
path = File.expand_path(path)
|
83
|
+
plist = Plist.parse_xml(path)
|
84
|
+
plist['CFBundleShortVersionString'] = new_version
|
85
|
+
new_plist = Plist::Emit.dump(plist)
|
86
|
+
File.write(path, new_plist)
|
87
|
+
rescue => ex
|
88
|
+
UI.error(ex)
|
89
|
+
UI.user_error!("Unable to set version '#{new_version}' to plist file at '#{path}'")
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
def self.bump_version_android(params)
|
94
|
+
begin
|
95
|
+
version_type = params[:type]
|
96
|
+
manifest_file = params[:manifest_file_path]
|
97
|
+
doc = File.open(manifest_file) { |f|
|
98
|
+
@doc = Nokogiri::XML(f)
|
99
|
+
manifest_node = @doc.xpath('//manifest')
|
100
|
+
current_version = @doc.at('//manifest/@android:versionName').text
|
101
|
+
new_version = bump(current_version, version_type)
|
102
|
+
manifest_node.attr('android:versionName', new_version)
|
103
|
+
File.write(manifest_file, @doc.to_xml)
|
104
|
+
}
|
105
|
+
rescue => ex
|
106
|
+
UI.error(ex)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
def self.available_options
|
111
|
+
[
|
112
|
+
FastlaneCore::ConfigItem.new(
|
113
|
+
key: :platform,
|
114
|
+
env_name: 'FL_XN_BUILD_VERSION_PLATFORM',
|
115
|
+
description: 'iOS or Android',
|
116
|
+
type: String,
|
117
|
+
optional: false
|
118
|
+
),
|
119
|
+
FastlaneCore::ConfigItem.new(
|
120
|
+
key: :type,
|
121
|
+
env_name: 'FL_XN_BUILD_VERSION_TYPE',
|
122
|
+
description: 'Sets how version should be incremented (major, minor, patch)',
|
123
|
+
is_string: true,
|
124
|
+
optional: false,
|
125
|
+
default_value: 'minor',
|
126
|
+
verify_block: proc do |value|
|
127
|
+
UI.user_error!("Unsupported value! Use one of #{VERSION_TYPE.join '\' '}".red) unless VERSION_TYPE.include? value
|
128
|
+
end
|
129
|
+
),
|
130
|
+
FastlaneCore::ConfigItem.new(
|
131
|
+
key: :info_plist_pathes,
|
132
|
+
env_name: 'FL_XN_BUILD_VERSION_INFO_PLIST_PATHES',
|
133
|
+
description: 'Info plist pathes',
|
134
|
+
type: Array,
|
135
|
+
optional: false
|
136
|
+
),
|
137
|
+
FastlaneCore::ConfigItem.new(
|
138
|
+
key: :manifest_file_path,
|
139
|
+
env_name: 'FL_XN_BUILD_VERSION_MANIFEST_FILE_PATH',
|
140
|
+
description: 'Android Manifest file path',
|
141
|
+
type: String,
|
142
|
+
optional: false,
|
143
|
+
verify_block: proc do |value|
|
144
|
+
UI.user_error!('File not found'.red) unless File.file? value
|
145
|
+
end
|
146
|
+
)
|
147
|
+
]
|
148
|
+
end
|
149
|
+
|
150
|
+
def self.is_supported?(platform)
|
151
|
+
[:ios, :android].include?(platform)
|
152
|
+
true
|
153
|
+
end
|
154
|
+
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
@@ -0,0 +1,187 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative '../helper/xamarin_native_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
class MsbuildAction < Action
|
7
|
+
MSBUILD = '/Library/Frameworks/Mono.framework/Commands/msbuild'.freeze
|
8
|
+
BUILD_TYPE = %w(Release Debug).freeze
|
9
|
+
PLATFORM = %w(iPhone iPhoneSimulator AnyCPU).freeze
|
10
|
+
TARGET = %w(Build Rebuild Clean).freeze
|
11
|
+
PRINT_ALL = [true, false].freeze
|
12
|
+
|
13
|
+
def self.run(params)
|
14
|
+
build(params)
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.build(params)
|
18
|
+
platform = params[:platform]
|
19
|
+
build_type = params[:build_type]
|
20
|
+
target = params[:target]
|
21
|
+
solution = params[:solution]
|
22
|
+
output_path = params[:output_path]
|
23
|
+
ipa_name = params[:ipa_name]
|
24
|
+
sign_apk = params[:sign_apk]
|
25
|
+
project = params[:project]
|
26
|
+
android_signing_keystore = params[:android_signing_keystore]
|
27
|
+
android_signing_key_pass = params[:android_signing_key_pass]
|
28
|
+
android_signing_store_pass = params[:android_signing_store_pass]
|
29
|
+
android_signing_key_alias = params[:android_signing_key_alias]
|
30
|
+
|
31
|
+
command = "#{MSBUILD} "
|
32
|
+
command << "/target:#{target} " if target != nil
|
33
|
+
command << "/p:Platform=#{platform} " if platform != nil
|
34
|
+
command << "/p:Configuration=#{build_type} " if build_type != nil
|
35
|
+
command << "/p:OutputPath=#{output_path} " if output_path != nil
|
36
|
+
|
37
|
+
command << "/p:BuildIpa=True " if ipa_name != nil
|
38
|
+
command << "/p:IpaPackageName=#{ipa_name} " if ipa_name != nil
|
39
|
+
command << "/p:IpaPackageDir=#{output_path} " if output_path != nil
|
40
|
+
|
41
|
+
command << "/t:SignAndroidPackage " if sign_apk == true
|
42
|
+
command << "/p:AndroidSigningKeyStore=#{android_signing_keystore} " if android_signing_keystore != nil
|
43
|
+
command << "/p:AndroidSigningKeyPass=#{android_signing_key_pass} " if android_signing_key_pass != nil
|
44
|
+
command << "/p:AndroidSigningStorePass=#{android_signing_store_pass} " if android_signing_store_pass != nil
|
45
|
+
command << "/p:AndroidSigningKeyAlias=#{android_signing_key_alias} " if android_signing_key_alias != nil
|
46
|
+
|
47
|
+
command << project if project != nil
|
48
|
+
command << solution if solution != nil
|
49
|
+
Helper::XamarinNativeHelper.bash(command, !params[:print_all])
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.description
|
53
|
+
"Build Xamarin.Native iOS and Android projects using msbuild"
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.authors
|
57
|
+
["illania"]
|
58
|
+
end
|
59
|
+
|
60
|
+
def self.available_options
|
61
|
+
[
|
62
|
+
FastlaneCore::ConfigItem.new(
|
63
|
+
key: :solution,
|
64
|
+
env_name: 'FL_XN_BUILD_SOLUTION',
|
65
|
+
description: 'Path to Xamarin .sln file',
|
66
|
+
optional: true,
|
67
|
+
verify_block: proc do |value|
|
68
|
+
UI.user_error!('File not found'.red) unless File.file? value
|
69
|
+
end
|
70
|
+
),
|
71
|
+
|
72
|
+
FastlaneCore::ConfigItem.new(
|
73
|
+
key: :project,
|
74
|
+
env_name: 'FL_XN_BUILD_PROJECT',
|
75
|
+
description: 'Project to build or clean',
|
76
|
+
is_string: true,
|
77
|
+
optional: true,
|
78
|
+
verify_block: proc do |value|
|
79
|
+
UI.user_error!('File not found'.red) unless File.file? value
|
80
|
+
end
|
81
|
+
),
|
82
|
+
|
83
|
+
FastlaneCore::ConfigItem.new(
|
84
|
+
key: :platform,
|
85
|
+
env_name: 'FL_XN_BUILD_PLATFORM',
|
86
|
+
description: 'Build platform',
|
87
|
+
type: String,
|
88
|
+
optional: true,
|
89
|
+
verify_block: proc do |value|
|
90
|
+
UI.user_error!("Unsupported value! Use one of #{PLATFORM.join '\' '}".red) unless PLATFORM.include? value
|
91
|
+
end
|
92
|
+
),
|
93
|
+
|
94
|
+
FastlaneCore::ConfigItem.new(
|
95
|
+
key: :build_type,
|
96
|
+
env_name: 'FL_XN_BUILD_TYPE',
|
97
|
+
description: 'Release or Debug',
|
98
|
+
type: String,
|
99
|
+
optional: false,
|
100
|
+
verify_block: proc do |value|
|
101
|
+
UI.user_error!("Unsupported value! Use one of #{BUILD_TYPE.join '\' '}".red) unless BUILD_TYPE.include? value
|
102
|
+
end
|
103
|
+
),
|
104
|
+
|
105
|
+
FastlaneCore::ConfigItem.new(
|
106
|
+
key: :target,
|
107
|
+
env_name: 'FL_XN_BUILD_TARGET',
|
108
|
+
description: 'Target build type',
|
109
|
+
type: String,
|
110
|
+
optional: false,
|
111
|
+
verify_block: proc do |value|
|
112
|
+
UI.user_error!("Unsupported value! Use one of #{TARGET.join '\' '}".red) unless TARGET.include? value
|
113
|
+
end
|
114
|
+
),
|
115
|
+
|
116
|
+
FastlaneCore::ConfigItem.new(
|
117
|
+
key: :print_all,
|
118
|
+
env_name: 'FL_XN_BUILD_PRINT_ALL',
|
119
|
+
description: 'Print std out',
|
120
|
+
default_value: true,
|
121
|
+
is_string: false,
|
122
|
+
optional: true,
|
123
|
+
verify_block: proc do |value|
|
124
|
+
UI.user_error!("Unsupported value! Use one of #{PRINT_ALL.join '\' '}".red) unless PRINT_ALL.include? value
|
125
|
+
end
|
126
|
+
),
|
127
|
+
|
128
|
+
FastlaneCore::ConfigItem.new(
|
129
|
+
key: :output_path,
|
130
|
+
env_name: 'FL_XN_BUILD_OUTPUT_PATH',
|
131
|
+
description: 'Build output path for ipa and apk files',
|
132
|
+
is_string: true,
|
133
|
+
optional: true
|
134
|
+
),
|
135
|
+
FastlaneCore::ConfigItem.new(
|
136
|
+
key: :ipa_name,
|
137
|
+
env_name: 'FL_XN_BUILD_IPA_NAME',
|
138
|
+
description: 'Ipa name for iOS app',
|
139
|
+
is_string: true,
|
140
|
+
optional: true
|
141
|
+
),
|
142
|
+
FastlaneCore::ConfigItem.new(
|
143
|
+
key: :sign_apk,
|
144
|
+
env_name: 'FL_XN_BUILD_SIGN_APK',
|
145
|
+
description: 'Sets if apk should be created and signed',
|
146
|
+
is_string: false,
|
147
|
+
optional: true,
|
148
|
+
default_value: false
|
149
|
+
),
|
150
|
+
FastlaneCore::ConfigItem.new(
|
151
|
+
key: :android_signing_keystore,
|
152
|
+
env_name: 'FL_XN_BUILD_DROID_SIGNING_KEYSTORE',
|
153
|
+
description: 'Sets Android Signing KeyStore',
|
154
|
+
is_string: true,
|
155
|
+
optional: true
|
156
|
+
),
|
157
|
+
FastlaneCore::ConfigItem.new(
|
158
|
+
key: :android_signing_key_pass,
|
159
|
+
env_name: 'FL_XN_BUILD_DROID_SIGNING_KEY_PASS',
|
160
|
+
description: 'Sets Android Signing Key Password',
|
161
|
+
is_string: true,
|
162
|
+
optional: true
|
163
|
+
),
|
164
|
+
FastlaneCore::ConfigItem.new(
|
165
|
+
key: :android_signing_store_pass,
|
166
|
+
env_name: 'FL_XN_BUILD_DROID_SIGNING_STORE_PASS',
|
167
|
+
description: 'Sets Android Signing Store Password',
|
168
|
+
is_string: true,
|
169
|
+
optional: true
|
170
|
+
),
|
171
|
+
FastlaneCore::ConfigItem.new(
|
172
|
+
key: :android_signing_key_alias,
|
173
|
+
env_name: 'FL_XN_BUILD_DROID_SIGNING_KEY_ALIAS',
|
174
|
+
description: 'Sets Android Signing Key Alias',
|
175
|
+
is_string: true,
|
176
|
+
optional: true
|
177
|
+
)
|
178
|
+
]
|
179
|
+
end
|
180
|
+
|
181
|
+
def self.is_supported?(platform)
|
182
|
+
[:ios, :android].include?(platform)
|
183
|
+
end
|
184
|
+
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative '../helper/xamarin_native_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
class NugetAction < Action
|
7
|
+
def self.run(params)
|
8
|
+
sh "nuget restore #{params[:sln]} -verbosity #{params[:verbosity]}"
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.description
|
12
|
+
"Downloads and installs any packages missing from the packages folder"
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.authors
|
16
|
+
["illania"]
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.available_options
|
20
|
+
[
|
21
|
+
FastlaneCore::ConfigItem.new(
|
22
|
+
key: :sln,
|
23
|
+
env_name: 'FL_XN_BUILD_NUGET_SOLUTION',
|
24
|
+
description: 'Path to Xamarin .sln file',
|
25
|
+
type: String,
|
26
|
+
optional: false
|
27
|
+
),
|
28
|
+
FastlaneCore::ConfigItem.new(
|
29
|
+
key: :verbosity,
|
30
|
+
env_name: 'FL_XN_BUILD_NUGET_VERBOSITY',
|
31
|
+
description: 'Specifies the amount of detail displayed in the output: normal (the default), quiet, or detailed',
|
32
|
+
type: String,
|
33
|
+
default_value: 'detailed',
|
34
|
+
optional: true,
|
35
|
+
)
|
36
|
+
]
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.is_supported?(platform)
|
40
|
+
[:ios, :android].include?(platform)
|
41
|
+
true
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'fastlane_core/ui/ui'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
|
5
|
+
|
6
|
+
module Helper
|
7
|
+
class XamarinNativeHelper
|
8
|
+
# class methods that you define here become available in your action
|
9
|
+
# as `Helper::XamarinNativeHelper.your_method`
|
10
|
+
#
|
11
|
+
def self.show_message
|
12
|
+
UI.message("Hello from the xamarin_native plugin helper!")
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.bash(command, disable_log)
|
16
|
+
UI.message("starting bash process with command: #{command}")
|
17
|
+
|
18
|
+
if disable_log
|
19
|
+
stderr_str, status = Open3.capture2("#{command} > /dev/null")
|
20
|
+
if status != 0
|
21
|
+
UI.error(stderr_str)
|
22
|
+
raise 'not 0 result'
|
23
|
+
end
|
24
|
+
else
|
25
|
+
Open3.popen3(command) do |_stdin, stdout, stderr, wait_thr|
|
26
|
+
error = []
|
27
|
+
t1 = Thread.start do
|
28
|
+
stdout.each { |line| UI.command_output(line) }
|
29
|
+
end
|
30
|
+
t2 = Thread.start do
|
31
|
+
stderr.each { |line| error << line }
|
32
|
+
end
|
33
|
+
exit_status = wait_thr.value
|
34
|
+
t1.join
|
35
|
+
t2.join
|
36
|
+
if exit_status != 0
|
37
|
+
error.each { |e| UI.error(e) }
|
38
|
+
raise 'not 0 result'
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/xamarin_native/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module XamarinNative
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::XamarinNative.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,219 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-xamarin_native
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- illania
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-03-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: nokogiri
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: plist
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: fastlane
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.212.1
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.212.1
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rspec_junit_formatter
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - '='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 1.12.1
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - '='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 1.12.1
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubocop-performance
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rubocop-require_tools
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: simplecov
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
description:
|
182
|
+
email: ag@nordic-it.com
|
183
|
+
executables: []
|
184
|
+
extensions: []
|
185
|
+
extra_rdoc_files: []
|
186
|
+
files:
|
187
|
+
- LICENSE
|
188
|
+
- README.md
|
189
|
+
- lib/fastlane/plugin/xamarin_native.rb
|
190
|
+
- lib/fastlane/plugin/xamarin_native/actions/bump_code.rb
|
191
|
+
- lib/fastlane/plugin/xamarin_native/actions/bump_version.rb
|
192
|
+
- lib/fastlane/plugin/xamarin_native/actions/msbuild.rb
|
193
|
+
- lib/fastlane/plugin/xamarin_native/actions/nuget.rb
|
194
|
+
- lib/fastlane/plugin/xamarin_native/helper/xamarin_native_helper.rb
|
195
|
+
- lib/fastlane/plugin/xamarin_native/version.rb
|
196
|
+
homepage: https://github.com/illania/fastlane-plugin-xamarin_native
|
197
|
+
licenses:
|
198
|
+
- MIT
|
199
|
+
metadata: {}
|
200
|
+
post_install_message:
|
201
|
+
rdoc_options: []
|
202
|
+
require_paths:
|
203
|
+
- lib
|
204
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '2.6'
|
209
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
210
|
+
requirements:
|
211
|
+
- - ">="
|
212
|
+
- !ruby/object:Gem::Version
|
213
|
+
version: '0'
|
214
|
+
requirements: []
|
215
|
+
rubygems_version: 3.0.3.1
|
216
|
+
signing_key:
|
217
|
+
specification_version: 4
|
218
|
+
summary: Plugin for Xamarin.Native iOS and Android projects
|
219
|
+
test_files: []
|