souyuz 0.7.2 → 0.8.1

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
- SHA1:
3
- metadata.gz: b64f8f3f0b47ac83077bade70b976957f9c3c8cd
4
- data.tar.gz: c2de1d9f237a7fdfbad03beaedafe8e915b965c9
2
+ SHA256:
3
+ metadata.gz: df17b3536e569b94853ca253515178b8237baa39bb4b8caecee89ec309beb068
4
+ data.tar.gz: 1a49c072ced2b71497e51dd5b2393cf73632f0e122a171ee2de78e65e8a43018
5
5
  SHA512:
6
- metadata.gz: 680c049a707309caa92e76cc5eb8ee1940e4725855f371c3ac97b437c6c1b5f8d90a0e55d9288b880172826c06a8f363cbd426d36a41d669eb40d0e4223310b3
7
- data.tar.gz: a3b0b09e13c0919182ea485822f7e46a83f608b4c9d43553024f5a228ba45b8fb4c7ec4de0d4c8dbe5e8172acd9ba9493b0840abf592928fe3c6e0a665dd73ba
6
+ metadata.gz: 2b7f8653ffab635f9a967cc88e7973af62081249a9a3c5f07d83d810ac91122ae2cd45fffca0f8fcc830902f6009968f339d035ab287395678080c94d65732b0
7
+ data.tar.gz: a1cb04c106f24ed6178b55bd3272d8516c9bba4af0e0903e52cc95c3fc32f47be8a5959dbc7dcab3b0057f8427a61917d8ce5b36232e0361cbaa9a299d8d8058
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Souyuz
2
2
 
