Skip to content

Commit 238ff51

Browse files
committed
Merge branch 'master' into feature/localization-fixed
2 parents f61d1fb + cfbce24 commit 238ff51

File tree

8 files changed

+138
-80
lines changed

8 files changed

+138
-80
lines changed

Podfile.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ EXTERNAL SOURCES:
1111
SPEC CHECKSUMS:
1212
R.swift.Library: e5e077ed04f6867a95676af491650091b23518e9
1313

14-
COCOAPODS: 0.39.0
14+
PODFILE CHECKSUM: 9b36d458fc7d86e4195dd7d7a184ba971f24e516
15+
16+
COCOAPODS: 1.0.0

R.swift.xcodeproj/project.pbxproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
D56F923F1C2942B400177FF7 /* Struct+ChildValidation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D56F923E1C2942B400177FF7 /* Struct+ChildValidation.swift */; };
1919
D56F92401C29475F00177FF7 /* Struct+ChildValidation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D56F923E1C2942B400177FF7 /* Struct+ChildValidation.swift */; };
2020
D56F92411C29476700177FF7 /* TypeVar.swift in Sources */ = {isa = PBXBuildFile; fileRef = D56F923C1C29421600177FF7 /* TypeVar.swift */; };
21+
D578CAD61CE064E900C50B7E /* version.swift in Sources */ = {isa = PBXBuildFile; fileRef = D578CAD51CE064E900C50B7E /* version.swift */; };
22+
D578CAD71CE06AB000C50B7E /* version.swift in Sources */ = {isa = PBXBuildFile; fileRef = D578CAD51CE064E900C50B7E /* version.swift */; };
2123
D579466B1B9347C20044D2FC /* XCProjectFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = D579466A1B9347C20044D2FC /* XCProjectFile.swift */; };
2224
D58672491C21FC9700A760EC /* TypeSequenceProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = D58672481C21FC9700A760EC /* TypeSequenceProvider.swift */; };
2325
D586724A1C21FF7D00A760EC /* TypeSequenceProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = D58672481C21FC9700A760EC /* TypeSequenceProvider.swift */; };
@@ -116,6 +118,7 @@
116118
D56DC76C1C41758800623437 /* AccessModifier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccessModifier.swift; sourceTree = "<group>"; };
117119
D56F923C1C29421600177FF7 /* TypeVar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TypeVar.swift; sourceTree = "<group>"; };
118120
D56F923E1C2942B400177FF7 /* Struct+ChildValidation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Struct+ChildValidation.swift"; sourceTree = "<group>"; };
121+
D578CAD51CE064E900C50B7E /* version.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = version.swift; sourceTree = "<group>"; };
119122
D579466A1B9347C20044D2FC /* XCProjectFile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XCProjectFile.swift; sourceTree = "<group>"; };
120123
D58672481C21FC9700A760EC /* TypeSequenceProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TypeSequenceProvider.swift; sourceTree = "<group>"; };
121124
D59F72251C1963DA0089767C /* Type.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Type.swift; sourceTree = "<group>"; };
@@ -172,6 +175,13 @@
172175
);
173176
runOnlyForDeploymentPostprocessing = 0;
174177
};
178+
F1F5322A6D46CBD2B0ABA60D /* Frameworks */ = {
179+
isa = PBXFrameworksBuildPhase;
180+
buildActionMask = 2147483647;
181+
files = (
182+
);
183+
runOnlyForDeploymentPostprocessing = 0;
184+
};
175185
/* End PBXFrameworksBuildPhase section */
176186

