fastlane-plugin-xamarin_build 0.1.2 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc9b6461deccec1a91b94edae071551785687afa
4
- data.tar.gz: 22a6aecac4ef5c51c7061e6f4a3fa634d984a676
3
+ metadata.gz: a2d2d1abf6a1fdcf598e61fa8da240d8b5d400fd
4
+ data.tar.gz: 54f08f7c1c9c969af3322dbdf943edce85410dec
5
5
  SHA512:
6
- metadata.gz: 3abc921e3d5b13a68e0428959795e1d27f5627d10c4ad28af0672d55fd8b9dd9704a72c0a3903017cedcf093c8a9fe3106b637f2eebe6afe56be034073343123
7
- data.tar.gz: 8046804e564c24bc413801ec8cf3a4ef96956aa6a073530a1aa3c98fc73f80f8fc29db11010d74ca0d198ebbea4bd0f67a0f7e18f56e661b2b3b2114fa42a635
6
+ metadata.gz: 28d81d07f6c1d17fe5513dd8b24715388d52bf4960a49cb3f47a5dcf359d2c62bf2dd31bae2f89c6cddc1049bdc8c788fce4c6a9e3d03c3ca4b1ba01d068dbd1
7
+ data.tar.gz: 938bbf79b4cd20fad49e4051cfb489d373510180eea1dd9e4da7fe7eb6b46a09150c1b510930144047a2244790266256e8dccfe566ad4bf9596e151607e21b53
checksums.yaml.gz.asc CHANGED
@@ -1,11 +1,11 @@
1
1
  -----BEGIN PGP SIGNATURE-----
2
2
  Version: GnuPG v1
3
3
 
4
- iQEcBAABAgAGBQJXeircAAoJEAPmZ1UHrajBDpwH/RE8MwohBBox1SBwrU/oJDcR
5
- 249hTc1JMcG0VnIBMgojiHyFeZHW48kkilHcrM3jDJASjpCRC+GTjrvxMY68hY7n
6
- 8BllEyOp7+MvMXMx1g22dhH5h4ggUVh8ZO+0syXS7JWStgJHoeotDgyVsrlU7fBB
7
- ov6il/VrvlMLH6PxFGtbp8wa9MLZ/1XsWCgZrdIX8HyKzy+qt7B6lQoBGgaQpF+h
8
- DoNxpSU+DByVrozCWTTLWSZuXadoSAOdUShrN46WoX628IyR9vCCIuf2yaBC71Za
9
- 0lXujG5mrrjKdorcUVc6+mq6dp4MzIFAK6LKCk0cN5M19wNs/AozSfhc8qbjc9A=
10
- =oYV4
4
+ iQEcBAABAgAGBQJXhN7rAAoJEAPmZ1UHrajBWj8H/1a26D074DfqufLFKcF2GZz7
5
+ nHC+RDgUzl+MuX+GoubsaIjD9ZeMQbrso+o+1bwKiSWEJgE3diwSAk8SGFB8kcke
6
+ Dr+YAJacjT48x1/LxG5paHbqF5Qp5VQDdzVUXI8Dr4HugOpjB4zMyQdP9v++Fmr8
7
+ sPouOAh3+gkrFLx7O9MgyocV7r32KeYxAkUy+eh7EfshAbaV93e5NlczS1to3btB
8
+ a+tzzpDbmNnma9KjoKE1pICA2IgwX/WANkLqBxVhgF+SVsflMQc/KJOsuyWKe/31
9
+ VmcUdoGyGEAny3bcZvuq6LjxS5tSJ+QF7vFXOLW3aVjaFC/1rcHUrRvWidBomd0=
10
+ =lrv2
11
11
  -----END PGP SIGNATURE-----
data.tar.gz.asc CHANGED
@@ -1,11 +1,11 @@
1
1
  -----BEGIN PGP SIGNATURE-----
2
2
  Version: GnuPG v1
3
3
 
