fastlane-plugin-update_project_codesigning 0.1.7 → 0.1.8

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: 2b1d4a0d5dcc4c7133789d726921e951652c7e9a
4
- data.tar.gz: ed479908cd99372f519c451753f202ea107dbf64
3
+ metadata.gz: a55165a59521ae60fd31d8fdda91ad109b8fbb8a
4
+ data.tar.gz: 35aa443c2d4bba546469c6e56756772e558ced06
5
5
  SHA512:
6
- metadata.gz: 7db277f2e5b1caa9ae7d7241465fb4f47aae0e3b14cc2d6e48ee03f95ba33cc8926e96f008b542c9bc528bafb2ef4c1551e451bf9cc4f312f6077003b1f497b1
7
- data.tar.gz: 41982bae6e9ee063758f576aa9c10e2dbd8b475ccfe380a6130d271634169f85d7b203a8afd55fb293e8ce7586a7fde815e1c2190762b693b2655e3b70909f06
6
+ metadata.gz: 41a2ef3e2178bfe5fbb2aadaab09ea4e99ec8dc3a75f7d1bc2857b8c8ad6c41c925f02b7cb5671825e50dcb0e83523d988f505d140687bd3027e4ef75249057c
7
+ data.tar.gz: 4cab31533b4a4814eee46bf580bec555b1e0f889859ed6024d082cc093ab5222347e0a19d8ddc55c8a7e293db42ffbe6d5e509c2c4486eb79a074df7eaccd82f
data/README.md CHANGED
@@ -1,26 +1,62 @@
1
1
  # update_project_codesigning plugin
2
2
 
3
3
  [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-update_project_codesigning)
4
+ ![](http://ruby-gem-downloads-badge.herokuapp.com/fastlane-plugin-update_project_codesigning)
5
+
6
+ ## About
7
+
8
+ Updates the Xcode 8 Automatic Codesigning Flag
4
9
 
5
- ## Getting Started
6
10
 
7
- This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-update_project_codesigning`, add it to your project by running:
11
+
12
+ ## Add Plugin
8
13
 
9
14
  ```bash
10
15
  fastlane add_plugin update_project_codesigning
11
16
  ```
12
17
 
13
- ## About update_project_codesigning
14
18
 
15
- Updates the Xcode 8 Automatic Codesigning Flag
19
+ ## Example
16
20
 
17
- **Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
21
+ *Set Codesigning to manual on all targets*
18
22
 
19
- ## Example
23
+ ```ruby
24
+ update_project_codesigning(
25
+ path: "demo-project/demo/demo.xcodeproj",
26
+ use_automatic_signing: false
27
+ )
28
+ ```
29
+
30
+ *Set Codesinging to automatic*
20
31
 
21
- 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`.
22
32
 
23
- **Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
33
+ ```ruby
34
+ update_project_codesigning(
35
+ path: "demo-project/demo/demo.xcodeproj",
36
+ use_automatic_signing: true
37
+ )
38
+ ```
39
+
40
+ *Only for specific targets*
41
+
42
+ ```ruby
43
+ update_project_codesigning(
44
+ path: "demo-project/demo/demo.xcodeproj",
45
+ use_automatic_signing: false,
46
+ targets: ["demo"]
47
+ )
48
+ ```
49
+
50
+ *Also set team-id*
51
+
52
+ ```ruby
53
+ update_project_codesigning(
54
+ path: "demo-project/demo/demo.xcodeproj",
55
+ use_automatic_signing: true,
56
+ team_id: "XXXXX"
57
+ )
58
+ ```
59
+
24
60
 
25
61
  ## Run tests for this plugin
26
62
 
@@ -47,6 +83,3 @@ If you have trouble using plugins, check out the [Plugins Troubleshooting](https
47
83
 
48
84
  For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Plugins.md).
49
85
 
50
- ## About `fastlane`
51
-
52
- `fastlane` is the easiest way to automate building and releasing your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
@@ -3,6 +3,7 @@ module Fastlane
3
3
  module Actions
4
4
  class UpdateProjectCodesigningAction < Action
5
5
  def self.run(params)
6
+ FastlaneCore::PrintTable.print_values(config: params, title: "Summary for Update Project Codesigning")
6
7
  path = params[:path]
7
8
  path = File.join(File.expand_path(path), "project.pbxproj")
8
9
 
@@ -35,7 +36,6 @@ module Fastlane
35
36
  end
36
37
 
37
38
  # for each configuration set a signing identity
38
-
39
39
  project.build_configurations.each do |config|
40
40
  config.build_settings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = config.name == "Release" ? 'iPhone Distribution' : "iPhone Development"
41
41
  end
@@ -45,12 +45,37 @@ module Fastlane
45
45
  end
46
46
  end
47
47
 
48
+ target_dictionary = project.targets.map { |f| { name: f.name, uuid: f.uuid } }
49
+ changed_targets = []
48
50
  project.root_object.attributes["TargetAttributes"].each do |target, sett|
51
+ found_target = target_dictionary.detect { |h| h[:uuid] == target }
52
+ if params[:targets]
53
+ # get target name
54
+ unless params[:targets].include?(found_target[:name])
55
+ UI.important("Skipping #{found_target[:name]} not selected (#{params[:targets].join(',')})")
56
+ next
57
+ end
58
+ end
59
+
49
60
  sett["ProvisioningStyle"] = params[:use_automatic_signing] ? 'Automatic' : 'Manual'
50
61
  sett["DevelopmentTeam"] = params[:team_id] if params[:team_id]
62
+ changed_targets << found_target[:name]
51
63
  end
52
64
  project.save
53
- UI.success("Successfully updated project settings to use ProvisioningStyle '#{params[:use_automatic_signing] ? 'Automatic' : 'Manual'}'")
65
+
66
+ if changed_targets.length == 0
67
+ UI.important("None of the specified targets has been modified")
68
+ UI.important("available targets:")
69
+ target_dictionary.each do |tar|
70
+ UI.important("\t* #{tar[:name]}")
71
+ end
72
+ else
73
+ UI.success("Successfully updated project settings to use ProvisioningStyle '#{params[:use_automatic_signing] ? 'Automatic' : 'Manual'}'")
74
+ UI.success("Modified Targets:")
75
+ changed_targets.each do |tar|
76
+ UI.success("\t * #{tar}")
77
+ end
78
+ end
54
79
  end
55
80
 
56
81
  def self.description
@@ -78,7 +103,13 @@ module Fastlane
78
103
  env_name: "FASTLANE_TEAM_ID",
79
104
  optional: true,
80
105
  description: "Team ID, is used when upgrading project",
81
- is_string: true)
106
+ is_string: true),
107
+ FastlaneCore::ConfigItem.new(key: :targets,
108
+ env_name: "FL_PROJECT_SIGNING_TARGETS",
109
+ optional: true,
110
+ type: Array,
111
+ description: "Specify targets you want to toggle the signing mech. (default to all targets)",
112
+ is_string: false)
82
113
  ]
83
114
  end
84
115
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module UpdateProjectCodesigning
3
- VERSION = "0.1.7"
3
+ VERSION = "0.1.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-update_project_codesigning
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Helmut Januschka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-21 00:00:00.000000000 Z
11
+ date: 2017-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xcodeproj
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  requirements: []
142
142
  rubyforge_project:
143
- rubygems_version: 2.4.8
143
+ rubygems_version: 2.6.8
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: Updates the Xcode 8 Automatic Codesigning Flag