ambient-xcode 0.6.0 → 0.7.0
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 +4 -4
- data/.gitignore +3 -0
- data/README.md +13 -3
- data/ambient-xcode.gemspec +1 -1
- data/bin/ambient +32 -2
- data/example/Ambientfile +2 -2
- data/example/Ambientfile-objc +2 -2
- data/lib/ambient.rb +10 -160
- data/lib/ambient/application.rb +165 -0
- data/lib/ambient/capabilities_helper.rb +71 -0
- data/lib/ambient/dsl.rb +4 -0
- data/lib/ambient/dsl/main_scope.rb +160 -0
- data/lib/ambient/dsl/plist_scope.rb +21 -0
- data/lib/ambient/dsl/scheme_scope.rb +40 -0
- data/lib/ambient/dsl/target_scope.rb +36 -0
- data/lib/ambient/init.rb +33 -0
- data/lib/ambient/plist_helper.rb +29 -0
- data/lib/ambient/project_creation.rb +83 -0
- data/lib/ambient/project_helper.rb +113 -0
- data/templates/ios/PRODUCTNAME.xcodeproj/project.pbxproj +295 -0
- data/templates/ios/PRODUCTNAME.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/templates/ios/PRODUCTNAME/AppDelegate.swift +33 -0
- data/templates/ios/PRODUCTNAME/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
- data/templates/ios/PRODUCTNAME/Base.lproj/LaunchScreen.storyboard +27 -0
- data/templates/ios/PRODUCTNAME/Base.lproj/Main.storyboard +25 -0
- data/templates/ios/PRODUCTNAME/Info.plist +47 -0
- data/templates/ios/PRODUCTNAME/ViewController.swift +13 -0
- metadata +29 -13
- data/lib/capabilities_helper.rb +0 -71
- data/lib/dsl.rb +0 -229
- data/lib/plist_helper.rb +0 -29
- data/lib/project_helper.rb +0 -112
@@ -0,0 +1,68 @@
|
|
1
|
+
{
|
2
|
+
"images" : [
|
3
|
+
{
|
4
|
+
"idiom" : "iphone",
|
5
|
+
"size" : "29x29",
|
6
|
+
"scale" : "2x"
|
7
|
+
},
|
8
|
+
{
|
9
|
+
"idiom" : "iphone",
|
10
|
+
"size" : "29x29",
|
11
|
+
"scale" : "3x"
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"idiom" : "iphone",
|
15
|
+
"size" : "40x40",
|
16
|
+
"scale" : "2x"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"idiom" : "iphone",
|
20
|
+
"size" : "40x40",
|
21
|
+
"scale" : "3x"
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"idiom" : "iphone",
|
25
|
+
"size" : "60x60",
|
26
|
+
"scale" : "2x"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"idiom" : "iphone",
|
30
|
+
"size" : "60x60",
|
31
|
+
"scale" : "3x"
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"idiom" : "ipad",
|
35
|
+
"size" : "29x29",
|
36
|
+
"scale" : "1x"
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"idiom" : "ipad",
|
40
|
+
"size" : "29x29",
|
41
|
+
"scale" : "2x"
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"idiom" : "ipad",
|
45
|
+
"size" : "40x40",
|
46
|
+
"scale" : "1x"
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"idiom" : "ipad",
|
50
|
+
"size" : "40x40",
|
51
|
+
"scale" : "2x"
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"idiom" : "ipad",
|
55
|
+
"size" : "76x76",
|
56
|
+
"scale" : "1x"
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"idiom" : "ipad",
|
60
|
+
"size" : "76x76",
|
61
|
+
"scale" : "2x"
|
62
|
+
}
|
63
|
+
],
|
64
|
+
"info" : {
|
65
|
+
"version" : 1,
|
66
|
+
"author" : "xcode"
|
67
|
+
}
|
68
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
|
3
|
+
<dependencies>
|
4
|
+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
|
5
|
+
</dependencies>
|
6
|
+
<scenes>
|
7
|
+
<!--View Controller-->
|
8
|
+
<scene sceneID="EHf-IW-A2E">
|
9
|
+
<objects>
|
10
|
+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
11
|
+
<layoutGuides>
|
12
|
+
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
|
13
|
+
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
|
14
|
+
</layoutGuides>
|
15
|
+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
16
|
+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
17
|
+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
18
|
+
<animations/>
|
19
|
+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
20
|
+
</view>
|
21
|
+
</viewController>
|
22
|
+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
23
|
+
</objects>
|
24
|
+
<point key="canvasLocation" x="53" y="375"/>
|
25
|
+
</scene>
|
26
|
+
</scenes>
|
27
|
+
</document>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
3
|
+
<dependencies>
|
4
|
+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
|
5
|
+
</dependencies>
|
6
|
+
<scenes>
|
7
|
+
<!--View Controller-->
|
8
|
+
<scene sceneID="tne-QT-ifu">
|
9
|
+
<objects>
|
10
|
+
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
|
11
|
+
<layoutGuides>
|
12
|
+
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
13
|
+
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
14
|
+
</layoutGuides>
|
15
|
+
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
16
|
+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
17
|
+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
18
|
+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
19
|
+
</view>
|
20
|
+
</viewController>
|
21
|
+
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
22
|
+
</objects>
|
23
|
+
</scene>
|
24
|
+
</scenes>
|
25
|
+
</document>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
6
|
+
<string>en</string>
|
7
|
+
<key>CFBundleExecutable</key>
|
8
|
+
<string>$(EXECUTABLE_NAME)</string>
|
9
|
+
<key>CFBundleIdentifier</key>
|
10
|
+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
11
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
12
|
+
<string>6.0</string>
|
13
|
+
<key>CFBundleName</key>
|
14
|
+
<string>$(PRODUCT_NAME)</string>
|
15
|
+
<key>CFBundlePackageType</key>
|
16
|
+
<string>APPL</string>
|
17
|
+
<key>CFBundleShortVersionString</key>
|
18
|
+
<string>1.0</string>
|
19
|
+
<key>CFBundleSignature</key>
|
20
|
+
<string>????</string>
|
21
|
+
<key>CFBundleVersion</key>
|
22
|
+
<string>1</string>
|
23
|
+
<key>LSRequiresIPhoneOS</key>
|
24
|
+
<true/>
|
25
|
+
<key>UILaunchStoryboardName</key>
|
26
|
+
<string>LaunchScreen</string>
|
27
|
+
<key>UIMainStoryboardFile</key>
|
28
|
+
<string>Main</string>
|
29
|
+
<key>UIRequiredDeviceCapabilities</key>
|
30
|
+
<array>
|
31
|
+
<string>armv7</string>
|
32
|
+
</array>
|
33
|
+
<key>UISupportedInterfaceOrientations</key>
|
34
|
+
<array>
|
35
|
+
<string>UIInterfaceOrientationPortrait</string>
|
36
|
+
<string>UIInterfaceOrientationLandscapeLeft</string>
|
37
|
+
<string>UIInterfaceOrientationLandscapeRight</string>
|
38
|
+
</array>
|
39
|
+
<key>UISupportedInterfaceOrientations~ipad</key>
|
40
|
+
<array>
|
41
|
+
<string>UIInterfaceOrientationPortrait</string>
|
42
|
+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
43
|
+
<string>UIInterfaceOrientationLandscapeLeft</string>
|
44
|
+
<string>UIInterfaceOrientationLandscapeRight</string>
|
45
|
+
</array>
|
46
|
+
</dict>
|
47
|
+
</plist>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import UIKit
|
2
|
+
|
3
|
+
class ViewController: UIViewController {
|
4
|
+
override func viewDidLoad() {
|
5
|
+
super.viewDidLoad()
|
6
|
+
// Do any additional setup after loading the view, typically from a nib.
|
7
|
+
}
|
8
|
+
|
9
|
+
override func didReceiveMemoryWarning() {
|
10
|
+
super.didReceiveMemoryWarning()
|
11
|
+
// Dispose of any resources that can be recreated.
|
12
|
+
}
|
13
|
+
}
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ambient-xcode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Inkpen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xcodeproj
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: plist
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 3.2.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 3.2.0
|
41
41
|
description: CLI for configuring Xcode projects from a Ruby file.
|
@@ -46,6 +46,7 @@ executables:
|
|
46
46
|
extensions: []
|
47
47
|
extra_rdoc_files: []
|
48
48
|
files:
|
49
|
+
- ".gitignore"
|
49
50
|
- README.md
|
50
51
|
- ambient-xcode.gemspec
|
51
52
|
- bin/ambient
|
@@ -54,10 +55,25 @@ files:
|
|
54
55
|
- example/Ambientfile-verbose
|
55
56
|
- example/images/Constant.png
|
56
57
|
- lib/ambient.rb
|
57
|
-
- lib/
|
58
|
-
- lib/
|
59
|
-
- lib/
|
60
|
-
- lib/
|
58
|
+
- lib/ambient/application.rb
|
59
|
+
- lib/ambient/capabilities_helper.rb
|
60
|
+
- lib/ambient/dsl.rb
|
61
|
+
- lib/ambient/dsl/main_scope.rb
|
62
|
+
- lib/ambient/dsl/plist_scope.rb
|
63
|
+
- lib/ambient/dsl/scheme_scope.rb
|
64
|
+
- lib/ambient/dsl/target_scope.rb
|
65
|
+
- lib/ambient/init.rb
|
66
|
+
- lib/ambient/plist_helper.rb
|
67
|
+
- lib/ambient/project_creation.rb
|
68
|
+
- lib/ambient/project_helper.rb
|
69
|
+
- templates/ios/PRODUCTNAME.xcodeproj/project.pbxproj
|
70
|
+
- templates/ios/PRODUCTNAME.xcodeproj/project.xcworkspace/contents.xcworkspacedata
|
71
|
+
- templates/ios/PRODUCTNAME/AppDelegate.swift
|
72
|
+
- templates/ios/PRODUCTNAME/Assets.xcassets/AppIcon.appiconset/Contents.json
|
73
|
+
- templates/ios/PRODUCTNAME/Base.lproj/LaunchScreen.storyboard
|
74
|
+
- templates/ios/PRODUCTNAME/Base.lproj/Main.storyboard
|
75
|
+
- templates/ios/PRODUCTNAME/Info.plist
|
76
|
+
- templates/ios/PRODUCTNAME/ViewController.swift
|
61
77
|
homepage: https://github.com/Dan2552/ambient
|
62
78
|
licenses:
|
63
79
|
- MIT
|
@@ -68,17 +84,17 @@ require_paths:
|
|
68
84
|
- lib
|
69
85
|
required_ruby_version: !ruby/object:Gem::Requirement
|
70
86
|
requirements:
|
71
|
-
- -
|
87
|
+
- - ">="
|
72
88
|
- !ruby/object:Gem::Version
|
73
89
|
version: '0'
|
74
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
91
|
requirements:
|
76
|
-
- -
|
92
|
+
- - ">="
|
77
93
|
- !ruby/object:Gem::Version
|
78
94
|
version: '0'
|
79
95
|
requirements: []
|
80
96
|
rubyforge_project:
|
81
|
-
rubygems_version: 2.
|
97
|
+
rubygems_version: 2.5.1
|
82
98
|
signing_key:
|
83
99
|
specification_version: 4
|
84
100
|
summary: Define your envrionment settings all in one easy to read Ruby file, and re-apply
|
data/lib/capabilities_helper.rb
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
require 'xcodeproj'
|
2
|
-
class CapabilitiesHelper
|
3
|
-
CAPABILITIES = {
|
4
|
-
application_group_ios: "ApplicationGroups.iOS",
|
5
|
-
background_modes: "BackgroundModes",
|
6
|
-
data_protection: "DataProtection",
|
7
|
-
game_center: "GameCenter",
|
8
|
-
healthkit: "HealthKit",
|
9
|
-
health_kit: "HealthKit",
|
10
|
-
homekit: "HomeKit",
|
11
|
-
home_kit: "HomeKit",
|
12
|
-
in_app_purchase: "InAppPurchase",
|
13
|
-
inter_app_audio: "InterAppAudio",
|
14
|
-
keychain: "Keychain",
|
15
|
-
maps: "Maps.iOS",
|
16
|
-
apple_pay: "OMC",
|
17
|
-
passbook: "Passbook",
|
18
|
-
wallet: "Passbook",
|
19
|
-
safari_keychain: "SafariKeychain",
|
20
|
-
personal_vpn: "VPNLite",
|
21
|
-
wireless_accessory_configuration: "WAC",
|
22
|
-
icloud: "iCloud"
|
23
|
-
}
|
24
|
-
|
25
|
-
def initialize(project, target)
|
26
|
-
@project = project
|
27
|
-
@target = target
|
28
|
-
end
|
29
|
-
|
30
|
-
def clear_capabilities
|
31
|
-
capabilities.delete_if { |_, _| true } if capabilities
|
32
|
-
end
|
33
|
-
|
34
|
-
def enable_capability(capability)
|
35
|
-
capabilities[capability_key(capability)] = {"enabled"=>"1"}
|
36
|
-
end
|
37
|
-
|
38
|
-
def disable_capability(capability)
|
39
|
-
capabilities.delete(capability_key(capability))
|
40
|
-
end
|
41
|
-
|
42
|
-
def set_development_team(team)
|
43
|
-
target_attributes["DevelopmentTeam"] = team
|
44
|
-
end
|
45
|
-
|
46
|
-
private
|
47
|
-
|
48
|
-
def capabilities
|
49
|
-
target_attributes["SystemCapabilities"]
|
50
|
-
end
|
51
|
-
|
52
|
-
def target_attributes
|
53
|
-
unless @project.root_object.attributes["TargetAttributes"]
|
54
|
-
@project.root_object.attributes["TargetAttributes"] = {}
|
55
|
-
end
|
56
|
-
|
57
|
-
unless @project.root_object.attributes["TargetAttributes"][@target.uuid]
|
58
|
-
@project.root_object.attributes["TargetAttributes"][@target.uuid] = {}
|
59
|
-
end
|
60
|
-
|
61
|
-
@project.root_object.attributes["TargetAttributes"][@target.uuid]
|
62
|
-
end
|
63
|
-
|
64
|
-
def capability_key(capability)
|
65
|
-
capability = CAPABILITIES[capability] || capability.to_s
|
66
|
-
prefix = "com.apple."
|
67
|
-
capability = "#{prefix}#{capability}" unless capability.start_with? prefix
|
68
|
-
capability
|
69
|
-
end
|
70
|
-
|
71
|
-
end
|
data/lib/dsl.rb
DELETED
@@ -1,229 +0,0 @@
|
|
1
|
-
def use_settings_from(filename)
|
2
|
-
Ambient.configure { run_ambientfile(filename) }
|
3
|
-
end
|
4
|
-
|
5
|
-
def option(name, value)
|
6
|
-
Ambient.configure { set_option(name, value) }
|
7
|
-
end
|
8
|
-
|
9
|
-
def base_ios_settings!(project_name, prefix: "", tests: false, ui_tests: false, swift: true, target: nil, test_target: nil, ui_test_target: nil)
|
10
|
-
use_defaults_for_everything_not_specified_in_this_file!
|
11
|
-
enable_default_warnings!
|
12
|
-
|
13
|
-
target ||= "project_name"
|
14
|
-
test_target ||= "#{project_name}Tests"
|
15
|
-
ui_test_target ||= "#{project_name}UITests"
|
16
|
-
tests = true if test_target
|
17
|
-
ui_tests = true if ui_test_target
|
18
|
-
|
19
|
-
option "ALWAYS_SEARCH_USER_PATHS", false
|
20
|
-
option "CLANG_CXX_LANGUAGE_STANDARD", "gnu++0x"
|
21
|
-
option "CLANG_CXX_LIBRARY", "libc++"
|
22
|
-
option "CLANG_ENABLE_MODULES", true
|
23
|
-
option "CLANG_ENABLE_OBJC_ARC", true
|
24
|
-
|
25
|
-
option "CODE_SIGN_IDENTITY[sdk=iphoneos*]", "iPhone Developer"
|
26
|
-
option "COPY_PHASE_STRIP", false
|
27
|
-
|
28
|
-
option "ENABLE_STRICT_OBJC_MSGSEND", true
|
29
|
-
option "GCC_C_LANGUAGE_STANDARD", "gnu99"
|
30
|
-
option "GCC_NO_COMMON_BLOCKS", true
|
31
|
-
option "SDKROOT", "iphoneos"
|
32
|
-
option "IPHONEOS_DEPLOYMENT_TARGET", "9.0"
|
33
|
-
|
34
|
-
scheme "Debug" do
|
35
|
-
option "DEBUG_INFORMATION_FORMAT", "dwarf"
|
36
|
-
option "ENABLE_TESTABILITY", true
|
37
|
-
option "MTL_ENABLE_DEBUG_INFO", true
|
38
|
-
option "ONLY_ACTIVE_ARCH", true
|
39
|
-
option "GCC_DYNAMIC_NO_PIC", false
|
40
|
-
option "GCC_OPTIMIZATION_LEVEL", "0"
|
41
|
-
option "GCC_PREPROCESSOR_DEFINITIONS", ["DEBUG=1", "$(inherited)"]
|
42
|
-
option "SWIFT_OPTIMIZATION_LEVEL", "-Onone" if swift
|
43
|
-
end
|
44
|
-
|
45
|
-
scheme "Release" do
|
46
|
-
option "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym"
|
47
|
-
option "ENABLE_NS_ASSERTIONS", false
|
48
|
-
option "MTL_ENABLE_DEBUG_INFO", false
|
49
|
-
option "VALIDATE_PRODUCT", true
|
50
|
-
end
|
51
|
-
|
52
|
-
target project_name do
|
53
|
-
option "INFOPLIST_FILE", "#{project_name}/Info.plist"
|
54
|
-
option "PRODUCT_BUNDLE_IDENTIFIER", "#{prefix}#{project_name}"
|
55
|
-
option "ASSETCATALOG_COMPILER_APPICON_NAME", "AppIcon"
|
56
|
-
option "LD_RUNPATH_SEARCH_PATHS", "$(inherited) @executable_path/Frameworks"
|
57
|
-
option "PRODUCT_NAME", "$(TARGET_NAME)"
|
58
|
-
end
|
59
|
-
|
60
|
-
if tests
|
61
|
-
target test_target do
|
62
|
-
option "INFOPLIST_FILE", "#{project_name}Tests/Info.plist"
|
63
|
-
option "BUNDLE_LOADER", "$(TEST_HOST)"
|
64
|
-
option "TEST_HOST", "$(BUILT_PRODUCTS_DIR)/#{project_name}.app/#{project_name}"
|
65
|
-
option "PRODUCT_BUNDLE_IDENTIFIER", "#{prefix}#{project_name}Tests"
|
66
|
-
option "LD_RUNPATH_SEARCH_PATHS", "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
|
67
|
-
option "PRODUCT_NAME", "$(TARGET_NAME)"
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
if ui_tests
|
72
|
-
target ui_test_target do
|
73
|
-
option "INFOPLIST_FILE", "#{project_name}UITests/Info.plist"
|
74
|
-
option "TEST_TARGET_NAME", "#{project_name}"
|
75
|
-
option "PRODUCT_BUNDLE_IDENTIFIER", "#{prefix}#{project_name}UITests"
|
76
|
-
option "LD_RUNPATH_SEARCH_PATHS", "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
|
77
|
-
option "USES_XCTRUNNER", "YES"
|
78
|
-
option "PRODUCT_NAME", "$(TARGET_NAME)"
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
def enable_extra_warnings_and_static_analyser!
|
84
|
-
warnings = %w(GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED
|
85
|
-
GCC_WARN_MISSING_PARENTHESES
|
86
|
-
GCC_WARN_ABOUT_RETURN_TYPE
|
87
|
-
GCC_WARN_SIGN_COMPARE
|
88
|
-
GCC_WARN_CHECK_SWITCH_STATEMENTS
|
89
|
-
GCC_WARN_UNUSED_FUNCTION
|
90
|
-
GCC_WARN_UNUSED_LABEL
|
91
|
-
GCC_WARN_UNUSED_VALUE
|
92
|
-
GCC_WARN_UNUSED_VARIABLE
|
93
|
-
GCC_WARN_SHADOW
|
94
|
-
GCC_WARN_64_TO_32_BIT_CONVERSION
|
95
|
-
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS
|
96
|
-
GCC_WARN_UNDECLARED_SELECTOR
|
97
|
-
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF
|
98
|
-
GCC_WARN_UNINITIALIZED_AUTOS
|
99
|
-
CLANG_WARN_INT_CONVERSION
|
100
|
-
CLANG_WARN_ENUM_CONVERSION
|
101
|
-
CLANG_WARN_CONSTANT_CONVERSION
|
102
|
-
CLANG_WARN_BOOL_CONVERSION
|
103
|
-
CLANG_WARN_EMPTY_BODY
|
104
|
-
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION
|
105
|
-
CLANG_WARN__DUPLICATE_METHOD_MATCH
|
106
|
-
GCC_WARN_64_TO_32_BIT_CONVERSION
|
107
|
-
RUN_CLANG_STATIC_ANALYZER
|
108
|
-
GCC_TREAT_WARNINGS_AS_ERRORS)
|
109
|
-
warnings.each { |w| option(w, true) }
|
110
|
-
end
|
111
|
-
|
112
|
-
def enable_default_warnings!
|
113
|
-
truthy = %w(CLANG_WARN_BOOL_CONVERSION
|
114
|
-
CLANG_WARN_CONSTANT_CONVERSION
|
115
|
-
CLANG_WARN_EMPTY_BODY
|
116
|
-
CLANG_WARN_ENUM_CONVERSION
|
117
|
-
CLANG_WARN_INT_CONVERSION
|
118
|
-
CLANG_WARN_UNREACHABLE_CODE
|
119
|
-
CLANG_WARN__DUPLICATE_METHOD_MATCH
|
120
|
-
GCC_WARN_64_TO_32_BIT_CONVERSION
|
121
|
-
GCC_WARN_UNDECLARED_SELECTOR
|
122
|
-
GCC_WARN_UNUSED_FUNCTION
|
123
|
-
GCC_WARN_UNUSED_VARIABLE)
|
124
|
-
error = %w(CLANG_WARN_DIRECT_OBJC_ISA_USAGE
|
125
|
-
CLANG_WARN_OBJC_ROOT_CLASS
|
126
|
-
GCC_WARN_ABOUT_RETURN_TYPE)
|
127
|
-
aggressive = %w(GCC_WARN_UNINITIALIZED_AUTOS)
|
128
|
-
|
129
|
-
truthy.each { |w| option(w, true) }
|
130
|
-
error.each { |w| option(w, "YES_ERROR") }
|
131
|
-
aggressive.each { |w| option(w, "YES_AGGRESSIVE") }
|
132
|
-
end
|
133
|
-
|
134
|
-
def target(name, &block)
|
135
|
-
TargetScope.new(name).configure(&block)
|
136
|
-
end
|
137
|
-
|
138
|
-
def use_defaults_for_everything_not_specified_in_this_file!
|
139
|
-
Ambient.configure { @use_defaults = true }
|
140
|
-
end
|
141
|
-
|
142
|
-
def scheme(name, parent: nil, &block)
|
143
|
-
SchemeScope.new(nil, name, parent).configure(&block)
|
144
|
-
end
|
145
|
-
|
146
|
-
def plist(path, &block)
|
147
|
-
PlistScope.new(path).configure(&block)
|
148
|
-
end
|
149
|
-
|
150
|
-
class PlistScope
|
151
|
-
attr_reader :helper
|
152
|
-
|
153
|
-
def initialize(path)
|
154
|
-
@helper = PlistHelper.new(path)
|
155
|
-
end
|
156
|
-
|
157
|
-
def configure(&block)
|
158
|
-
instance_eval(&block)
|
159
|
-
end
|
160
|
-
|
161
|
-
def entry(key, value)
|
162
|
-
helper.add_entry(key, value)
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
class TargetScope
|
167
|
-
attr_reader :name
|
168
|
-
|
169
|
-
def initialize(name)
|
170
|
-
@name = name
|
171
|
-
end
|
172
|
-
|
173
|
-
def configure(&block)
|
174
|
-
instance_eval(&block)
|
175
|
-
end
|
176
|
-
|
177
|
-
def option(option_name, value)
|
178
|
-
target_name = @name
|
179
|
-
Ambient.configure { set_option(option_name, value, target: target_name) }
|
180
|
-
end
|
181
|
-
|
182
|
-
def scheme(name, parent: nil, &block)
|
183
|
-
SchemeScope.new(self, name, parent).configure(&block)
|
184
|
-
end
|
185
|
-
|
186
|
-
def capability(capability_name)
|
187
|
-
target_name = @name
|
188
|
-
Ambient.configure { set_capability(target_name, capability_name) }
|
189
|
-
end
|
190
|
-
|
191
|
-
def development_team(team_name)
|
192
|
-
target_name = @name
|
193
|
-
Ambient.configure { set_development_team(target_name, team_name) }
|
194
|
-
end
|
195
|
-
end
|
196
|
-
|
197
|
-
class SchemeScope
|
198
|
-
def initialize(target, name, parent)
|
199
|
-
@target = target
|
200
|
-
@name = name
|
201
|
-
@parent = parent
|
202
|
-
|
203
|
-
Ambient.configure do
|
204
|
-
set_parent_scheme(
|
205
|
-
target: target && target.name,
|
206
|
-
child: name,
|
207
|
-
parent: parent
|
208
|
-
)
|
209
|
-
end
|
210
|
-
end
|
211
|
-
|
212
|
-
def configure(&block)
|
213
|
-
if block
|
214
|
-
instance_eval(&block)
|
215
|
-
end
|
216
|
-
end
|
217
|
-
|
218
|
-
def option(option_name, value)
|
219
|
-
target = @target
|
220
|
-
name = @name
|
221
|
-
parent = @parent
|
222
|
-
|
223
|
-
if target
|
224
|
-
Ambient.configure { set_option(option_name, value, target: target.name, scheme: name, parent: parent) }
|
225
|
-
else
|
226
|
-
Ambient.configure { set_option(option_name, value, scheme: name, parent: parent) }
|
227
|
-
end
|
228
|
-
end
|
229
|
-
end
|