4
- iQEcBAABAgAGBQJXeirbAAoJEAPmZ1UHrajB09UH/jZr+SNlF17hsfNL5ecOFyNv
5
- wULRGGYlP+IDRgfyPEW3tCqsRGJFiSpttNX+UqvfLiQWg084yVXZc315pgFQCtoD
6
- C7HinctbrVmadX9BsdWIhkrU1kJ6GPpQBuBdszL10MK53q2oRD2Idk/F+Rpq7fV/
7
- 5pCNfdqePoxgaqN74OcuLpMJ/65bE50snFNgwdbD+U8uXPq+PiOM1AktdEaullz5
8
- wvMvHsqrWIFdWWLdyrUOfAnvqdjTJVtwOU2NpMF302612LwyVegdJKYzJD2P/uFz
9
- HC/pk6FpI58Mxh9VlV8VGS9PmlRqufM6vaPDGsir6ZlKYJrRxU8YH9FS14darAo=
10
- =JGxn
4
+ iQEcBAABAgAGBQJXhN7qAAoJEAPmZ1UHrajBmMMH/1KwLb/0FI9jwOrJ7lZVqJ8+
5
+ PqMDP9LSXyLKwnm9pEcLDPNOHEeOsDTlfOzM82+BDDpZ58UKHeEZhRDbiFWDnAp/
6
+ OIPOuTfMSTqMm3dgq2MKPxwdvDEE4rO2ZH+e+zsRTmJbUtRrFUug0kXvu0wJMNXQ
7
+ XnpQiDtczfBw+znZIiJswQFiy+lsZ/XN15k6UwDJXGBdJnK+BiwxrXqjzMA4mmP6
8
+ BDSDA/ACu/dkztPtK+dsImfGFAhT/xR1YvyJOmFIyS3vOKev0cZP/pLI3iWrnuAZ
9
+ ucmsEs54HTpDj8RE489OG6L8/668VOkpon03xrUJLmnGOTciJRXmozzyLoFNJVo=
10
+ =XsyR
11
11
  -----END PGP SIGNATURE-----
@@ -2,22 +2,85 @@ module Fastlane
2
2
  module Actions
3
3
  class XamarinBuildAction < Action
4
4
  MDTOOL = '/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool'.freeze
5
+ XBUILD = '/Library/Frameworks/Mono.framework/Commands/xbuild'.freeze
5
6
 
6
7
  def self.run(params)
7
8
  platform = params[:platform]
8
- build_type = params[:target]
9
+ project = params[:project]
9
10
 
10
- configuration = "--configuration:#{build_type}|#{platform}"
11
- xamarin_command = "#{MDTOOL} build #{params[:solution]} \"#{configuration}\""
11
+ projects = (params[:projects] or '').split(',').select do |item|
12
+ item.size > 0
13
+ end
14
+
15
+ projects << project if project != nil
16
+ projects = projects.uniq
12
17
 
13
- Helper::XamarinBuildHelper.bash(xamarin_command, !params[:print_all])
18
+ if params[:build_util] == 'mdtool'
19
+ if projects.size > 0
20
+ mdtool_build_projects(params, projects)
21
+ else
22
+ mdtool_build_solution(params)
23
+ end
24
+ else
25
+ if projects.size > 0
26
+ puts "echo 'not supported yet'"
27
+ else
28
+ xbuild_build_solution(params)
29
+ end
30
+ end
14
31
 
15
- # it store logs in ram. Bad practive
16
- # FastlaneCore::CommandExecutor.execute(command: xamarin_command, print_all: params[:print_all], print_command: true)
32
+ build_type = params[:build_type]
33
+ solution = params[:solution]
34
+ get_build_path(platform, build_type, solution)
35
+ end
36
+
37
+
38
+
39
+ def self.mdtool_build_projects(params, projects)
40
+ platform = params[:platform]
41
+ build_type = params[:build_type]
42
+ target = params[:target]
43
+ solution = params[:solution]
44
+
45
+ for project in projects
46
+ configuration = "--configuration:#{build_type}|#{platform}"
47
+ command = "#{MDTOOL} build -t:#{target} -p:#{project} #{solution} \"#{configuration}\""
48
+ Helper::XamarinBuildHelper.bash(command, !params[:print_all])
49
+ end
17
50
 
18
- get_build_path(platform, build_type, params[:solution])
19
51
  end
20
52
 
