jenkinsutil 0.8.48 → 1.0.49

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: ea2f0dc0b8096fbb182a2f13b7c6dd2abc6812fa
4
- data.tar.gz: c26ab0f5ffd881c1e15ddf7034988dd0d9fa0d12
3
+ metadata.gz: 3bf5fba8b81786a0b3bd9e1958ca1379bd2cad1b
4
+ data.tar.gz: 1079a35c6c4ec12d870ec00b867f349649303967
5
5
  SHA512:
6
- metadata.gz: 5591e8d8d6d676f5e32b174b7102b820054d981df1e1b7a1699f0b0e907261a880934df77f4898b81f472ca6e801852153b3ff8ea075730bbfdfec566ee0e608
7
- data.tar.gz: 3188089ea73b8dbbd76f0e6955905d159393cbd6117d1f508012f5121404c5ff8222daa9ab364c5cf4d238a77d6a0052779dcbfaba79d148510c063c33923ed7
6
+ metadata.gz: 240f5b2470541377da8956890baf81231cce15dc38df86e6a2072725b498d93c9ac6ca02393251559aa9a8a131c498e21bf0bc2830ca7ff676cfcc004fc27745
7
+ data.tar.gz: 59e4b402f885f98784c7b43ff26daf56687f8d09e7059395068ed8295049d9ed5a7885f2f34e8859275f37d541f6c40dcb7229e9e0637f7f40ba119855ea70b5
data/JenkinsUtil.gemspec CHANGED
@@ -22,9 +22,10 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency 'open4', '~> 1.3'
23
23
  spec.add_dependency 'sys-proctable', '~> 1.0'
24
24
  spec.add_dependency 'dropbox-sdk', '~> 1.6'
25
- spec.add_dependency 'xcodeproj', '~> 1.1'
25
+ spec.add_dependency 'xcodeproj', '~> 1.4'
26
26
  spec.add_dependency 'rubyzip', '~> 1.2'
27
27
  spec.add_dependency 'ffi', '~> 1.9'
28
+ spec.add_dependency 'plist', '~> 3.2'
28
29
 
29
30
  spec.add_development_dependency 'bundler', '~> 1.11'
30
31
  spec.add_development_dependency 'rake', '~> 11.1'
@@ -12,14 +12,18 @@ class ArgumentHandler
12
12
  :dropbox_root,
13
13
  :kill_simulators,
14
14
  :xcode_project_path,
15
+ :xcode_export_plist,
16
+ :xcode_team_id,
15
17
  :xcode_target,
16
18
  :xcode_build_configuration,
17
19
  :xcode_bundle_identifier,
18
20
  :xcode_bundle_version,
21
+ :xcode_set_manual_provisioning_style,
19
22
  :zip_sources,
20
23
  :zip_archive,
21
24
  :zip_destination,
22
- :verbose
25
+ :verbose,
26
+ :version
23
27
 
24
28
  # rubocop:disable Metrics/AbcSize
25
29
  # rubocop:disable Metrics/MethodLength
@@ -34,14 +38,18 @@ class ArgumentHandler
34
38
  @dropbox_root = Dir.pwd
35
39
  @kill_simulators = false
36
40
  @xcode_project_path = nil
41
+ @xcode_export_plist = nil
42
+ @xcode_team_id = nil
37
43
  @xcode_target = nil
38
44
  @xcode_build_configuration = nil
39
45
  @xcode_bundle_identifier = nil
40
46
  @xcode_bundle_version = nil
47
+ @xcode_set_manual_provisioning_style = nil
41
48
  @zip_sources = []
42
49
  @zip_archive = nil
43
50
  @zip_destination = nil
44
51
  @verbose = false
52
+ @version = false
45
53
 
46
54
  ARGV.push('-h') if ARGV.empty?
47
55
 
@@ -98,6 +106,14 @@ class ArgumentHandler
98
106
  @xcode_project_path = project_path
99
107
  end
100
108
 
109
+ opts.on('--xcode-export-plist plist', 'Path to an Xcode export plist') do |export_plist|
110
+ @xcode_export_plist = export_plist
111
+ end
112
+
113
+ opts.on('--xcode-get-team-id', 'Display Team ID from an export plist') do
114
+ @xcode_team_id = true
115
+ end
116
+
101
117
  opts.on('--xcode-target target', 'Target to update in the Xcode project specified with --xcode-project') do |target|
102
118
  @xcode_target = target
103
119
  end
@@ -117,6 +133,10 @@ class ArgumentHandler
117
133
  @xcode_bundle_version = bundle_version
118
134
  end
119
135
 
136
+ opts.on('--xcode-set-manual-provisioning-style', 'Set project to automatically sign if true and Manual if false') do
137
+ @xcode_set_manual_provisioning_style = true
138
+ end
139
+
120
140
  # zip_util
121
141
  opts.on('--zip-compress s1,s2,s3', Array, 'Compress files into zip archive') do |sources|
122
142
  @zip_sources = sources
@@ -133,7 +153,7 @@ class ArgumentHandler
133
153
  end
134
154
 
135
155
  # logger_util
136
- opts.on('-v', '--verbose', 'Output more information') do
156
+ opts.on('--verbose', 'Output more information') do
137
157
  @verbose = true
138
158
  end
139
159
 
@@ -141,6 +161,10 @@ class ArgumentHandler
141
161
  puts opts
142
162
  abort
143
163
  end
164
+
165
+ opts.on_tail('-v', '--version', 'Display Current version') do
166
+ @version = true
167
+ end
144
168
  end
145
169
 
146
170
  parser.parse!
@@ -1,3 +1,3 @@
1
1
  module JenkinsUtil