3
+ [![Build Status](https://travis-ci.org/voydz/souyuz.svg?branch=master)](https://travis-ci.org/voydz/souyuz)
4
+
3
5
  A fastlane component to make Xamarin builds a breeze. Souyuz is now avaialbe as an **Fastlane plugin** see [fastlane-plugin-souyuz](fastlane-plugin-souyuz) for details.
4
6
 
5
7
  *NOTE: While souyuz should continue working with your existing configuration just fine, consider using the Fastlane plugin.*
@@ -25,4 +27,4 @@ souyuz(
25
27
 
26
28
  ## Licensing
27
29
 
28
- Souyuz is licensed under the MIT License. See [LICENSE](LICENSE) for the full license text.
30
+ Souyuz is licensed under the MIT License. See [LICENSE](LICENSE) for the full license text.
data/bin/souyuz CHANGED
@@ -3,4 +3,4 @@ $LOAD_PATH.push File.expand_path("../../lib", __FILE__)
3
3
 
4
4
  require "souyuz"
5
5
  require "souyuz/commands_generator"
6
- Souyuz::CommandsGenerator.start
6
+ Souyuz::CommandsGenerator.start
data/lib/souyuz.rb CHANGED
@@ -1,4 +1,3 @@
1
- # -*- encoding : utf-8 -*-
2
1
  require 'souyuz/version'
3
2
  require 'souyuz/platform'
4
3
  require 'souyuz/manager'
@@ -1,4 +1,3 @@
1
- # -*- encoding : utf-8 -*-
2
1
  require "commander"
3
2
  require "fastlane"
4
3
 
@@ -1,4 +1,3 @@
1
- # -*- encoding : utf-8 -*-
2
1
  require 'nokogiri'
3
2
 
4
3
  module Souyuz
@@ -9,7 +8,7 @@ module Souyuz
9
8
  def self.set_additional_default_values
10
9
  config = Souyuz.config
11
10
 
12
- # TODO detect_platform automatically for :platform config
11
+ # TODO: detect_platform automatically for :platform config
13
12
 
14
13
  # set correct implicit build platform for android
15
14
  if config[:platform] == Platform::ANDROID
@@ -35,16 +34,8 @@ module Souyuz
35
34
 
36
35
  def self.detect_solution
37
36
  return if Souyuz.config[:solution_path]
38
- itr = 0
39
- query = '*.sln'
40
-
41
- begin
42
- files = Dir.glob(query)
43
- query = "../#{query}"
44
- itr += 1
45
- end until files.any? or itr > 3
46
37
 
47
- sln = files.first # pick first file as solution
38
+ sln = find_file('*.sln', 3) # search for solution
48
39
  UI.user_error! 'Not able to find solution file automatically, try to specify it via `solution_path` parameter.' unless sln
49
40
 
50
41
  Souyuz.config[:solution_path] = abs_path sln
@@ -55,7 +46,7 @@ module Souyuz
55
46
 
56
47
  path = Souyuz.config[:solution_path]
57
48
  projects = Msbuild::SolutionParser.parse(path)
58
- .get_platform Souyuz.config[:platform]
49
+ .get_platform Souyuz.config[:platform]
59
50
 
60
51
  UI.user_error! "Not able to find any project in solution, that matches the platform `#{Souyuz.config[:platform]}`." unless projects.any?
61
52
 
@@ -89,16 +80,8 @@ module Souyuz
89
80
 
90
81
  def self.detect_info_plist
91
82
  return if Souyuz.config[:plist_path] or Souyuz.config[:platform] != Platform::IOS
92
- itr = 0
93
- query = '../Info.plist'
94
83
 
95
- begin
96
- files = Dir.glob(query)
97
- query = "*/#{query}"
98
- itr += 1
99
- end until files.any? or itr > 1
100
-
101
- plist_path = files.first # pick first file as solution
84
+ plist_path = find_file('Info.plist', 1) # search for plist
102
85
  UI.user_error! 'Not able to find Info.plist automatically, try to specify it via `plist_path` parameter.' unless plist_path
103
86
 
104
87
  Souyuz.config[:plist_path] = abs_project_path plist_path
@@ -107,7 +90,7 @@ module Souyuz
107
90
  def self.detect_assembly_name(doc_csproj)
108
91
  return if Souyuz.config[:assembly_name]
109
92
 
110
- if [ Platform::IOS, Platform::OSX ].include? Souyuz.config[:platform]
93
+ if [Platform::IOS, Platform::OSX].include? Souyuz.config[:platform]
111
94
  Souyuz.config[:assembly_name] = doc_csproj.css('PropertyGroup > AssemblyName').text
112
95
  elsif Souyuz.config[:platform] == Platform::ANDROID
113
96
  doc = get_parser_handle Souyuz.config[:manifest_path] # explicitly for this call, no cache needed
@@ -115,11 +98,25 @@ module Souyuz
115
98
  end
116
99
  end
117
100
 
118
- private
101
+ private_class_method
102
+
103
+ def self.find_file(query, depth)
104
+ itr = 0
105
+ files = []
106
+
107
+ loop do
108
+ files = Dir.glob(query)
109
+ query = "../#{query}"
110
+ itr += 1
111
+ break if files.any? or itr > depth
112
+ end
113
+
114
+ return files.first # pick first file
115
+ end
119
116
 
120
117
  def self.get_parser_handle(filename)
121
- f = File::open(filename)
122
- doc = Nokogiri::XML(f)
118
+ f = File.open(filename)
119
+ doc = Nokogiri::XML(f)
123
120
  f.close
124
121
 
125
122
  return doc
@@ -143,5 +140,5 @@ module Souyuz
143
140
  path = File.expand_path(path) # absolute dir
144
141
  path
145
142
  end
146
- end
143
+ end
147
144
  end
@@ -1,12 +1,8 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Souyuz
3
2
  # Responsible for building the zipalign command
4
3
  class AndroidZipalignCommandGenerator
5
4
  class << self
6
5
  def generate
7
- build_apk_path = Souyuz.cache[:build_apk_path]
8
- aligned_apk = "#{build_apk_path}-signed"
9
-
10
6
  parts = prefix
11
7
  parts << zipalign_apk
12
8
  parts += options
@@ -18,6 +14,8 @@ module Souyuz
18
14
  end
19
15
 
20
16
  def detect_build_tools
17
+ UI.user_error! "Please ensure that the Android SDK is installed and the ANDROID_HOME variable is set correctly" unless ENV['ANDROID_HOME']
18
+
21
19
  # determine latest buildtool version
22
20
  buildtools = File.join(ENV['ANDROID_HOME'], 'build-tools')
23
21
  version = Dir.entries(buildtools).sort.last
@@ -35,8 +33,6 @@ module Souyuz
35
33
  end
36
34
 
37
35
  def options
38
- config = Souyuz.config
39
-
40
36
  options = []
41
37
  options << "-v" if $verbose
42
38
  options << "-f"
@@ -46,7 +42,7 @@ module Souyuz
46
42
  end
47
43
 
48
44
  def prefix
49
- ["set -o pipefail &&"]
45
+ [""]
50
46
  end
51
47
 
52
48
  def pipe
@@ -1,4 +1,3 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Souyuz
3
2
  # Responsible for building the fully working build command
4
3
  class BuildCommandGenerator
@@ -15,7 +14,7 @@ module Souyuz
15
14
  end
16
15
 
17
16
  def prefix
18
- ["set -o pipefail &&"]
17
+ [""]
19
18
  end
20
19
 
21
20
  def compiler_bin
@@ -27,9 +26,10 @@ module Souyuz
27
26
 
28
27
  options = []
29
28
  options << "/p:Configuration=#{config[:build_configuration]}" if config[:build_configuration]
29
+ options << config[:extra_build_options] if config[:extra_build_options]
30
30
  options << "/p:Platform=#{config[:build_platform]}" if Souyuz.project.ios? and config[:build_platform]
31
31
  options << "/p:BuildIpa=true" if Souyuz.project.ios?
32
- if (config[:solution_path])
32
+ if config[:solution_path]
33
33
  solution_dir = File.dirname(config[:solution_path])
34
34
  options << "/p:SolutionDir=#{solution_dir}/"
35
35
  end
@@ -1,4 +1,3 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Souyuz
3
2
  # Responsible for building the jarsigner command
4
3
  class JavaSignCommandGenerator
@@ -18,7 +17,7 @@ module Souyuz
18
17
  end
19
18
 
20
19
  def prefix
21
- ["set -o pipefail &&"]
20
+ [""]
22
21
  end
23
22
 
24
23
  def detect_jarsigner_executable
@@ -1,4 +1,3 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Souyuz
3
2
  # Responsible for building the zip dsym command
4
3
  class ZipDsymCommandGenerator
@@ -13,7 +12,7 @@ module Souyuz
13
12
  end
14
13
 
15
14
  def prefix
16
- ["set -o pipefail &&"]
15
+ [""]
17
16
  end
18
17
 
19
18
  def detect_zip_executable
@@ -1,4 +1,3 @@
1
- # -*- encoding : utf-8 -*-
2
1
  require "fastlane"
3
2
 
4
3
  module Souyuz
@@ -1,4 +1,3 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Souyuz
3
2
  module Msbuild
4
3
  class Project
@@ -30,14 +29,14 @@ module Souyuz
30
29
 
31
30
  def is_platform?(platform)
32
31
  return case platform
33
- when Souyuz::Platform::IOS
32
+ when Souyuz::Platform::IOS
34
33
  then self.project_name.downcase.include? 'ios'
35
- when Souyuz::Platform::OSX
34
+ when Souyuz::Platform::OSX
36
35
  then self.project_name.downcase.include? 'mac'
37
- when Souyuz::Platform::ANDROID
36
+ when Souyuz::Platform::ANDROID
38
37
  then self.project_name.downcase.include? 'droid'
39
- else false
40
- end
38
+ else false
39
+ end
41
40
  end
42
41
  end
43
42
  end
@@ -1,4 +1,3 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Souyuz
3
2
  module Msbuild
4
3
  class Solution
@@ -1,15 +1,14 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Souyuz
3
2
  module Msbuild
4
3
  class SolutionParser
5
4
  def self.parse(filename)
6
5
  solution = Solution.new
7
6
 
8
- File::open(filename) do |f|
7
+ File.open(filename) do |f|
9
8
  f.read.split("\n").each do |line|
10
- if line.start_with? "Project"
9
+ if line.start_with? "Project"
11
10
  options = parse_line line
12
- solution.add_project Project.new(options) #maybe we should not use the project class for this
11
+ solution.add_project Project.new(options) # maybe we should not use the project class for this
13
12
  end
14
13
  end
15
14
  end
@@ -1,4 +1,3 @@
1
- # -*- encoding : utf-8 -*-
2
1
  require "fastlane"
3
2
 
4
3
  module Souyuz
@@ -25,8 +24,12 @@ module Souyuz
25
24
  FastlaneCore::ConfigItem.new(key: :build_target,
26
25
  env_name: "SOUYUZ_BUILD_TARGET",
27
26
  description: "Build targets to build",
28
- default_value: [ 'Build' ],
27
+ default_value: ['Build'],
29
28
  type: Array),
29
+ FastlaneCore::ConfigItem.new(key: :extra_build_options,
30
+ env_name: "SOUYUZ_EXTRA_BUILD_OPTIONS",
31
+ description: "Extra options to pass to `msbuild`. Example: `/p:MYOPTION=true`",
32
+ optional: true),
30
33
  FastlaneCore::ConfigItem.new(key: :output_path,
31
34
  env_name: "SOUYUZ_BUILD_OUTPUT_PATH",
32
35
  description: "Build output path",
@@ -75,7 +78,7 @@ module Souyuz
75
78
  default_value: 'http://timestamp.digicert.com',
76
79
  env_name: "SOUYUZ_ANDROID_KEYSTORE_TSA",
77
80
  description: "TSA for jarsigner",
78
- optional: true),
81
+ optional: true)
79
82
  ]
80
83
  end
81
84
  end
@@ -1,4 +1,3 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Souyuz
3
2
  module Platform
4
3
  IOS = 'ios'
data/lib/souyuz/runner.rb CHANGED
@@ -1,4 +1,3 @@
1
- # -*- encoding : utf-8 -*-
2
1
  require 'fastlane'
3
2
 
4
3
  module Souyuz
@@ -15,7 +14,7 @@ module Souyuz
15
14
  path
16
15
  elsif Souyuz.project.android?
17
16
  path = apk_file
18
- if (config[:keystore_path] && config[:keystore_alias])
17
+ if config[:keystore_path] && config[:keystore_alias]
19
18
  UI.success "Jar it, sign it, zip it..."
20
19
 
21
20
  jarsign_and_zipalign
@@ -70,7 +69,7 @@ module Souyuz
70
69
  # in the upcomming switch we determin the output path of iOS ipa files
71
70
  # those change in the Xamarin.iOS Cycle 9 release
72
71
  # see https://developer.xamarin.com/releases/ios/xamarin.ios_10/xamarin.ios_10.4/
73
- if File.exists? "#{build_path}/#{assembly_name}.ipa"
72
+ if File.exist? "#{build_path}/#{assembly_name}.ipa"
74
73
  # after Xamarin.iOS Cycle 9
75
74
  package_path = build_path
76
75
  else
@@ -92,13 +91,13 @@ module Souyuz
92
91
  assembly_name = Souyuz.project.options[:assembly_name]
93
92
 
94
93
  build_dsym_path = "#{build_path}/#{assembly_name}.app.dSYM"
95
- if not File.exists? build_dsym_path
94
+ unless File.exist? build_dsym_path
96
95
  UI.success "Did not found dSYM at #{build_dsym_path}, skipping..."
97
96
  return
98
97
  end
99
98
 
100
99
  Souyuz.cache[:build_dsym_path] = build_dsym_path
101
-
100
+
102
101
  command = ZipDsymCommandGenerator.generate
103
102
  FastlaneCore::CommandExecutor.execute(command: command,
104
103
  print_all: true,
@@ -106,7 +105,7 @@ module Souyuz
106
105
 
107
106
  # move dsym aside ipa
108
107
  dsym_path = "#{dsym_path}.zip"
109
- if File.exists? dsym_path
108
+ if File.exist? dsym_path
110
109
  FileUtils.mv(dsym_path, "#{package_path}/#{File.basename dsym_path}")
111
110
  end
112
111
  end
@@ -1,5 +1,5 @@
1
- # -*- encoding : utf-8 -*-
1
+
2
2
  module Souyuz
3
- VERSION = "0.7.2"
3
+ VERSION = "0.8.1"
4
4
  DESCRIPTION = "A fastlane component to make Xamarin builds a breeze"
5
5
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souyuz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Rudat
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-05 00:00:00.000000000 Z
11
+ date: 2018-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: nokogiri
14
+ name: fastlane
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.7'
19
+ version: 2.29.0
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: '1.7'
26
+ version: 2.29.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: highline
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.7'
41
41
  - !ruby/object:Gem::Dependency
42
- name: fastlane
42
+ name: nokogiri
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.103.0
47
+ version: '1.7'
48
48
  type: :runtime
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: 1.103.0
54
+ version: '1.7'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pry
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -84,30 +84,16 @@ dependencies:
84
84
  name: rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '='
88
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: magic_encoding
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
89
+ version: 0.49.1
104
90
  type: :development
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
- - - ">="
94
+ - - '='
109
95
  - !ruby/object:Gem::Version
110
- version: '0'
96
+ version: 0.49.1
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: bundler
113
99
  requirement: !ruby/object:Gem::Requirement
@@ -173,7 +159,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
173
159
  requirements:
174
160
  - - ">="
175
161
  - !ruby/object:Gem::Version
176
- version: 2.0.0
162
+ version: 2.2.0
177
163
  required_rubygems_version: !ruby/object:Gem::Requirement
178
164
  requirements:
179
165
  - - ">="
@@ -181,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
167
  version: '0'
182
168
  requirements: []
183
169
  rubyforge_project:
184
- rubygems_version: 2.5.0
170
+ rubygems_version: 2.7.6
185
171
  signing_key:
186
172
  specification_version: 4
187
173
  summary: A fastlane component to make Xamarin builds a breeze