53
+ def self.xbuild_build_solution(params)
54
+ platform = params[:platform]
55
+ build_type = params[:build_type]
56
+ target = params[:target]
57
+ solution = params[:solution]
58
+
59
+ command = "#{XBUILD} "
60
+ command << "/target:#{target} " if target != nil
61
+ command << "/p:Platform=#{platform} " if platform != nil
62
+ command << "/p:Configuration=#{build_type} " if build_type != nil
63
+ command << solution
64
+
65
+ Helper::XamarinBuildHelper.bash(command, !params[:print_all])
66
+ end
67
+
68
+
69
+
70
+
71
+
72
+ def self.mdtool_build_solution(params)
73
+ platform = params[:platform]
74
+ build_type = params[:build_type]
75
+ target = params[:target]
76
+ solution = params[:solution]
77
+
78
+ configuration = "--configuration:#{build_type}|#{platform}"
79
+ command = "#{MDTOOL} build -t:#{target} #{solution} \"#{configuration}\""
80
+ Helper::XamarinBuildHelper.bash(command, !params[:print_all])
81
+ end
82
+
83
+ # Returns bin path for given platform and build_type or nil
21
84
  def self.get_build_path(platform, build_type, solution)
22
85
  root = File.dirname(solution)
23
86
 
@@ -40,8 +103,13 @@ module Fastlane
40
103
  ['punksta']
41
104
  end
42
105
 
43
- TARGET_TYPES = %w(Release Debug).freeze
106
+ BUILD_TYPES = %w(Release Debug).freeze
107
+ TARGET_TYPES = %w(Build Clean).freeze
44
108
  PRINT_ALL = [true, false].freeze
109
+ BUILD_UTIL = [
110
+ 'xbuild',
111
+ 'mdtool'
112
+ ].freeze
45
113
 
46
114
  def self.available_options
47
115
  [
@@ -61,13 +129,24 @@ module Fastlane
61
129
  type: String
62
130
  ),
63
131
 
132
+ FastlaneCore::ConfigItem.new(
133
+ key: :build_type,
134
+ env_name: 'FL_XAMARIN_BUILD_TYPE',
135
+ description: 'Release or Debug',
136
+ type: String,
137
+ verify_block: proc do |value|
138
+ UI.user_error!("Unsupported build type! Use one of #{BUILD_TYPES.join '\' '}".red) unless BUILD_TYPES.include? value
139
+ end
140
+ ),
141
+
64
142
  FastlaneCore::ConfigItem.new(
65
143
  key: :target,
66
144
  env_name: 'FL_XAMARIN_BUILD_TARGET',
67
- description: 'Target build type',
145
+ description: 'Clean or Build',
68
146
  type: String,
147
+ default_value: 'Build',
69
148
  verify_block: proc do |value|
70
- UI.user_error!("Unsupported platform. Use one of #{TARGET_TYPES.join '\' '}".red) unless TARGET_TYPES.include? value
149
+ UI.user_error!("Unsupported target! Use one of #{TARGET_TYPES.join '\' '}".red) unless TARGET_TYPES.include? value
71
150
  end
72
151
  ),
73
152
 
@@ -79,13 +158,42 @@ module Fastlane
79
158
  is_string: false,
80
159
  optional: true,
81
160
  verify_block: proc do |value|
82
- UI.user_error!("Unsupported print all Use one of #{PRINT_ALL.join '\' '}".red) unless PRINT_ALL.include? value
161
+ UI.user_error!("Unsupported value! Use one of #{PRINT_ALL.join '\' '}".red) unless PRINT_ALL.include? value
83
162
  end
163
+ ),
164
+
165
+ FastlaneCore::ConfigItem.new(
166
+ key: :build_util,
167
+ env_name: 'FL_XAMARIN_BUILD_BUILD_UTIL',
168
+ description: 'Build util which use to build project. mdtool',
169
+ default_value: 'mdtool',
170
+ is_string: false,
171
+ optional: true,
172
+ verify_block: proc do |value|
173
+ UI.user_error!("Unsupported build util! Une of #{BUILD_UTIL.join '\' '}".red) unless BUILD_UTIL.include? value
174
+ end
175
+ ),
176
+
177
+ FastlaneCore::ConfigItem.new(
178
+ key: :project,
179
+ env_name: 'FL_XAMARIN_BUILD_PROJECT',
180
+ description: 'Project to build or clean',
181
+ is_string: true,
182
+ optional: true
183
+ ),
184
+
185
+ FastlaneCore::ConfigItem.new(
186
+ key: :projects,
187
+ env_name: 'FL_XAMARIN_BUILD_PROJECTS',
188
+ description: 'Projects to build or clean, separated by ,',
189
+ is_string: true,
190
+ optional: true
84
191
  )
