Skip to content

Commit 05bce25

Browse files
authored
Merge pull request #34 from surfstudio/fastlane_generating
Fastlane stuff generating
2 parents 24cfc41 + 93be7df commit 05bce25

File tree

7 files changed

+272
-7
lines changed

7 files changed

+272
-7
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Xcode 8 or later.
2222

2323
## Installation
2424
To install or update the templates you need:
25-
* Quit Xcode
26-
* On the command line:
25+
1. Quit Xcode
26+
2. On the command line:
2727
```
2828
cd ~/Downloads
2929
git clone https://github.com/surfstudio/Xcode-Project-Templates
@@ -42,8 +42,9 @@ After that:
4242

4343
## After creating a project
4444
### Fix folders links
45-
* Open up the Terminal and `cd` into your project folder
46-
* Call in Terminal `make init` and after that call `make synx`
45+
1. Open up the Terminal and `cd` into your project folder
46+
2. Call in Terminal `make init`
47+
3. Call `make synx`
4748
### Remove unnecessary files
48-
* Open up the .xcodeproj file
49-
* Remove the Non-iOS Resources folder from the Xcode project by selecting that folder in the sidebar, right clicking, then selecting delete from the menu, then selecting "Remove References" in the dialog that pops up
49+
1. Open up the .xcodeproj file
50+
2. Remove the Non-iOS Resources folder from the Xcode project by selecting that folder in the sidebar, right clicking, then selecting delete from the menu, then selecting "Remove References" in the dialog that pops up

Surf Base Application.xctemplate/TemplateInfo.plist

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@
277277
</array>
278278
<key>Nodes</key>
279279
<array>
280+
<string>../fastlane</string>
280281
<string>../Podfile</string>
281282
<string>../.gitignore</string>
282283
<string>Third Party/.gitkeep</string>
@@ -300,6 +301,15 @@
300301
</array>
301302
<key>Definitions</key>
302303
<dict>
304+
<key>../fastlane</key>
305+
<dict>
306+
<key>Path</key>
307+
<string>fastlane</string>
308+
<key>Group</key>
309+
<array>
310+
<string>Non-iOS Resources</string>
311+
</array>
312+
</dict>
303313
<key>../Podfile</key>
304314
<dict>
305315
<key>TargetIndices</key>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# app_identifier "[[APP_IDENTIFIER]]" # The bundle identifier of your app
2+
apple_id "PUT HERE EMAIL" # Your Apple email address
3+
4+
team_id "PUT HERE TEAM ID" # Developer Portal Team ID
5+
6+
# For more information about the Appfile, see:
7+
# https://docs.fastlane.tools/advanced/#appfile
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
# Customise this file, documentation can be found here:
2+
# https://docs.fastlane.tools/actions/
3+
# All available actions: https://docs.fastlane.tools/actions
4+
# can also be listed using the `fastlane actions` command
5+
6+
# Change the syntax highlighting to Ruby
7+
# All lines starting with a # are ignored when running `fastlane`
8+
9+
# If you want to automatically update fastlane if a new version is available:
10+
# update_fastlane
11+
12+
# This is the minimum version number required.
13+
# Update this, if you use features of a newer version
14+
fastlane_version "2.58.0"
15+
16+
default_platform :ios
17+
18+
platform :ios do
19+
20+
workspace_file = '___PACKAGENAME___.xcworkspace'
21+
project_file = '___PACKAGENAME___.xcodeproj'
22+
main_scheme = '___PACKAGENAME___'
23+
bundle_name = "___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.___VARIABLE_productName:RFC1034Identifier___"
24+
25+
before_all do |lane, options|
26+
# ensure_git_status_clean
27+
end
28+
29+
lane :build do |options|
30+
sigh(
31+
development: true,
32+
app_identifier: bundle_name
33+
)
34+
35+
xcodebuild(
36+
workspace: workspace_file,
37+
scheme: main_scheme,
38+
configuration: "Debug",
39+
clean: options[:clean],
40+
build: true,
41+
destination: "generic/platform=iOS\" CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=\""
42+
)
43+
end
44+
45+
lane :prepare_for_integration do |options|
46+
47+
version_number = options[:version_number]
48+
if version_number.nil?
49+
throw "Required version_number parameter"
50+
end
51+
52+
build_number = options[:type_v]
53+
if not build_number.nil?
54+
increment_build_number(build_number: build_number)
55+
else
56+
increment_build_number()
57+
end
58+
59+
increment_version_number(version_number: options[:version_number])
60+
61+
commit_version_bump(
62+
xcodeproj: project_file,
63+
force: true
64+
)
65+
66+
tag_label = get_version_number
67+
68+
type = options[:type]
69+
typeIndex = options[:type_v]
70+
if not type.nil?
71+
tag_label = "dev_" + tag_label + "-" + type + "" + typeIndex
72+
end
73+
74+
add_git_tag(
75+
tag: tag_label
76+
)
77+
78+
# sh("git push && git push origin --tags")
79+
end
80+
81+
desc "Set build number and push version bump commit to develop branch with tag"
82+
lane :prepare_for_beta do |options|
83+
84+
current_version = get_version_number
85+
type = options[:type]
86+
tag_prefix = 'dev_' + current_version + "-" + type
87+
88+
last_tag = git_tags
89+
.select{ |tag| tag.index(tag_prefix) == 0}
90+
.first
91+
92+
if last_tag.nil?
93+
last_tag_index = 0
94+
else
95+
last_tag_index = (last_tag.sub! tag_prefix, "").to_i
96+
end
97+
98+
result_tag_index = last_tag_index + 1
99+
build_number = tag_prefix + result_tag_index.to_s
100+
101+
prepare_for_integration(
102+
version_number: current_version,
103+
type: options[:type],
104+
type_v: result_tag_index.to_s,
105+
build_number: build_number
106+
)
107+
end
108+
109+
desc "Set version and build numbers and push version bump commit to master branch with tag"
110+
lane :prepare_for_release do |options|
111+
release_build_number = app_store_build_number.to_i + 1
112+
prepare_for_integration(version_number: options[:version_number], build_number: release_build_number)
113+
end
114+
115+
desc "Submit a new Beta Build to Fabric"
116+
lane :beta do
117+
118+
cocoapods(use_bundle_exec:true)
119+
120+
sigh(
121+
development: true,
122+
app_identifier: bundle_name
123+
)
124+
125+
gym(
126+
scheme: main_scheme,
127+
configuration: "Debug",
128+
clean: true,
129+
include_bitcode: false,
130+
export_options: { compileBitcode: false},
131+
export_method: "development"
132+
)
133+
134+
upload_to_fabric
135+
136+
sh("rm ../*.mobileprovision")
137+
end
138+
139+
# Need check
140+
desc "Submit a new Release Build to Fabric"
141+
lane :release do
142+
#cocoapods(use_bundle_exec: false)
143+
144+
cert(development: false)
145+
146+
sigh(
147+
development: true,
148+
app_identifier: bundle_name
149+
)
150+
151+
gym(
152+
scheme: main_scheme,
153+
configuration: "Release",
154+
clean: true,
155+
include_bitcode: false,
156+
export_options: { compileBitcode: false},
157+
export_method: "app-store"
158+
)
159+
160+
upload_to_fabric
161+
162+
sh("rm ../*.mobileprovision")
163+
end
164+
165+
lane :upload_to_fabric do
166+
167+
# Load in Fabric
168+
crashlytics(
169+
api_token: "PUT TOKEN HERE",
170+
build_secret: "PUT BUILD SECRET HERE",
171+
emails: ["PUT_EMAILS_HERE"],
172+
notes: ENV[main_scheme + "_iOS_Crashlytics_Changelog"]
173+
)
174+
end
175+
176+
end
177+
178+
179+
# More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
180+
# All available actions: https://docs.fastlane.tools/actions
181+
182+
# fastlane reports which actions are used. No personal data is recorded.
183+
# Learn more at https://github.com/fastlane/fastlane#metrics
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Autogenerated by fastlane
2+
#
3+
# Ensure this file is checked in to source control!
4+
5+
gem 'fastlane-plugin-git_tags'
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
fastlane documentation
2+
================
3+
# Installation
4+
5+
Make sure you have the latest version of the Xcode command line tools installed:
6+
7+
```
8+
xcode-select --install
9+
```
10+
11+
Install _fastlane_ using
12+
```
13+
[sudo] gem install fastlane -NV
14+
```
15+
or alternatively using `brew cask install fastlane`
16+
17+
# Available Actions
18+
## iOS
19+
### ios build
20+
```
21+
fastlane ios build
22+
```
23+
24+
### ios prepare_for_integration
25+
```
26+
fastlane ios prepare_for_integration
27+
```
28+
29+
### ios prepare_for_beta
30+
```
31+
fastlane ios prepare_for_beta
32+
```
33+
Set build number and push version bump commit to develop branch with tag
34+
### ios prepare_for_release
35+
```
36+
fastlane ios prepare_for_release
37+
```
38+
Set version and build numbers and push version bump commit to master branch with tag
39+
### ios beta
40+
```
41+
fastlane ios beta
42+
```
43+
Submit a new Beta Build to Fabric
44+
### ios release
45+
```
46+
fastlane ios release
47+
```
48+
Submit a new Release Build to Fabric
49+
### ios upload_to_fabric
50+
```
51+
fastlane ios upload_to_fabric
52+
```
53+
54+
55+
----
56+
57+
This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
58+
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
59+
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

Surf MVP Application.xctemplate/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ build:
2121
bundle exec fastlane build clean:true
2222

2323
synx:
24-
bundle exec synx --exclusion "Project/Non-iOS Resources" Project.xcodeproj
24+
bundle exec synx --exclusion "___PACKAGENAME___/Non-iOS Resources" ___PACKAGENAME___.xcodeproj
2525

2626
lint:
2727
./Pods/SwiftLint/swiftlint lint --config .swiftlint.yml

0 commit comments

Comments
 (0)