177187
/* Begin PBXGroup section */
@@ -275,6 +285,7 @@
275285
D5F97E361C1789E50066D7C0 /* ResourceTypes */,
276286
D5F97E501C18D5EF0066D7C0 /* SwiftTypes */,
277287
D5B7997B1C1B06F5009EA901 /* Util */,
288+
D578CAD51CE064E900C50B7E /* version.swift */,
278289
);
279290
path = R.swift;
280291
sourceTree = "<group>";
@@ -345,6 +356,7 @@
345356
buildPhases = (
346357
D5EA0DF01A3DF45600FFEBC4 /* Sources */,
347358
D5DE480C1B5E1B14000F6A85 /* Install into test project */,
359+
F1F5322A6D46CBD2B0ABA60D /* Frameworks */,
348360
);
349361
buildRules = (
350362
);
@@ -459,6 +471,7 @@
459471
D59F72311C19644F0089767C /* Function.swift in Sources */,
460472
E241E4A11CD6545200F449E3 /* Unifiable.swift in Sources */,
461473
D5B799721C199755009EA901 /* ImageGenerator.swift in Sources */,
474+
D578CAD71CE06AB000C50B7E /* version.swift in Sources */,
462475
D5B7997A1C19C1BD009EA901 /* WhiteListedExtensionsResourceType.swift in Sources */,
463476
D59F722A1C1963EA0089767C /* Struct.swift in Sources */,
464477
E2156B8F1CC5255000F341DC /* StringParam.swift in Sources */,
@@ -493,6 +506,7 @@
493506
D5B129B11C3BA65C00A1C5FC /* Property.swift in Sources */,
494507
E22D43651C95845200692FFF /* ColorPalette.swift in Sources */,
495508
D5F97E421C1816360066D7C0 /* Image.swift in Sources */,
509+
D578CAD61CE064E900C50B7E /* version.swift in Sources */,
496510
D56F923D1C29421600177FF7 /* TypeVar.swift in Sources */,
497511
D5B7996E1C19940F009EA901 /* ResourceFileGenerator.swift in Sources */,
498512
E2762ACF1CCD0B970009BCAA /* LocalizableStrings.swift in Sources */,

R.swift/input.swift

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,39 @@ enum InputParsingError: ErrorType {
1313
case IllegalOption(error: String, helpString: String)
1414
case MissingOption(error: String, helpString: String)
1515
case UserAskedForHelp(helpString: String)
16+
case UserRequestsVersionInformation(helpString: String)
17+
18+
var helpString: String {
19+
switch self {
20+
case let .IllegalOption(_, helpString):
21+
return helpString
22+
case let .MissingOption(_, helpString):
23+
return helpString
24+
case let .UserAskedForHelp(helpString):
25+
return helpString
26+
case let .UserRequestsVersionInformation(helpString):
27+
return helpString
28+
}
29+
}
30+
31+
var errorDescription: String? {
32+
switch self {
33+
case let .IllegalOption(error, _):
34+
return error
35+
case let .MissingOption(error, _):
36+
return error
37+
case .UserAskedForHelp, .UserRequestsVersionInformation:
38+
return nil
39+
}
40+
}
1641
}
1742

