fastlane-plugin-xambuild 0.2.1 → 0.3.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 +4 -4
- data/README.md +1 -1
- data/lib/fastlane/plugin/xambuild.rb +0 -14
- data/lib/fastlane/plugin/xambuild/actions/xambuild_action.rb +6 -7
- data/lib/fastlane/plugin/xambuild/helpers/generators/{android_zipalign_command_generator.rb → android_zipalign.rb} +3 -3
- data/lib/fastlane/plugin/xambuild/helpers/generators/{build_command_generator.rb → build.rb} +8 -8
- data/lib/fastlane/plugin/xambuild/helpers/generators/{java_sign_command_generator.rb → java_sign.rb} +6 -6
- data/lib/fastlane/plugin/xambuild/helpers/generators/{zip_dsym_command_generator.rb → zip_dsym.rb} +2 -2
- data/lib/fastlane/plugin/xambuild/helpers/manager.rb +2 -2
- data/lib/fastlane/plugin/xambuild/helpers/options.rb +1 -1
- data/lib/fastlane/plugin/xambuild/helpers/runner.rb +28 -29
- data/lib/fastlane/plugin/xambuild/version.rb +1 -1
- metadata +79 -29
- data/lib/fastlane/plugin/xambuild/actions/app_version_action.rb +0 -96
- data/lib/fastlane/plugin/xambuild/helpers/detect_values.rb +0 -145
- data/lib/fastlane/plugin/xambuild/helpers/msbuild/project.rb +0 -43
- data/lib/fastlane/plugin/xambuild/helpers/msbuild/solution.rb +0 -19
- data/lib/fastlane/plugin/xambuild/helpers/msbuild/solution_parser.rb +0 -36
- data/lib/fastlane/plugin/xambuild/helpers/platform.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da832aeaecc62c6c8f348ae6fbaf1f3190268e059259a26363ab1df9157e3e60
|
4
|
+
data.tar.gz: 631e958e3af6d87eb5d8bf7e18080cb730e7798308845ee61c5982977c5bf3b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f85a2af422326903378ac5281bb5c281f5aaf46de5dce7c35e5c99168e723bb2e53fd46212e7186cc1e3110a1a622dd3807a1760fff3a8c149e802778cb38011
|
7
|
+
data.tar.gz: 6cc421a9a65ddac6f998e4adb1fe8885e73fc51158118281b48dc57e0e18946469493844995e2eb23a9cc5b0ca2a4ab4d48c3df3a808ba576771ff14f92aa768
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Xambuild Fastlane Plugin
|
2
2
|
|
3
|
-
[](https://rubygems.org/gems/fastlane-plugin-xambuild)
|
3
|
+
[](https://rubygems.org/gems/fastlane-plugin-xambuild) [](https://badge.fury.io/rb/fastlane-plugin-xambuild)
|
4
4
|
|
5
5
|
## Getting Started
|
6
6
|
|
@@ -16,20 +16,6 @@ end
|
|
16
16
|
require "fastlane"
|
17
17
|
|
18
18
|
module Xambuild
|
19
|
-
class << self
|
20
|
-
attr_reader :config
|
21
|
-
|
22
|
-
attr_accessor :project
|
23
|
-
|
24
|
-
attr_accessor :cache
|
25
|
-
|
26
|
-
def config=(value)
|
27
|
-
@config = value
|
28
|
-
DetectValues.set_additional_default_values
|
29
|
-
@cache = {}
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
19
|
Helper = FastlaneCore::Helper
|
34
20
|
UI = FastlaneCore::UI
|
35
21
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "fastlane/plugin/xambuild/helpers/options"
|
2
|
-
require "fastlane/plugin/xambuild/helpers/platform"
|
3
2
|
require "fastlane/plugin/xambuild/helpers/manager"
|
3
|
+
require "csproj/platform"
|
4
4
|
|
5
5
|
module Fastlane
|
6
6
|
module Actions
|
@@ -11,12 +11,11 @@ module Fastlane
|
|
11
11
|
end
|
12
12
|
|
13
13
|
class XambuildAction < Action
|
14
|
-
|
15
14
|
def self.run(values)
|
16
|
-
values[:platform] = ::
|
17
|
-
::
|
15
|
+
values[:platform] = ::CsProj::Platform.from_lane_context(Actions.lane_context)
|
16
|
+
::CsProj.config = values
|
18
17
|
|
19
|
-
if ::
|
18
|
+
if ::CsProj.project.ios? || ::CsProj.project.osx?
|
20
19
|
absolute_ipa_path = File.expand_path(::Xambuild::Manager.new.work(values))
|
21
20
|
absolute_app_path = File.join(values[:output_path], "#{values[:assembly_name]}.app")
|
22
21
|
absolute_dsym_path = absolute_ipa_path.gsub(".ipa", ".app.dSYM.zip")
|
@@ -30,10 +29,10 @@ module Fastlane
|
|
30
29
|
ENV[SharedValues::DSYM_OUTPUT_PATH.to_s] = absolute_dsym_path if File.exist?(absolute_dsym_path)
|
31
30
|
|
32
31
|
absolute_ipa_path
|
33
|
-
elsif ::
|
32
|
+
elsif ::CsProj.project.android?
|
34
33
|
if values[:keystore_path] && values[:keystore_alias]
|
35
34
|
unless values[:keystore_password]
|
36
|
-
::
|
35
|
+
::CsProj.config[:keystore_password] = ask("Password (for #{values[:keystore_alias]}): ") { |q| q.echo = "*" }
|
37
36
|
end
|
38
37
|
end
|
39
38
|
absolute_apk_path = File.expand_path(::Xambuild::Manager.new.work(values))
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module Xambuild
|
2
|
-
class
|
2
|
+
class AndroidZipalign
|
3
3
|
class << self
|
4
4
|
def generate
|
5
5
|
parts = prefix
|
6
6
|
parts << zipalign_apk
|
7
7
|
parts += options
|
8
|
-
parts <<
|
9
|
-
parts <<
|
8
|
+
parts << CsProj.cache[:signed_apk_path]
|
9
|
+
parts << CsProj.cache[:build_apk_path]
|
10
10
|
parts += pipe
|
11
11
|
|
12
12
|
parts
|
data/lib/fastlane/plugin/xambuild/helpers/generators/{build_command_generator.rb → build.rb}
RENAMED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Xambuild
|
2
|
-
class
|
2
|
+
class BuildCommand
|
3
3
|
class << self
|
4
4
|
def generate
|
5
5
|
parts = prefix
|
@@ -17,17 +17,17 @@ module Xambuild
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def compiler_bin
|
20
|
-
|
20
|
+
CsProj.config[:compiler_bin]
|
21
21
|
end
|
22
22
|
|
23
23
|
def options
|
24
|
-
config =
|
24
|
+
config = CsProj.config
|
25
25
|
|
26
26
|
options = []
|
27
27
|
options << config[:extra_build_options] if config[:extra_build_options]
|
28
28
|
options << "-p:Configuration=#{config[:build_configuration]}" if config[:build_configuration]
|
29
|
-
options << "-p:Platform=#{config[:build_platform]}" if
|
30
|
-
options << "-p:BuildIpa=true" if
|
29
|
+
options << "-p:Platform=#{config[:build_platform]}" if CsProj.project.ios? && config[:build_platform]
|
30
|
+
options << "-p:BuildIpa=true" if CsProj.project.ios?
|
31
31
|
if config[:solution_path]
|
32
32
|
solution_dir = File.dirname(config[:solution_path])
|
33
33
|
options << "-p:SolutionDir=#{solution_dir}/"
|
@@ -37,13 +37,13 @@ module Xambuild
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def build_targets
|
40
|
-
|
40
|
+
CsProj.config[:build_target].map! { |t| "-t:#{t}" }
|
41
41
|
end
|
42
42
|
|
43
43
|
def targets
|
44
44
|
targets = []
|
45
45
|
targets += build_targets
|
46
|
-
targets << "-t:SignAndroidPackage" if
|
46
|
+
targets << "-t:SignAndroidPackage" if CsProj.project.android?
|
47
47
|
|
48
48
|
targets
|
49
49
|
end
|
@@ -51,7 +51,7 @@ module Xambuild
|
|
51
51
|
def project
|
52
52
|
path = []
|
53
53
|
|
54
|
-
path <<
|
54
|
+
path << CsProj.config[:project_path]
|
55
55
|
|
56
56
|
path
|
57
57
|
end
|
data/lib/fastlane/plugin/xambuild/helpers/generators/{java_sign_command_generator.rb → java_sign.rb}
RENAMED
@@ -1,15 +1,15 @@
|
|
1
1
|
module Xambuild
|
2
|
-
class
|
2
|
+
class JavaSign
|
3
3
|
class << self
|
4
4
|
def generate
|
5
|
-
build_apk_path =
|
6
|
-
|
5
|
+
build_apk_path = CsProj.cache[:build_apk_path]
|
6
|
+
CsProj.cache[:signed_apk_path] = "#{build_apk_path}-unaligned"
|
7
7
|
|
8
8
|
parts = prefix
|
9
9
|
parts << detect_jarsigner_executable
|
10
10
|
parts += options
|
11
11
|
parts << build_apk_path
|
12
|
-
parts <<
|
12
|
+
parts << CsProj.config[:keystore_alias]
|
13
13
|
parts += pipe
|
14
14
|
|
15
15
|
parts
|
@@ -26,7 +26,7 @@ module Xambuild
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def options
|
29
|
-
config =
|
29
|
+
config = CsProj.config
|
30
30
|
|
31
31
|
options = []
|
32
32
|
options << "-verbose" if $verbose
|
@@ -35,7 +35,7 @@ module Xambuild
|
|
35
35
|
options << "-storepass \"#{config[:keystore_password]}\""
|
36
36
|
options << "-keystore \"#{config[:keystore_path]}\""
|
37
37
|
options << "-tsa #{config[:keystore_tsa]}"
|
38
|
-
options << "-signedjar \"#{
|
38
|
+
options << "-signedjar \"#{CsProj.cache[:signed_apk_path]}\""
|
39
39
|
|
40
40
|
options
|
41
41
|
end
|
data/lib/fastlane/plugin/xambuild/helpers/generators/{zip_dsym_command_generator.rb → zip_dsym.rb}
RENAMED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Xambuild
|
2
|
-
class
|
2
|
+
class ZipDsym
|
3
3
|
class << self
|
4
4
|
def generate
|
5
5
|
parts = prefix
|
@@ -21,7 +21,7 @@ module Xambuild
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def options
|
24
|
-
build_dsym_path =
|
24
|
+
build_dsym_path = CsProj.cache[:build_dsym_path]
|
25
25
|
|
26
26
|
options = []
|
27
27
|
options << "-r"
|
@@ -5,9 +5,9 @@ require "fastlane/plugin/xambuild/version"
|
|
5
5
|
module Xambuild
|
6
6
|
class Manager
|
7
7
|
def work(options)
|
8
|
-
|
8
|
+
CsProj.config = options
|
9
9
|
|
10
|
-
FastlaneCore::PrintTable.print_values(config:
|
10
|
+
FastlaneCore::PrintTable.print_values(config: CsProj.config,
|
11
11
|
hide_keys: [],
|
12
12
|
title: "Summary for xambuild #{Fastlane::Xambuild::VERSION}")
|
13
13
|
|
@@ -90,7 +90,7 @@ module Xambuild
|
|
90
90
|
env_name: "XAMBUILD_ANDROID_KEYSTORE_PASSWORD",
|
91
91
|
description: "Password of the keystore",
|
92
92
|
optional: true),
|
93
|
-
|
93
|
+
|
94
94
|
FastlaneCore::ConfigItem.new(key: :keystore_tsa,
|
95
95
|
default_value: "http://timestamp.digicert.com",
|
96
96
|
env_name: "XAMBUILD_ANDROID_KEYSTORE_TSA",
|
@@ -1,23 +1,22 @@
|
|
1
1
|
require "fastlane"
|
2
|
-
require "fastlane/plugin/xambuild/helpers/generators/
|
3
|
-
require "fastlane/plugin/xambuild/helpers/generators/
|
4
|
-
require "fastlane/plugin/xambuild/helpers/generators/
|
5
|
-
require "fastlane/plugin/xambuild/helpers/generators/
|
2
|
+
require "fastlane/plugin/xambuild/helpers/generators/build"
|
3
|
+
require "fastlane/plugin/xambuild/helpers/generators/zip_dsym"
|
4
|
+
require "fastlane/plugin/xambuild/helpers/generators/java_sign"
|
5
|
+
require "fastlane/plugin/xambuild/helpers/generators/android_zipalign"
|
6
6
|
|
7
7
|
module Xambuild
|
8
8
|
class Runner
|
9
|
-
|
10
9
|
def run
|
11
|
-
config =
|
10
|
+
config = CsProj.config
|
12
11
|
|
13
12
|
build_app
|
14
13
|
|
15
|
-
if
|
14
|
+
if CsProj.project.ios? || CsProj.project.osx?
|
16
15
|
compress_and_move_dsym
|
17
16
|
path = ipa_file
|
18
17
|
|
19
18
|
path
|
20
|
-
elsif
|
19
|
+
elsif CsProj.project.android?
|
21
20
|
path = apk_file
|
22
21
|
if config[:keystore_path] && config[:keystore_alias]
|
23
22
|
UI.success "Jar it, sign it, zip it..."
|
@@ -30,45 +29,45 @@ module Xambuild
|
|
30
29
|
end
|
31
30
|
|
32
31
|
def build_app
|
33
|
-
command =
|
32
|
+
command = BuildCommand.generate
|
34
33
|
|
35
34
|
FastlaneCore::CommandExecutor.execute(command: command,
|
36
35
|
print_all: true,
|
37
|
-
print_command: !
|
36
|
+
print_command: !CsProj.config[:silent])
|
38
37
|
end
|
39
38
|
|
40
39
|
def apk_file
|
41
|
-
build_path =
|
42
|
-
assembly_name =
|
40
|
+
build_path = CsProj.project.options[:output_path]
|
41
|
+
assembly_name = CsProj.project.options[:assembly_name]
|
43
42
|
|
44
|
-
|
43
|
+
CsProj.cache[:build_apk_path] = "#{build_path}/#{assembly_name}.apk"
|
45
44
|
|
46
45
|
"#{build_path}/#{assembly_name}.apk"
|
47
46
|
end
|
48
47
|
|
49
48
|
def jarsign_and_zipalign
|
50
|
-
command =
|
49
|
+
command = JavaSign.generate
|
51
50
|
FastlaneCore::CommandExecutor.execute(command: command,
|
52
51
|
print_all: false,
|
53
|
-
print_command: !
|
52
|
+
print_command: !CsProj.config[:silent])
|
54
53
|
|
55
|
-
UI.success "Successfully signed apk #{
|
54
|
+
UI.success "Successfully signed apk #{CsProj.cache[:build_apk_path]}"
|
56
55
|
|
57
|
-
command =
|
56
|
+
command = AndroidZipalign.generate
|
58
57
|
FastlaneCore::CommandExecutor.execute(command: command,
|
59
58
|
print_all: true,
|
60
|
-
print_command: !
|
59
|
+
print_command: !CsProj.config[:silent])
|
61
60
|
end
|
62
61
|
|
63
62
|
def package_path
|
64
|
-
build_path =
|
65
|
-
assembly_name =
|
63
|
+
build_path = CsProj.project.options[:output_path]
|
64
|
+
assembly_name = CsProj.project.options[:assembly_name]
|
66
65
|
|
67
66
|
package_path = if File.exist? "#{build_path}/#{assembly_name}.ipa"
|
68
|
-
#
|
67
|
+
# After Xamarin.iOS 9
|
69
68
|
build_path
|
70
69
|
else
|
71
|
-
#
|
70
|
+
# Before Xamarin.iOS 9
|
72
71
|
Dir.glob("#{build_path}/#{assembly_name} *").max
|
73
72
|
end
|
74
73
|
|
@@ -76,14 +75,14 @@ module Xambuild
|
|
76
75
|
end
|
77
76
|
|
78
77
|
def ipa_file
|
79
|
-
assembly_name =
|
78
|
+
assembly_name = CsProj.project.options[:assembly_name]
|
80
79
|
|
81
80
|
"#{package_path}/#{assembly_name}.ipa"
|
82
81
|
end
|
83
82
|
|
84
83
|
def compress_and_move_dsym
|
85
|
-
build_path =
|
86
|
-
assembly_name =
|
84
|
+
build_path = CsProj.project.options[:output_path]
|
85
|
+
assembly_name = CsProj.project.options[:assembly_name]
|
87
86
|
|
88
87
|
build_dsym_path = "#{build_path}/#{assembly_name}.app.dSYM"
|
89
88
|
unless File.exist? build_dsym_path
|
@@ -91,14 +90,14 @@ module Xambuild
|
|
91
90
|
return
|
92
91
|
end
|
93
92
|
|
94
|
-
|
93
|
+
CsProj.cache[:build_dsym_path] = build_dsym_path
|
95
94
|
|
96
|
-
command =
|
95
|
+
command = ZipDsym.generate
|
97
96
|
FastlaneCore::CommandExecutor.execute(command: command,
|
98
97
|
print_all: true,
|
99
|
-
print_command: !
|
98
|
+
print_command: !CsProj.config[:silent])
|
100
99
|
|
101
|
-
#
|
100
|
+
# Move dsym beside ipa
|
102
101
|
dsym_path = "#{dsym_path}.zip"
|
103
102
|
if File.exist? dsym_path
|
104
103
|
FileUtils.mv(dsym_path, "#{package_path}/#{File.basename dsym_path}")
|
metadata
CHANGED
@@ -1,71 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-xambuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Barnby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: nokogiri
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.7'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: csproj
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.1.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.1.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
48
|
-
type: :
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: fastlane
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 2.169.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 2.169.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: pry
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +108,62 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
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: 0.49.1
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - '='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 0.49.1
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubocop-require_tools
|
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: simplecov
|
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'
|
111
167
|
description:
|
112
168
|
email: jakeb994@gmail.com
|
113
169
|
executables: []
|
@@ -117,20 +173,14 @@ files:
|
|
117
173
|
- LICENSE
|
118
174
|
- README.md
|
119
175
|
- lib/fastlane/plugin/xambuild.rb
|
120
|
-
- lib/fastlane/plugin/xambuild/actions/app_version_action.rb
|
121
176
|
- lib/fastlane/plugin/xambuild/actions/xambuild_action.rb
|
122
177
|
- lib/fastlane/plugin/xambuild/helpers/commands_generator.rb
|
123
|
-
- lib/fastlane/plugin/xambuild/helpers/
|
124
|
-
- lib/fastlane/plugin/xambuild/helpers/generators/
|
125
|
-
- lib/fastlane/plugin/xambuild/helpers/generators/
|
126
|
-
- lib/fastlane/plugin/xambuild/helpers/generators/
|
127
|
-
- lib/fastlane/plugin/xambuild/helpers/generators/zip_dsym_command_generator.rb
|
178
|
+
- lib/fastlane/plugin/xambuild/helpers/generators/android_zipalign.rb
|
179
|
+
- lib/fastlane/plugin/xambuild/helpers/generators/build.rb
|
180
|
+
- lib/fastlane/plugin/xambuild/helpers/generators/java_sign.rb
|
181
|
+
- lib/fastlane/plugin/xambuild/helpers/generators/zip_dsym.rb
|
128
182
|
- lib/fastlane/plugin/xambuild/helpers/manager.rb
|
129
|
-
- lib/fastlane/plugin/xambuild/helpers/msbuild/project.rb
|
130
|
-
- lib/fastlane/plugin/xambuild/helpers/msbuild/solution.rb
|
131
|
-
- lib/fastlane/plugin/xambuild/helpers/msbuild/solution_parser.rb
|
132
183
|
- lib/fastlane/plugin/xambuild/helpers/options.rb
|
133
|
-
- lib/fastlane/plugin/xambuild/helpers/platform.rb
|
134
184
|
- lib/fastlane/plugin/xambuild/helpers/runner.rb
|
135
185
|
- lib/fastlane/plugin/xambuild/version.rb
|
136
186
|
homepage: https://github.com/abnegate/fastlane-plugin-xambuild
|
@@ -1,96 +0,0 @@
|
|
1
|
-
require "fastlane/plugin/xambuild/helpers/options"
|
2
|
-
require "fastlane/plugin/xambuild/helpers/platform"
|
3
|
-
|
4
|
-
module Fastlane
|
5
|
-
module Actions
|
6
|
-
class AppVersionAction < Action
|
7
|
-
|
8
|
-
def self.run(values)
|
9
|
-
values[:platform] = ::Xambuild::Platform.from_lane_context(Actions.lane_context)
|
10
|
-
::Xambuild.config = values
|
11
|
-
|
12
|
-
if ::Xambuild.project.ios? || ::Xambuild.project.osx?
|
13
|
-
version, build = set_plist_version values[:version], values[:build], values[:plist_path]
|
14
|
-
elsif ::Xambuild.project.android?
|
15
|
-
version, build = set_manifest_version values[:version], values[:build], values[:manifest_path]
|
16
|
-
end
|
17
|
-
|
18
|
-
UI.important "Current Version is:"
|
19
|
-
UI.message " Version: #{version}"
|
20
|
-
UI.message " Build: #{build}"
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.set_plist_version(version, build, plist_path = nil)
|
24
|
-
plist_path ||= ::Xambuild.config[:plist_path]
|
25
|
-
version ||= other_action.get_info_plist_value(path: plist_path, key: "CFBundleShortVersionString")
|
26
|
-
build ||= other_action.get_info_plist_value(path: plist_path, key: "CFBundleVersion")
|
27
|
-
|
28
|
-
other_action.set_info_plist_value(
|
29
|
-
path: plist_path,
|
30
|
-
key: "CFBundleShortVersionString",
|
31
|
-
value: version
|
32
|
-
)
|
33
|
-
|
34
|
-
other_action.set_info_plist_value(
|
35
|
-
path: plist_path,
|
36
|
-
key: "CFBundleVersion",
|
37
|
-
value: build
|
38
|
-
)
|
39
|
-
|
40
|
-
[version, build]
|
41
|
-
end
|
42
|
-
|
43
|
-
def self.set_manifest_version(version, build, manifest_path = nil)
|
44
|
-
manifest_path ||= ::Xambuild.config[:manifest_path]
|
45
|
-
|
46
|
-
f1 = File.open(manifest_path)
|
47
|
-
doc = Nokogiri::XML(f1)
|
48
|
-
f1.close
|
49
|
-
|
50
|
-
attrs = doc.xpath("//manifest")[0]
|
51
|
-
|
52
|
-
version ||= attrs["android:versionName"]
|
53
|
-
build ||= attrs["android:versionCode"]
|
54
|
-
|
55
|
-
if version || build
|
56
|
-
attrs["android:versionName"] = version if version
|
57
|
-
attrs["android:versionCode"] = build if build
|
58
|
-
|
59
|
-
File.open(manifest_path, "w") do |f2|
|
60
|
-
f2.print(doc.to_xml)
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
[version, build]
|
65
|
-
end
|
66
|
-
|
67
|
-
def self.description
|
68
|
-
"Easily set or print app version with `app_version`"
|
69
|
-
end
|
70
|
-
|
71
|
-
def self.author
|
72
|
-
"Jake Barnby"
|
73
|
-
end
|
74
|
-
|
75
|
-
def self.available_options
|
76
|
-
Xambuild::Options.available_options.concat(
|
77
|
-
[
|
78
|
-
FastlaneCore::ConfigItem.new(key: :version,
|
79
|
-
env_name: "FL_APP_VERSION",
|
80
|
-
description: "App version value",
|
81
|
-
optional: true),
|
82
|
-
|
83
|
-
FastlaneCore::ConfigItem.new(key: :build,
|
84
|
-
env_name: "FL_APP_BUILD",
|
85
|
-
description: "App build number value",
|
86
|
-
optional: true)
|
87
|
-
]
|
88
|
-
)
|
89
|
-
end
|
90
|
-
|
91
|
-
def self.is_supported?(platform)
|
92
|
-
true
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
@@ -1,145 +0,0 @@
|
|
1
|
-
require "nokogiri"
|
2
|
-
require "fastlane/plugin/xambuild/helpers/msbuild/project"
|
3
|
-
require "fastlane/plugin/xambuild/helpers/msbuild/solution_parser"
|
4
|
-
|
5
|
-
module Xambuild
|
6
|
-
class DetectValues
|
7
|
-
|
8
|
-
def self.set_additional_default_values
|
9
|
-
config = Xambuild.config
|
10
|
-
|
11
|
-
# TODO: detect_platform automatically for :platform config
|
12
|
-
|
13
|
-
if config[:platform] == Platform::ANDROID
|
14
|
-
config[:build_platform] = "AnyCPU"
|
15
|
-
end
|
16
|
-
|
17
|
-
# Detect the project
|
18
|
-
Xambuild.project = Msbuild::Project.new(config)
|
19
|
-
detect_solution
|
20
|
-
detect_project
|
21
|
-
|
22
|
-
doc_csproj = get_parser_handle config[:project_path]
|
23
|
-
|
24
|
-
detect_output_path doc_csproj
|
25
|
-
detect_manifest doc_csproj
|
26
|
-
detect_info_plist
|
27
|
-
detect_assembly_name doc_csproj
|
28
|
-
|
29
|
-
config
|
30
|
-
end
|
31
|
-
|
32
|
-
# Helper Methods
|
33
|
-
|
34
|
-
def self.detect_solution
|
35
|
-
return if Xambuild.config[:solution_path]
|
36
|
-
|
37
|
-
sln = find_file("*.sln", 3)
|
38
|
-
UI.user_error! "Not able to find solution file automatically, try to specify it via `solution_path` parameter." unless sln
|
39
|
-
|
40
|
-
Xambuild.config[:solution_path] = abs_path sln
|
41
|
-
end
|
42
|
-
|
43
|
-
def self.detect_project
|
44
|
-
return if Xambuild.config[:project_path]
|
45
|
-
|
46
|
-
path = Xambuild.config[:solution_path]
|
47
|
-
projects = Msbuild::SolutionParser.parse(path)
|
48
|
-
.get_platform Xambuild.config[:platform]
|
49
|
-
|
50
|
-
UI.user_error! "Not able to find any project in solution, that matches the platform `#{Xambuild.config[:platform]}`." unless projects.any?
|
51
|
-
|
52
|
-
project = projects.first
|
53
|
-
csproj = fix_path_relative project.project_path
|
54
|
-
|
55
|
-
UI.user_error! "Not able to find project file automatically, try to specify it via `project_path` parameter." unless csproj
|
56
|
-
|
57
|
-
Xambuild.config[:project_name] = project.project_name
|
58
|
-
Xambuild.config[:project_path] = abs_path csproj
|
59
|
-
end
|
60
|
-
|
61
|
-
def self.detect_output_path(doc_csproj)
|
62
|
-
return if Xambuild.config[:output_path]
|
63
|
-
|
64
|
-
configuration = Xambuild.config[:build_configuration]
|
65
|
-
platform = Xambuild.config[:build_platform]
|
66
|
-
|
67
|
-
doc_node = doc_csproj.xpath("/*[local-name()='Project']/*[local-name()='PropertyGroup'][translate(@*[local-name() = 'Condition'],'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz') = \" '$(configuration)|$(platform)' == '#{configuration.downcase}|#{platform.downcase}' \"]/*[local-name()='OutputPath']/text()")
|
68
|
-
output_path = doc_node.text
|
69
|
-
UI.user_error! "Not able to find output path automatically, try to specify it via `output_path` parameter." unless output_path
|
70
|
-
|
71
|
-
Xambuild.config[:output_path] = abs_project_path output_path
|
72
|
-
end
|
73
|
-
|
74
|
-
def self.detect_manifest(doc_csproj)
|
75
|
-
return if Xambuild.config[:manifest_path] || (Xambuild.config[:platform] != Platform::ANDROID)
|
76
|
-
|
77
|
-
doc_node = doc_csproj.css("AndroidManifest").first
|
78
|
-
|
79
|
-
Xambuild.config[:manifest_path] = abs_project_path doc_node.text
|
80
|
-
end
|
81
|
-
|
82
|
-
def self.detect_info_plist
|
83
|
-
return if Xambuild.config[:plist_path] || (Xambuild.config[:platform] != Platform::IOS)
|
84
|
-
|
85
|
-
plist_path = find_file("Info.plist", 1)
|
86
|
-
UI.user_error! "Not able to find Info.plist automatically, try to specify it via `plist_path` parameter." unless plist_path
|
87
|
-
|
88
|
-
Xambuild.config[:plist_path] = abs_project_path plist_path
|
89
|
-
end
|
90
|
-
|
91
|
-
def self.detect_assembly_name(doc_csproj)
|
92
|
-
return if Xambuild.config[:assembly_name]
|
93
|
-
|
94
|
-
if [Platform::IOS, Platform::OSX].include? Xambuild.config[:platform]
|
95
|
-
Xambuild.config[:assembly_name] = doc_csproj.css("PropertyGroup > AssemblyName").text
|
96
|
-
elsif Xambuild.config[:platform] == Platform::ANDROID
|
97
|
-
doc = get_parser_handle Xambuild.config[:manifest_path]
|
98
|
-
Xambuild.config[:assembly_name] = doc.xpath("string(//manifest/@package)")
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
private_class_method
|
103
|
-
|
104
|
-
def self.find_file(query, depth)
|
105
|
-
itr = 0
|
106
|
-
files = []
|
107
|
-
|
108
|
-
loop do
|
109
|
-
files = Dir.glob(query)
|
110
|
-
query = "../#{query}"
|
111
|
-
itr += 1
|
112
|
-
break if files.any? || (itr > depth)
|
113
|
-
end
|
114
|
-
|
115
|
-
files.first
|
116
|
-
end
|
117
|
-
|
118
|
-
def self.get_parser_handle(filename)
|
119
|
-
f = File.open(filename)
|
120
|
-
doc = Nokogiri::XML(f)
|
121
|
-
f.close
|
122
|
-
|
123
|
-
doc
|
124
|
-
end
|
125
|
-
|
126
|
-
def self.fix_path_relative(path)
|
127
|
-
root = File.dirname Xambuild.config[:solution_path]
|
128
|
-
path = "#{root}/#{path}"
|
129
|
-
path
|
130
|
-
end
|
131
|
-
|
132
|
-
def self.abs_project_path(path)
|
133
|
-
path = path.tr('\\', "/")
|
134
|
-
platform_path = Xambuild.config[:project_path]
|
135
|
-
path = "#{File.dirname platform_path}/#{path}"
|
136
|
-
path
|
137
|
-
end
|
138
|
-
|
139
|
-
def self.abs_path(path)
|
140
|
-
path = path.tr('\\', "/")
|
141
|
-
path = File.expand_path(path)
|
142
|
-
path
|
143
|
-
end
|
144
|
-
end
|
145
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
module Xambuild
|
2
|
-
module Msbuild
|
3
|
-
class Project
|
4
|
-
attr_accessor :options
|
5
|
-
|
6
|
-
def initialize(options)
|
7
|
-
@options = options
|
8
|
-
end
|
9
|
-
|
10
|
-
def project_name
|
11
|
-
@options[:project_name]
|
12
|
-
end
|
13
|
-
|
14
|
-
def project_path
|
15
|
-
@options[:project_path]
|
16
|
-
end
|
17
|
-
|
18
|
-
def ios?
|
19
|
-
is_platform? Xambuild::Platform::IOS
|
20
|
-
end
|
21
|
-
|
22
|
-
def osx?
|
23
|
-
is_platform? Xambuild::Platform::OSX
|
24
|
-
end
|
25
|
-
|
26
|
-
def android?
|
27
|
-
is_platform? Xambuild::Platform::ANDROID
|
28
|
-
end
|
29
|
-
|
30
|
-
def is_platform?(platform)
|
31
|
-
case platform
|
32
|
-
when Xambuild::Platform::IOS
|
33
|
-
then project_name.downcase.include? "ios"
|
34
|
-
when Xambuild::Platform::OSX
|
35
|
-
then project_name.downcase.include? "mac"
|
36
|
-
when Xambuild::Platform::ANDROID
|
37
|
-
then project_name.downcase.include? "droid"
|
38
|
-
else false
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module Xambuild
|
2
|
-
module Msbuild
|
3
|
-
class Solution
|
4
|
-
attr_accessor :projects
|
5
|
-
|
6
|
-
def initialize
|
7
|
-
@projects = []
|
8
|
-
end
|
9
|
-
|
10
|
-
def add_project(project)
|
11
|
-
@projects << project
|
12
|
-
end
|
13
|
-
|
14
|
-
def get_platform(platform)
|
15
|
-
@projects.select { |p| p.is_platform? platform }
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
require "fastlane/plugin/xambuild/helpers/msbuild/solution"
|
2
|
-
|
3
|
-
module Xambuild
|
4
|
-
module Msbuild
|
5
|
-
class SolutionParser
|
6
|
-
def self.parse(filename)
|
7
|
-
solution = Solution.new
|
8
|
-
|
9
|
-
File.open(filename) do |f|
|
10
|
-
f.read.split("\n").each do |line|
|
11
|
-
if line.start_with? "Project"
|
12
|
-
options = parse_line line
|
13
|
-
solution.add_project Project.new(options)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
solution
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.parse_line(line)
|
22
|
-
name = get_project_name line
|
23
|
-
project_file = get_project_file line
|
24
|
-
{project_name: name, project_path: project_file}
|
25
|
-
end
|
26
|
-
|
27
|
-
def self.get_project_name(project_line)
|
28
|
-
project_line.split("\"")[3]
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.get_project_file(project_line)
|
32
|
-
project_line.split("\"")[5].tr('\\', "/")
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|