fastlane-plugin-upgrade_super_old_xcode_project 0.0.2
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 +7 -0
- data/LICENSE +21 -0
- data/README.md +50 -0
- data/lib/fastlane/plugin/upgrade_super_old_xcode_project/actions/upgrade_super_old_xcode_project_action.rb +110 -0
- data/lib/fastlane/plugin/upgrade_super_old_xcode_project/helper/upgrade_super_old_xcode_project_helper.rb +12 -0
- data/lib/fastlane/plugin/upgrade_super_old_xcode_project/version.rb +5 -0
- data/lib/fastlane/plugin/upgrade_super_old_xcode_project.rb +16 -0
- metadata +147 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0531ac70ce8de7f90e4cf862a039db5891b33fc8
|
4
|
+
data.tar.gz: 200b7ea6ba60b826fcf7316156a8e74742dbf428
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ea5482fec34a3d0f7f9b3a961263fdd5c8466aa4a68bdb420722cb3fb8df255d6cc2b74d6541ba5cc9e426297d4d31c9346b740331cefa441cfd9238009d5b72
|
7
|
+
data.tar.gz: ae5488ab53dd4becf68e0d155a251f08af6a92622a0dee7d550a77b283abf263a8ba055d94e53fd4b756fa0fc4831cd9fa491fc6d9304bec895fa3542d8c4e96
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Jan Piotrowski <piotrowski+github@gmail.com>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# upgrade_super_old_xcode_project plugin
|
2
|
+
|
3
|
+
[](https://rubygems.org/gems/fastlane-plugin-ionic) [](https://github.com/ionic-zone/fastlane-plugin-upgrade_super_old_xcode_project/blob/master/LICENSE)
|
4
|
+
[](http://rubygems.org/gems/fastlane-plugin-upgrade_super_old_xcode_project)
|
5
|
+
|
6
|
+
This _fastlane_ plugin can upgrade super old Xcode project files to a format current tooling can work with (pre Xcode 8 to Xcode 8), by adding the missing attributes to the project config.
|
7
|
+
|
8
|
+
It is 99% based on previous code that was part of [fastlane-plugin-update_project_codesigning (depreacted!)](https://github.com/hjanuschka/fastlane-plugin-update_project_codesigning) (which got merged into the core action [automatic_code_signing.rb](https://github.com/fastlane/fastlane/blob/master/fastlane/lib/fastlane/actions/automatic_code_signing.rb) - when the relevant code unfortunately got removed).
|
9
|
+
|
10
|
+
|
11
|
+
## Getting Started
|
12
|
+
|
13
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-upgrade_super_old_xcode_project`, add it to your project by running:
|
14
|
+
|
15
|
+
```bash
|
16
|
+
fastlane add_plugin upgrade_super_old_xcode_project
|
17
|
+
```
|
18
|
+
|
19
|
+
## Example
|
20
|
+
|
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
|
+
|
23
|
+
## Run tests for this plugin
|
24
|
+
|
25
|
+
To run both the tests, and code style validation, run
|
26
|
+
|
27
|
+
```
|
28
|
+
rake
|
29
|
+
```
|
30
|
+
|
31
|
+
To automatically fix many of the styling issues, use
|
32
|
+
```
|
33
|
+
rubocop -a
|
34
|
+
```
|
35
|
+
|
36
|
+
## Issues and Feedback
|
37
|
+
|
38
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
39
|
+
|
40
|
+
## Troubleshooting
|
41
|
+
|
42
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
43
|
+
|
44
|
+
## Using _fastlane_ Plugins
|
45
|
+
|
46
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
47
|
+
|
48
|
+
## About _fastlane_
|
49
|
+
|
50
|
+
_fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,110 @@
|
|
1
|
+
require 'xcodeproj'
|
2
|
+
module Fastlane
|
3
|
+
module Actions
|
4
|
+
class UpgradeSuperOldXcodeProjectAction < Action
|
5
|
+
def self.run(params)
|
6
|
+
# print params
|
7
|
+
FastlaneCore::PrintTable.print_values(config: params, title: "Summary for UpgradeSuperOldXcodeProjectAction")
|
8
|
+
|
9
|
+
# create project.pbxproj path and check if file exists
|
10
|
+
path = params[:path]
|
11
|
+
path = File.join(File.expand_path(path), "project.pbxproj")
|
12
|
+
UI.user_error!("Could not find path to project config '#{path}'. Pass the path to your project (not workspace)!") unless File.exist?(path)
|
13
|
+
|
14
|
+
# start message
|
15
|
+
UI.message("Upgrading Xcode project if necessary")
|
16
|
+
|
17
|
+
# open project
|
18
|
+
project = Xcodeproj::Project.open(params[:path])
|
19
|
+
|
20
|
+
# upgrade super old xcode project
|
21
|
+
# if there is no TargetAttributes
|
22
|
+
if project.root_object.attributes["TargetAttributes"]
|
23
|
+
UI.important("No Xcode project upgrade necessary")
|
24
|
+
else
|
25
|
+
UI.error("Xcode project seems to be a very old project file format")
|
26
|
+
UI.important("Upgrading project to use Xcode8 signing")
|
27
|
+
|
28
|
+
# exit if no team_id param
|
29
|
+
# TODO In my previous adaption of this code I completely removed this. Here as well?
|
30
|
+
unless params[:team_id]
|
31
|
+
UI.important("TEAM id is not set")
|
32
|
+
UI.error!("Provide :team_id")
|
33
|
+
end
|
34
|
+
|
35
|
+
# Add TargetAttributes to project attributes
|
36
|
+
# for each target an entry with team id and signing mode
|
37
|
+
target_attr_hash = {}
|
38
|
+
project.root_object.targets.each do |target|
|
39
|
+
new_hash = {}
|
40
|
+
new_hash["CreatedOnToolsVersion"] = "8.0"
|
41
|
+
new_hash["DevelopmentTeam"] = params[:team_id]
|
42
|
+
new_hash["ProvisioningStyle"] = params[:use_automatic_signing] ? 'Automatic' : 'Manual'
|
43
|
+
# TODO: Above: Do we need this as param? Fixed? To what of the two values?
|
44
|
+
# In my previous adaption of this code I chose "Manual" - unfortunately didn't document why :/
|
45
|
+
target_attr_hash[target.uuid] = new_hash
|
46
|
+
end
|
47
|
+
project.root_object.attributes["TargetAttributes"] = target_attr_hash
|
48
|
+
|
49
|
+
# for each configuration set a signing identity
|
50
|
+
# TODO what does this actually do? Do we need it?
|
51
|
+
# TODO Does this directly change the `project`? (reference vs. value)
|
52
|
+
project.build_configurations.each do |config|
|
53
|
+
config.build_settings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = config.name == "Release" ? 'iPhone Distribution' : "iPhone Development"
|
54
|
+
end
|
55
|
+
|
56
|
+
# set upgrade marker to xcode8
|
57
|
+
project.root_object.attributes["LastUpgradeCheck"] = "0800"
|
58
|
+
|
59
|
+
# save project
|
60
|
+
project.save
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
#####################################################
|
65
|
+
# @!group Documentation
|
66
|
+
#####################################################
|
67
|
+
|
68
|
+
def self.description
|
69
|
+
"Upgrades super old Xcode projects to Xcode 8"
|
70
|
+
end
|
71
|
+
|
72
|
+
def self.authors
|
73
|
+
["Jan Piotrowski", "mathiasAichinger", "hjanuschka"]
|
74
|
+
end
|
75
|
+
|
76
|
+
def self.return_value
|
77
|
+
# If your method provides a return value, you can describe here what it does
|
78
|
+
end
|
79
|
+
|
80
|
+
def self.details
|
81
|
+
"This plugin can upgrade super old Xcode (pre Xcode 8) projects to Xcode 8 format by adding the missing attributes to the project config and thereby enables using the `automatic_code_signing` actions on it."
|
82
|
+
end
|
83
|
+
|
84
|
+
def self.available_options
|
85
|
+
[
|
86
|
+
FastlaneCore::ConfigItem.new(key: :path,
|
87
|
+
env_name: "FL_PROJECT_SIGNING_PROJECT_PATH",
|
88
|
+
description: "Path to your Xcode project",
|
89
|
+
verify_block: proc do |value|
|
90
|
+
UI.user_error!("Path is invalid") unless File.exist?(File.expand_path(value))
|
91
|
+
end),
|
92
|
+
FastlaneCore::ConfigItem.new(key: :team_id,
|
93
|
+
env_name: "FASTLANE_TEAM_ID",
|
94
|
+
optional: false,
|
95
|
+
description: "Team ID, is used when upgrading project",
|
96
|
+
is_string: true),
|
97
|
+
FastlaneCore::ConfigItem.new(key: :use_automatic_signing,
|
98
|
+
env_name: "FL_PROJECT_USE_AUTOMATIC_SIGNING",
|
99
|
+
description: "Defines if project should use automatic signing",
|
100
|
+
is_string: false,
|
101
|
+
default_value: false)
|
102
|
+
]
|
103
|
+
end
|
104
|
+
|
105
|
+
def self.is_supported?(platform)
|
106
|
+
[:ios, :mac].include?(platform)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Helper
|
3
|
+
class UpgradeSuperOldXcodeProjectHelper
|
4
|
+
# class methods that you define here become available in your action
|
5
|
+
# as `Helper::UpgradeSuperOldXcodeProjectHelper.your_method`
|
6
|
+
#
|
7
|
+
def self.show_message
|
8
|
+
UI.message("Hello from the upgrade_super_old_xcode_project plugin helper!")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/upgrade_super_old_xcode_project/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module UpgradeSuperOldXcodeProject
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::UpgradeSuperOldXcodeProject.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,147 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-upgrade_super_old_xcode_project
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jan Piotrowski
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-10-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pry
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
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: fastlane
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 2.61.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 2.61.0
|
111
|
+
description:
|
112
|
+
email: piotrowski+github@gmail.com
|
113
|
+
executables: []
|
114
|
+
extensions: []
|
115
|
+
extra_rdoc_files: []
|
116
|
+
files:
|
117
|
+
- LICENSE
|
118
|
+
- README.md
|
119
|
+
- lib/fastlane/plugin/upgrade_super_old_xcode_project.rb
|
120
|
+
- lib/fastlane/plugin/upgrade_super_old_xcode_project/actions/upgrade_super_old_xcode_project_action.rb
|
121
|
+
- lib/fastlane/plugin/upgrade_super_old_xcode_project/helper/upgrade_super_old_xcode_project_helper.rb
|
122
|
+
- lib/fastlane/plugin/upgrade_super_old_xcode_project/version.rb
|
123
|
+
homepage: https://github.com/ionic-zone/fastlane-plugin-upgrade_super_old_xcode_project
|
124
|
+
licenses:
|
125
|
+
- MIT
|
126
|
+
metadata: {}
|
127
|
+
post_install_message:
|
128
|
+
rdoc_options: []
|
129
|
+
require_paths:
|
130
|
+
- lib
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0'
|
136
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
requirements: []
|
142
|
+
rubyforge_project:
|
143
|
+
rubygems_version: 2.6.13
|
144
|
+
signing_key:
|
145
|
+
specification_version: 4
|
146
|
+
summary: Upgrades super old Xcode projects to Xcode 8
|
147
|
+
test_files: []
|