43+
private let versionOption = Option(
44+
trigger: .Long( "version"),
45+
numberOfParameters: 0,
46+
helpDescription: "Prints version information about this release."
47+
)
48+
1849
private let xcodeprojOption = Option(
1950
trigger: .Mixed("p", "xcodeproj"),
2051
numberOfParameters: 1,
@@ -57,6 +88,7 @@ private let sdkRootOption = Option(
5788
)
5889

5990
private let AllOptions = [
91+
versionOption,
6092
xcodeprojOption,
6193
targetOption,
6294
bundleIdentifierOption,
@@ -96,6 +128,10 @@ struct CallInformation {
96128
throw InputParsingError.UserAskedForHelp(helpString: optionParser.helpStringForCommandName(commandName))
97129
}
98130

131+
if options[versionOption] != nil {
132+
throw InputParsingError.UserRequestsVersionInformation(helpString: "\(commandName) (R.swift) \(version)")
133+
}
134+
99135
guard let outputPath = extraArguments.first where extraArguments.count == 1 else {
100136
throw InputParsingError.IllegalOption(
101137
error: "Output folder for the 'R.generated.swift' file is mandatory as last argument.",

R.swift/main.swift

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,27 @@ do {
5656
}
5757
}
5858

59-
} catch let InputParsingError.UserAskedForHelp(helpString: helpString) {
60-
print(helpString)
61-
exit(0)
62-
} catch let InputParsingError.IllegalOption(error: error, helpString: helpString) {
63-
fail(error)
64-
print(helpString)
65-
exit(2)
66-
} catch let InputParsingError.MissingOption(error: error, helpString: helpString) {
67-
fail(error)
68-
print(helpString)
69-
exit(2)
70-
} catch let ResourceParsingError.ParsingFailed(description) {
71-
fail(description)
59+
} catch let error as InputParsingError {
60+
if let errorDescription = error.errorDescription {
61+
fail(errorDescription)
62+
}
63+
64+
print(error.helpString)
65+
66+
switch error {
67+
case .IllegalOption, .MissingOption:
68+
exit(2)
69+
case .UserAskedForHelp, .UserRequestsVersionInformation:
70+
exit(0)
71+
}
72+
} catch let error as ResourceParsingError {
73+
switch error {
74+
case let .ParsingFailed(description):
75+
fail(description)
76+
case let .UnsupportedExtension(givenExtension, supportedExtensions):
77+
let joinedSupportedExtensions = supportedExtensions.joinWithSeparator(", ")
78+
fail("File extension '\(givenExtension)' is not one of the supported extensions: \(joinedSupportedExtensions)")
79+
}
80+
7281
exit(3)
7382
}

R.swift/version.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//
2+
// version.swift
3+
// R.swift
4+
//
5+
// Created by Mathijs Kadijk on 09-05-16.
6+
// Copyright © 2016 Mathijs Kadijk. All rights reserved.
7+
//
8+
9+
import Foundation
10+
11+
let version = "nightly build"

ResourceApp/ResourceApp.xcodeproj/project.pbxproj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -448,13 +448,13 @@
448448
isa = PBXNativeTarget;
449449
buildConfigurationList = D55C6CD91B5D757300301B0D /* Build configuration list for PBXNativeTarget "ResourceApp" */;
450450
buildPhases = (
451-
978E4B8123C372F370555011 /* Check Pods Manifest.lock */,
451+
978E4B8123C372F370555011 /* 📦 Check Pods Manifest.lock */,
452452
D55C6CED1B5E172900301B0D /* R.swift */,
453453
D55C6CB41B5D757300301B0D /* Sources */,
454454
D55C6CB51B5D757300301B0D /* Frameworks */,
455455
D55C6CB61B5D757300301B0D /* Resources */,
456-
89BF8D4EC08D38DB6564C369 /* Embed Pods Frameworks */,
457-
ADB91CF666C6624CD5A00F13 /* Copy Pods Resources */,
456+
89BF8D4EC08D38DB6564C369 /* 📦 Embed Pods Frameworks */,
457+
ADB91CF666C6624CD5A00F13 /* 📦 Copy Pods Resources */,
458458
);
459459
buildRules = (
460460
);
@@ -655,44 +655,44 @@
655655
/* End PBXResourcesBuildPhase section */
656656

657657
/* Begin PBXShellScriptBuildPhase section */
658-
89BF8D4EC08D38DB6564C369 /* Embed Pods Frameworks */ = {
658+
89BF8D4EC08D38DB6564C369 /* 📦 Embed Pods Frameworks */ = {
659659
isa = PBXShellScriptBuildPhase;
660660
buildActionMask = 2147483647;
661661
files = (
662662
);
663663
inputPaths = (
664664
);
665-
name = "Embed Pods Frameworks";
665+
name = "📦 Embed Pods Frameworks";
666666
outputPaths = (
667667
);
668668
runOnlyForDeploymentPostprocessing = 0;
669669
shellPath = /bin/sh;
670670
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-ResourceApp/Pods-ResourceApp-frameworks.sh\"\n";
671671
showEnvVarsInLog = 0;
672672
};
673-
978E4B8123C372F370555011 /* Check Pods Manifest.lock */ = {
673+
978E4B8123C372F370555011 /* 📦 Check Pods Manifest.lock */ = {
674674
isa = PBXShellScriptBuildPhase;
675675
buildActionMask = 2147483647;
676676
files = (
677677
);
678678
inputPaths = (
679679
);
680-
name = "Check Pods Manifest.lock";
680+
name = "📦 Check Pods Manifest.lock";
681681
outputPaths = (
682682
);
683683
runOnlyForDeploymentPostprocessing = 0;
684684
shellPath = /bin/sh;
685685
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
686686
showEnvVarsInLog = 0;
687687
};
688-
ADB91CF666C6624CD5A00F13 /* Copy Pods Resources */ = {
688+
ADB91CF666C6624CD5A00F13 /* 📦 Copy Pods Resources */ = {
689689
isa = PBXShellScriptBuildPhase;
690690
buildActionMask = 2147483647;
691691
files = (
692692
);
693693
inputPaths = (
694694
);
695-
name = "Copy Pods Resources";
695+
name = "📦 Copy Pods Resources";
696696
outputPaths = (
697697
);
698698
runOnlyForDeploymentPostprocessing = 0;

fastlane/Fastfile

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,42 @@ lane :release do |options|
1616
raise "Aborted by user".red
1717
end
1818

19+
currentVersion = version_get_podspec()
20+
Helper.log.info "Current R.swift podspec version is #{currentVersion}"
21+
22+
isPrerelease = false
23+
if options[:skip_version_bump] != true
24+
bumpType = prompt(text: "What kind of release is this? (major/minor/patch/custom)".green, boolean: false, ci_input: "")
25+
case bumpType
26+
when "major", "minor", "patch"
27+
version_bump_podspec(bump_type: bumpType)
28+
when "custom"
29+
newVersion = prompt(text: "What is the new custom version number?".green, boolean: false, ci_input: "")
30+
version_bump_podspec(version_number: newVersion)
31+
32+
isPrerelease = prompt(text: "Is this a prerelease version?".green, boolean: true, ci_input: "")
33+
else
34+
raise "Invalid release type: #{bumpType}".red
35+
end
36+
37+
newVersion = version_get_podspec()
38+
changelog = prompt(text: "Please provide release notes:".green, boolean: false, ci_input: "", multi_line_end_keyword: "FIN")
39+
af_insert_text_into_file(
40+
file_path: "Changelog.md",
41+
text: "## #{newVersion}\n\n#{changelog}\n\n",
42+
insert_at_bottom: false
43+
)
44+
else
45+
isPrerelease = prompt(text: "Is this a prerelease version?".green, boolean: true, ci_input: "")
46+
end
47+
48+
# Sync version.swift with version in podspec
49+
filepath = '../R.swift/version.swift'
50+
newVersion = version_get_podspec()
51+
52+
content = File.read(filepath).sub(/let version = "(.*)"/, "let version = \"#{newVersion}\"")
53+
File.open(filepath, 'wb') { |file| file.write(content) }
54+
1955
if options[:skip_tests] != true
2056
runalltests
2157
else
@@ -31,39 +67,6 @@ lane :release do |options|
3167
archive: true
3268
)
3369

34-
unless is_ci
35-
notification(
36-
title: "R.swift release",
37-
message: "💡 Needs your attention."
38-
)
39-
end
40-
41-
currentVersion = version_get_podspec()
42-
Helper.log.info "Current R.swift podspec version is #{currentVersion}"
43-
44-
bumpType = prompt(text: "What kind of release is this? (major/minor/patch/custom)".green, boolean: false, ci_input: "")
45-
isPrerelease = false
46-
case bumpType
47-
when "major", "minor", "patch"
48-
version_bump_podspec(bump_type: bumpType)
49-
when "custom"
50-
newVersion = prompt(text: "What is the new custom version number?".green, boolean: false, ci_input: "")
51-
version_bump_podspec(version_number: newVersion)
52-
53-
isPrerelease = prompt(text: "Is this a prerelease version?".green, boolean: true, ci_input: "")
54-
else
55-
raise "Invalid release type: #{bumpType}".red
56-
end
57-
58-
newVersion = version_get_podspec()
59-
changelog = prompt(text: "Please provide release notes:".green, boolean: false, ci_input: "", multi_line_end_keyword: "FIN")
60-
61-
af_insert_text_into_file(
62-
file_path: "Changelog.md",
63-
text: "## #{newVersion}\n\n#{changelog}\n\n",
64-
insert_at_bottom: false
65-
)
66-
6770
zipPath = "/tmp/rswift-#{newVersion}.zip"
6871
sh "rm -f #{zipPath}"
6972

@@ -72,6 +75,13 @@ lane :release do |options|
7275
output_path: zipPath
7376
)
7477

78+
unless is_ci
79+
notification(
80+
title: "R.swift release",
81+
message: "💡 Needs your attention."
82+
)
83+
end
84+
7585
unless prompt(text: "#{newVersion} has been build and prepped for release. If you have any additional changes you would like to make, please do those before continuing. Would you like to commit, tag, push and release #{newVersion} including all uncommitted changes?".green, boolean: true, ci_input:"y")
7686
raise "Aborted by user".red
7787
end

release.swift

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)