2
- VERSION = "0.8.#{ENV['BUILD_NUMBER'] || 'dev'}".freeze
2
+ VERSION = "1.0.#{ENV['BUILD_NUMBER'] || 'dev'}".freeze
3
3
  end
@@ -2,6 +2,7 @@ require 'JenkinsUtil/process_util'
2
2
  require 'JenkinsUtil/command_line_script'
3
3
  require 'JenkinsUtil/logger_util'
4
4
  require 'xcodeproj'
5
+ require 'plist'
5
6
 
6
7
  class XcodeUtil
7
8
  def initialize
@@ -14,7 +15,7 @@ class XcodeUtil
14
15
  @xcodebuild_version_flag = '-version'
15
16
 
16
17
  unless File.exist?(@default_xcodebuild_path)
17
- LoggerUtil.log.fatal("xcodebuild not found: #{@default_xcodebuild_path}")
18
+ LoggerUtil.fatal("xcodebuild not found: #{@default_xcodebuild_path}")
18
19
  abort
19
20
  end
20
21
 
@@ -79,7 +80,50 @@ class XcodeUtil
79
80
  def self.set_project_bundle_identifier(project_path, target_name, build_configuration_name, bundle_identifier)
80
81
  self.with_project_build_configuration(project_path, target_name, build_configuration_name) do |project, build_configuration|
81
82
  build_configuration.build_settings['PRODUCT_BUNDLE_IDENTIFIER'] = bundle_identifier
82
- project.save()
83
+ project.save
83
84
  end
84
85
  end
86
+
87
+ def self.get_project_provisioning_style(project_path)
88
+ project = Xcodeproj::Project.open(project_path)
89
+
90
+ project.root_object.attributes['TargetAttributes'].values.each do |target_value|
91
+ target_value.each do |attribute_key, attribute_value|
92
+ if attribute_key == 'ProvisioningStyle'
93
+ return attribute_value
94
+ end
95
+ end
96
+ end
97
+
98
+ LoggerUtil.fatal("'ProvisioningStyle' key not found, please check and uncheck automatic signing")
99
+ end
100
+
101
+ def self.set_project_provisioning_style(project_path, is_automatic)
102
+ project = Xcodeproj::Project.open(project_path)
103
+
104
+ project.root_object.attributes['TargetAttributes'].values.each do |target_value|
105
+ target_value.keys.each do |attribute_key|
106
+ if attribute_key == 'ProvisioningStyle'
107
+ if is_automatic == true
108
+ target_value[attribute_key] = 'Automatic'
109
+ else
110
+ target_value[attribute_key] = 'Manual'
111
+ end
112
+
113
+ project.save
114
+ return
115
+ end
116
+ end
117
+ end
118
+
119
+ LoggerUtil.fatal("'ProvisioningStyle' key not found, please check and uncheck automatic signing")
120
+ end
121
+
122
+ def self.team_id_from_plist(plist_file)
123
+ plist_path = File.expand_path(plist_file)
124
+ plist = Plist::parse_xml(plist_path)
125
+ LoggerUtil.fatal("teamID not found in #{plist_file}") if plist.nil? || !plist.key?('teamID')
126
+
127
+ return plist['teamID']
128
+ end
85
129
  end
data/lib/JenkinsUtil.rb CHANGED
@@ -18,7 +18,7 @@ module JenkinsUtil
18
18
 
19
19
  # KeychainUtil
20
20
  unless args.keychain.nil? && args.keychain_password.nil?
21
- KeychainUtil.unlock_keychain(args.keychain,args.keychain_password, args.code_signing_identities)
21
+ KeychainUtil.unlock_keychain(args.keychain, args.keychain_password, args.code_signing_identities)
22
22
  end
23
23
 
24
24
  # DropboxUtil
@@ -26,6 +26,7 @@ module JenkinsUtil
26
26
  DropboxUtil.upload(args.dropbox_sources, args.dropbox_destination, args.dropbox_flatten, args.dropbox_root)
27
27
  end
28
28
 
29
+ # XcodeUtil
29
30
  if args.kill_simulators
30
31
  SimulatorUtil.reset_all_simulators
31
32
  end
@@ -40,6 +41,11 @@ module JenkinsUtil
40
41
  end
41
42
  end
42
43
 
44
+ # Not using LoggerUtil so there is no time stamp
45
+ puts XcodeUtil.team_id_from_plist(args.xcode_export_plist) if !args.xcode_export_plist.nil? && !args.xcode_team_id.nil?
46
+
47
+ XcodeUtil.set_project_provisioning_style(args.xcode_project_path, !args.xcode_set_manual_provisioning_style) if !args.xcode_project_path.nil? && !args.xcode_set_manual_provisioning_style.nil?
48
+
43
49
  if (!args.zip_sources.empty? || !args.zip_archive.nil?) && !args.zip_destination.nil?
44
50
  if !args.zip_sources.empty?
45
51
  ZipUtil.compress(*args.zip_sources, args.zip_destination)
@@ -49,4 +55,7 @@ module JenkinsUtil
49
55
  ZipUtil.uncompress(args.zip_archive, args.zip_destination)
50
56
  end
51
57
  end
58
+
59
+ # Version
60
+ LoggerUtil.log.info(VERSION) if args.version
52
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jenkinsutil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.48
4
+ version: 1.0.49
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett McGinnis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-25 00:00:00.000000000 Z
11
+ date: 2016-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: open4
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.1'
61
+ version: '1.4'
62
62
  type: :runtime
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: '1.1'
68
+ version: '1.4'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rubyzip
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.9'
97
+ - !ruby/object:Gem::Dependency
98
+ name: plist
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.2'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.2'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: bundler
99
113
  requirement: !ruby/object:Gem::Requirement