ambient-xcode 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,113 @@
1
+ module Ambient
2
+ class ProjectHelper
3
+ attr_reader :path
4
+
5
+ def initialize(path)
6
+ @path = path
7
+ projects = Dir.glob(path + '/*.xcodeproj')
8
+ @project = Xcodeproj::Project.open(projects.first)
9
+ end
10
+
11
+ def reset_project_to_defaults
12
+ @project.build_configurations.each do |configuration|
13
+ build_settings = configuration.build_settings
14
+ build_settings.each { |k, _| build_settings.delete(k) }
15
+ end
16
+ end
17
+
18
+ def reset_targets_to_defaults
19
+ @project.targets.each do |target|
20
+ @project.build_configurations.each do |configuration|
21
+ build_settings = target.build_configuration_list.build_settings(configuration.to_s)
22
+ build_settings.each { |k, _| build_settings.delete(k) }
23
+ end
24
+ end
25
+ end
26
+
27
+ def reset_capabilities_to_defaults
28
+ @project.targets.each do |target|
29
+ CapabilitiesHelper.new(@project, target).clear_capabilities
30
+ end
31
+ end
32
+
33
+ def process_project_options(options)
34
+ @project.build_configurations.each do |configuration|
35
+ options.each do |key, value|
36
+ configuration.build_settings[key] = value
37
+ configuration.build_settings.delete(key) if value == nil
38
+ end
39
+ end
40
+ end
41
+
42
+ def process_shared_target_options(shared_target_options)
43
+ @project.targets.each do |target|
44
+ options = shared_target_options[target.to_s]
45
+ if options
46
+ @project.build_configurations.each do |configuration|
47
+ target.build_configuration_list.build_settings(configuration.to_s).merge!(options)
48
+ end
49
+ end
50
+ end
51
+ end
52
+
53
+ def process_target_options(target_options)
54
+ @project.targets.each do |target|
55
+ options = target_options[target.to_s]
56
+ if options
57
+ @project.build_configurations.each do |configuration|
58
+ scheme_options = options[configuration.to_s]
59
+ if scheme_options
60
+ target.build_configuration_list.build_settings(configuration.to_s).merge!(scheme_options)
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+
67
+ def process_capabilities(capabilities_hash)
68
+ capabilities_hash.each do |target_name, capabilities|
69
+ @project.targets.each do |target|
70
+ if target_name == target.to_s
71
+ helper = CapabilitiesHelper.new(@project, target)
72
+ capabilities.each { |c| helper.enable_capability(c) }
73
+ end
74
+ end
75
+ end
76
+ end
77
+
78
+ def process_scheme_options(options)
79
+ @project.build_configurations.each do |configuration|
80
+ scheme_options = options[configuration.to_s] || {}
81
+ scheme_options.each do |key, value|
82
+ configuration.build_settings[key] = value
83
+ configuration.build_settings.delete(key) if value == nil
84
+ end
85
+ end
86
+ end
87
+
88
+ def process_development_teams(development_teams)
89
+ development_teams.each do |target_name, development_team|
90
+ @project.targets.each do |target|
91
+ if target_name == target.to_s
92
+ helper = CapabilitiesHelper.new(@project, target)
93
+ helper.set_development_team(development_team)
94
+ end
95
+ end
96
+ end
97
+ end
98
+
99
+ def print_info
100
+ puts ""
101
+ puts "Targets:"
102
+ @project.targets.each { |t| puts "- #{t.to_s}" }
103
+ puts ""
104
+ puts "Build configurations:"
105
+ @project.build_configurations.each { |c| puts "- #{c.to_s}" }
106
+ puts ""
107
+ end
108
+
109
+ def save_changes
110
+ @project.save
111
+ end
112
+ end
113
+ end
@@ -0,0 +1,295 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 46;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+ 37A5F6781D906B01006D972F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37A5F6771D906B01006D972F /* AppDelegate.swift */; };
11
+ 37A5F67A1D906B01006D972F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37A5F6791D906B01006D972F /* ViewController.swift */; };
12
+ 37A5F67D1D906B01006D972F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 37A5F67B1D906B01006D972F /* Main.storyboard */; };
13
+ 37A5F67F1D906B01006D972F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 37A5F67E1D906B01006D972F /* Assets.xcassets */; };
14
+ 37A5F6821D906B01006D972F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 37A5F6801D906B01006D972F /* LaunchScreen.storyboard */; };
15
+ /* End PBXBuildFile section */
16
+
17
+ /* Begin PBXFileReference section */
18
+ 37A5F6741D906B01006D972F /* PRODUCTNAME.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PRODUCTNAME.app; sourceTree = BUILT_PRODUCTS_DIR; };
19
+ 37A5F6771D906B01006D972F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
20
+ 37A5F6791D906B01006D972F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
21
+ 37A5F67C1D906B01006D972F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
22
+ 37A5F67E1D906B01006D972F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
23
+ 37A5F6811D906B01006D972F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
24
+ 37A5F6831D906B01006D972F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
25
+ /* End PBXFileReference section */
26
+
27
+ /* Begin PBXFrameworksBuildPhase section */
28
+ 37A5F6711D906B01006D972F /* Frameworks */ = {
29
+ isa = PBXFrameworksBuildPhase;
30
+ buildActionMask = 2147483647;
31
+ files = (
32
+ );
33
+ runOnlyForDeploymentPostprocessing = 0;
34
+ };
35
+ /* End PBXFrameworksBuildPhase section */
36
+
37
+ /* Begin PBXGroup section */
38
+ 37A5F66B1D906B01006D972F = {
39
+ isa = PBXGroup;
40
+ children = (
41
+ 37A5F6761D906B01006D972F /* PRODUCTNAME */,
42
+ 37A5F6751D906B01006D972F /* Products */,
43
+ );
44
+ sourceTree = "<group>";
45
+ };
46
+ 37A5F6751D906B01006D972F /* Products */ = {
47
+ isa = PBXGroup;
48
+ children = (
49
+ 37A5F6741D906B01006D972F /* PRODUCTNAME.app */,
50
+ );
51
+ name = Products;
52
+ sourceTree = "<group>";
53
+ };
54
+ 37A5F6761D906B01006D972F /* PRODUCTNAME */ = {
55
+ isa = PBXGroup;
56
+ children = (
57
+ 37A5F6771D906B01006D972F /* AppDelegate.swift */,
58
+ 37A5F6791D906B01006D972F /* ViewController.swift */,
59
+ 37A5F67B1D906B01006D972F /* Main.storyboard */,
60
+ 37A5F67E1D906B01006D972F /* Assets.xcassets */,
61
+ 37A5F6801D906B01006D972F /* LaunchScreen.storyboard */,
62
+ 37A5F6831D906B01006D972F /* Info.plist */,
63
+ );
64
+ path = PRODUCTNAME;
65
+ sourceTree = "<group>";
66
+ };
67
+ /* End PBXGroup section */
68
+
69
+ /* Begin PBXNativeTarget section */
70
+ 37A5F6731D906B01006D972F /* PRODUCTNAME */ = {
71
+ isa = PBXNativeTarget;
72
+ buildConfigurationList = 37A5F6861D906B01006D972F /* Build configuration list for PBXNativeTarget "PRODUCTNAME" */;
73
+ buildPhases = (
74
+ 37A5F6701D906B01006D972F /* Sources */,
75
+ 37A5F6711D906B01006D972F /* Frameworks */,
76
+ 37A5F6721D906B01006D972F /* Resources */,
77
+ );
78
+ buildRules = (
79
+ );
80
+ dependencies = (
81
+ );
82
+ name = PRODUCTNAME;
83
+ productName = PRODUCTNAME;
84
+ productReference = 37A5F6741D906B01006D972F /* PRODUCTNAME.app */;
85
+ productType = "com.apple.product-type.application";
86
+ };
87
+ /* End PBXNativeTarget section */
88
+
89
+ /* Begin PBXProject section */
90
+ 37A5F66C1D906B01006D972F /* Project object */ = {
91
+ isa = PBXProject;
92
+ attributes = {
93
+ LastSwiftUpdateCheck = 0730;
94
+ LastUpgradeCheck = 0730;
95
+ ORGANIZATIONNAME = ORGANIZATION;
96
+ TargetAttributes = {
97
+ 37A5F6731D906B01006D972F = {
98
+ CreatedOnToolsVersion = 7.3.1;
99
+ };
100
+ };
101
+ };
102
+ buildConfigurationList = 37A5F66F1D906B01006D972F /* Build configuration list for PBXProject "PRODUCTNAME" */;
103
+ compatibilityVersion = "Xcode 3.2";
104
+ developmentRegion = English;
105
+ hasScannedForEncodings = 0;
106
+ knownRegions = (
107
+ en,
108
+ Base,
109
+ );
110
+ mainGroup = 37A5F66B1D906B01006D972F;
111
+ productRefGroup = 37A5F6751D906B01006D972F /* Products */;
112
+ projectDirPath = "";
113
+ projectRoot = "";
114
+ targets = (
115
+ 37A5F6731D906B01006D972F /* PRODUCTNAME */,
116
+ );
117
+ };
118
+ /* End PBXProject section */
119
+
120
+ /* Begin PBXResourcesBuildPhase section */
121
+ 37A5F6721D906B01006D972F /* Resources */ = {
122
+ isa = PBXResourcesBuildPhase;
123
+ buildActionMask = 2147483647;
124
+ files = (
125
+ 37A5F6821D906B01006D972F /* LaunchScreen.storyboard in Resources */,
126
+ 37A5F67F1D906B01006D972F /* Assets.xcassets in Resources */,
127
+ 37A5F67D1D906B01006D972F /* Main.storyboard in Resources */,
128
+ );
129
+ runOnlyForDeploymentPostprocessing = 0;
130
+ };
131
+ /* End PBXResourcesBuildPhase section */
132
+
133
+ /* Begin PBXSourcesBuildPhase section */
134
+ 37A5F6701D906B01006D972F /* Sources */ = {
135
+ isa = PBXSourcesBuildPhase;
136
+ buildActionMask = 2147483647;
137
+ files = (
138
+ 37A5F67A1D906B01006D972F /* ViewController.swift in Sources */,
139
+ 37A5F6781D906B01006D972F /* AppDelegate.swift in Sources */,
140
+ );
141
+ runOnlyForDeploymentPostprocessing = 0;
142
+ };
143
+ /* End PBXSourcesBuildPhase section */
144
+
145
+ /* Begin PBXVariantGroup section */
146
+ 37A5F67B1D906B01006D972F /* Main.storyboard */ = {
147
+ isa = PBXVariantGroup;
148
+ children = (
149
+ 37A5F67C1D906B01006D972F /* Base */,
150
+ );
151
+ name = Main.storyboard;
152
+ sourceTree = "<group>";
153
+ };
154
+ 37A5F6801D906B01006D972F /* LaunchScreen.storyboard */ = {
155
+ isa = PBXVariantGroup;
156
+ children = (
157
+ 37A5F6811D906B01006D972F /* Base */,
158
+ );
159
+ name = LaunchScreen.storyboard;
160
+ sourceTree = "<group>";
161
+ };
162
+ /* End PBXVariantGroup section */
163
+
164
+ /* Begin XCBuildConfiguration section */
165
+ 37A5F6841D906B01006D972F /* Debug */ = {
166
+ isa = XCBuildConfiguration;
167
+ buildSettings = {
168
+ ALWAYS_SEARCH_USER_PATHS = NO;
169
+ CLANG_ANALYZER_NONNULL = YES;
170
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
171
+ CLANG_CXX_LIBRARY = "libc++";
172
+ CLANG_ENABLE_MODULES = YES;
173
+ CLANG_ENABLE_OBJC_ARC = YES;
174
+ CLANG_WARN_BOOL_CONVERSION = YES;
175
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
176
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
177
+ CLANG_WARN_EMPTY_BODY = YES;
178
+ CLANG_WARN_ENUM_CONVERSION = YES;
179
+ CLANG_WARN_INT_CONVERSION = YES;
180
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
181
+ CLANG_WARN_UNREACHABLE_CODE = YES;
182
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
183
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
184
+ COPY_PHASE_STRIP = NO;
185
+ DEBUG_INFORMATION_FORMAT = dwarf;
186
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
187
+ ENABLE_TESTABILITY = YES;
188
+ GCC_C_LANGUAGE_STANDARD = gnu99;
189
+ GCC_DYNAMIC_NO_PIC = NO;
190
+ GCC_NO_COMMON_BLOCKS = YES;
191
+ GCC_OPTIMIZATION_LEVEL = 0;
192
+ GCC_PREPROCESSOR_DEFINITIONS = (
193
+ "DEBUG=1",
194
+ "$(inherited)",
195
+ );
196
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
197
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
198
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
199
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
200
+ GCC_WARN_UNUSED_FUNCTION = YES;
201
+ GCC_WARN_UNUSED_VARIABLE = YES;
202
+ IPHONEOS_DEPLOYMENT_TARGET = 9.3;
203
+ MTL_ENABLE_DEBUG_INFO = YES;
204
+ ONLY_ACTIVE_ARCH = YES;
205
+ SDKROOT = iphoneos;
206
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
207
+ TARGETED_DEVICE_FAMILY = "1,2";
208
+ };
209
+ name = Debug;
210
+ };
211
+ 37A5F6851D906B01006D972F /* Release */ = {
212
+ isa = XCBuildConfiguration;
213
+ buildSettings = {
214
+ ALWAYS_SEARCH_USER_PATHS = NO;
215
+ CLANG_ANALYZER_NONNULL = YES;
216
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
217
+ CLANG_CXX_LIBRARY = "libc++";
218
+ CLANG_ENABLE_MODULES = YES;
219
+ CLANG_ENABLE_OBJC_ARC = YES;
220
+ CLANG_WARN_BOOL_CONVERSION = YES;
221
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
222
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
223
+ CLANG_WARN_EMPTY_BODY = YES;
224
+ CLANG_WARN_ENUM_CONVERSION = YES;
225
+ CLANG_WARN_INT_CONVERSION = YES;
226
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
227
+ CLANG_WARN_UNREACHABLE_CODE = YES;
228
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
229
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
230
+ COPY_PHASE_STRIP = NO;
231
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
232
+ ENABLE_NS_ASSERTIONS = NO;
233
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
234
+ GCC_C_LANGUAGE_STANDARD = gnu99;
235
+ GCC_NO_COMMON_BLOCKS = YES;
236
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
237
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
238
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
239
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
240
+ GCC_WARN_UNUSED_FUNCTION = YES;
241
+ GCC_WARN_UNUSED_VARIABLE = YES;
242
+ IPHONEOS_DEPLOYMENT_TARGET = 9.3;
243
+ MTL_ENABLE_DEBUG_INFO = NO;
244
+ SDKROOT = iphoneos;
245
+ TARGETED_DEVICE_FAMILY = "1,2";
246
+ VALIDATE_PRODUCT = YES;
247
+ };
248
+ name = Release;
249
+ };
250
+ 37A5F6871D906B01006D972F /* Debug */ = {
251
+ isa = XCBuildConfiguration;
252
+ buildSettings = {
253
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
254
+ INFOPLIST_FILE = PRODUCTNAME/Info.plist;
255
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
256
+ PRODUCT_BUNDLE_IDENTIFIER = com.organization.PRODUCTNAME;
257
+ PRODUCT_NAME = "$(TARGET_NAME)";
258
+ };
259
+ name = Debug;
260
+ };
261
+ 37A5F6881D906B01006D972F /* Release */ = {
262
+ isa = XCBuildConfiguration;
263
+ buildSettings = {
264
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
265
+ INFOPLIST_FILE = PRODUCTNAME/Info.plist;
266
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
267
+ PRODUCT_BUNDLE_IDENTIFIER = com.organization.PRODUCTNAME;
268
+ PRODUCT_NAME = "$(TARGET_NAME)";
269
+ };
270
+ name = Release;
271
+ };
272
+ /* End XCBuildConfiguration section */
273
+
274
+ /* Begin XCConfigurationList section */
275
+ 37A5F66F1D906B01006D972F /* Build configuration list for PBXProject "PRODUCTNAME" */ = {
276
+ isa = XCConfigurationList;
277
+ buildConfigurations = (
278
+ 37A5F6841D906B01006D972F /* Debug */,
279
+ 37A5F6851D906B01006D972F /* Release */,
280
+ );
281
+ defaultConfigurationIsVisible = 0;
282
+ defaultConfigurationName = Release;
283
+ };
284
+ 37A5F6861D906B01006D972F /* Build configuration list for PBXNativeTarget "PRODUCTNAME" */ = {
285
+ isa = XCConfigurationList;
286
+ buildConfigurations = (
287
+ 37A5F6871D906B01006D972F /* Debug */,
288
+ 37A5F6881D906B01006D972F /* Release */,
289
+ );
290
+ defaultConfigurationIsVisible = 0;
291
+ };
292
+ /* End XCConfigurationList section */
293
+ };
294
+ rootObject = 37A5F66C1D906B01006D972F /* Project object */;
295
+ }
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ <FileRef
5
+ location = "self:PRODUCTNAME.xcodeproj">
6
+ </FileRef>
7
+ </Workspace>
@@ -0,0 +1,33 @@
1
+ import UIKit
2
+
3
+ @UIApplicationMain
4
+ class AppDelegate: UIResponder, UIApplicationDelegate {
5
+ var window: UIWindow?
6
+
7
+ func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
8
+ // Override point for customization after application launch.
9
+ return true
10
+ }
11
+
12
+ func applicationWillResignActive(application: UIApplication) {
13
+ // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
14
+ // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
15
+ }
16
+
17
+ func applicationDidEnterBackground(application: UIApplication) {
18
+ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
19
+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
20
+ }
21
+
22
+ func applicationWillEnterForeground(application: UIApplication) {
23
+ // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
24
+ }
25
+
26
+ func applicationDidBecomeActive(application: UIApplication) {
27
+ // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
28
+ }
29
+
30
+ func applicationWillTerminate(application: UIApplication) {
31
+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
32
+ }
33
+ }