85
192
  ]
86
193
  end
87
194
 
88
195
  def self.is_supported?(platform)
196
+ # android not tested
89
197
  [:ios, :android].include?(platform)
90
198
  end
91
199
  end
@@ -14,7 +14,7 @@ module Fastlane
14
14
  doc = Nokogiri::XML(file.read)
15
15
  file.close
16
16
 
17
- configuration = "'#{params[:target]}|#{params[:platform]}'"
17
+ configuration = "'#{params[:build_type]}|#{params[:platform]}'"
18
18
 
19
19
  doc.search('PropertyGroup').each do |group|
20
20
  next unless !group['Condition'].nil? && group['Condition'].include?(configuration)
@@ -54,12 +54,12 @@ module Fastlane
54
54
  UI.user_error!('Project file not found') unless File.exist? value
55
55
  end),
56
56
 
57
- FastlaneCore::ConfigItem.new(key: :target,
57
+ FastlaneCore::ConfigItem.new(key: :build_type,
58
58
  env_name: 'FL_XAMARIN_UPDATE_CONFIGURATION_TARGET',
59
59
  description: 'Target of configuration PropertyGroup',
60
60
  is_string: true,
61
61
  verify_block: proc do |value|
62
- UI.user_error!("Unsupported target! Use one of #{TARGET}") unless TARGET.include? value
62
+ UI.user_error!("Unsupported build_type! Use one of #{TARGET}") unless TARGET.include? value
63
63
  end),
64
64
 
65
65
  FastlaneCore::ConfigItem.new(key: :platform,
@@ -1,6 +1,6 @@
1
1
  module Fastlane
2
2
  module XamarinBuild
3
- VERSION = "0.1.2"
3
+ VERSION = "0.2"
4
4
  end
5
5
  end
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-xamarin_build
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - punksta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-04 00:00:00.000000000 Z
11
+ date: 2016-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.1.0
55
- - !ruby/object:Gem::Dependency
56
- name: openssl
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: pry
71
57
  requirement: !ruby/object:Gem::Requirement
metadata.gz.asc CHANGED
@@ -1,11 +1,11 @@
1
1
  -----BEGIN PGP SIGNATURE-----
2
2
  Version: GnuPG v1
3
3
 
4
- iQEcBAABAgAGBQJXeirVAAoJEAPmZ1UHrajBkvwH/0nU+vf/tnxLxRdJWLvrYxqp
5
- YsP9RZf05ZJUHEjuQZfnNrUC7j/TrBok44DhJFd3EpKmPoZ8qHEuOL/s+Iion5kn
6
- s/v8hU+yxRUybO8euKw2Rwj7Ym9iCR141FEBq+2YCJoHpqCb/3xv3RpnH59PFJ8S
7
- x7oYacjuOqxUMa5PpX86txfszsJeEYwIh50hTC/WL57QaWF2wBZOCI8yuiEsOjxH
8
- 6ZJuHa4aOEpR/29mTfSvCHJqeByKE2dHLYYUlRs/tCnt8WCJ0/qMBcyc6DzOZUqw
9
- mLZoS7kPFlPwcrBR3/sh3REzFxE8OWT7hAVAnlgNbauNoeGMh6G5Hj2PYVjs8/w=
10
- =Q7PC
4
+ iQEcBAABAgAGBQJXhN7GAAoJEAPmZ1UHrajBmHIIAKP3a0C5GocWI+6XQSTxJ7LW
5
+ cAnpE5doLIE0C0FeTF7Lunq9zX4qLEzKjuLG/IoHQhpj/tuwM3H6BWmKLL2wOkV0
6
+ MTpvkzSChsRVqBxA25dwYZGWWE9QFUFK3P8GnwiqeNVvCj/DDed/nXJfwX/9I9mx
7
+ 4AyZi0/fj5HPfwPRgdxpBfIrgkO532Xb/JwYPGLhn0m3GVU3MNEnZfBHnAgNd4Bw
8
+ V0ofnJuCW552ZZcC2Oxu5Q9eoLmiiKR13G64WMAzZ0YHMKqbUPH8HcIOS5YpG0kz
9
+ VGZxnBdv8HRMJ9jC5AJWURQPCAA8h2VXrFT11cNmVDNwLNsUbxElobVO2wIjjog=
10
+ =dQKU
11
11
  -----END PGP SIGNATURE-----