rswift 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +56 -0
  7. data/Rakefile +6 -0
  8. data/bin/rswift +7 -0
  9. data/lib/ext/array.rb +12 -0
  10. data/lib/ext/group.rb +24 -0
  11. data/lib/ext/native_target.rb +54 -0
  12. data/lib/ext/project.rb +68 -0
  13. data/lib/rswift.rb +22 -0
  14. data/lib/rswift/attributes_configurator.rb +20 -0
  15. data/lib/rswift/build_settings_configurator.rb +26 -0
  16. data/lib/rswift/build_settings_provider.rb +84 -0
  17. data/lib/rswift/cli.rb +33 -0
  18. data/lib/rswift/configuration.rb +41 -0
  19. data/lib/rswift/constants.rb +106 -0
  20. data/lib/rswift/device_provider.rb +25 -0
  21. data/lib/rswift/files_references_manager.rb +17 -0
  22. data/lib/rswift/group_references_manager.rb +114 -0
  23. data/lib/rswift/project_configurator.rb +41 -0
  24. data/lib/rswift/scheme_configurator.rb +10 -0
  25. data/lib/rswift/target_configurator.rb +22 -0
  26. data/lib/rswift/template_manager.rb +28 -0
  27. data/lib/rswift/templates/app/ios/.gitignore.erb +22 -0
  28. data/lib/rswift/templates/app/ios/Gemfile.erb +4 -0
  29. data/lib/rswift/templates/app/ios/Podfile.erb +11 -0
  30. data/lib/rswift/templates/app/ios/Rakefile.erb +1 -0
  31. data/lib/rswift/templates/app/ios/app/AppDelegate.swift.erb +15 -0
  32. data/lib/rswift/templates/app/ios/app/Assets.xcassets/AppIcon.appiconset/Contents.json.erb +73 -0
  33. data/lib/rswift/templates/app/ios/app/Info.plist.erb +45 -0
  34. data/lib/rswift/templates/app/ios/app/LaunchScreen.storyboard.erb +28 -0
  35. data/lib/rswift/templates/app/ios/package.json.erb +14 -0
  36. data/lib/rswift/templates/app/ios/spec/AppDelegateSpec.swift.erb +24 -0
  37. data/lib/rswift/templates/app/ios/spec/Info.plist.erb +24 -0
  38. data/lib/rswift/templates/app/osx/.gitignore.erb +21 -0
  39. data/lib/rswift/templates/app/osx/Gemfile.erb +4 -0
  40. data/lib/rswift/templates/app/osx/Podfile.erb +7 -0
  41. data/lib/rswift/templates/app/osx/Rakefile.erb +1 -0
  42. data/lib/rswift/templates/app/osx/app/AppDelegate.swift.erb +30 -0
  43. data/lib/rswift/templates/app/osx/app/Assets.xcassets/AppIcon.appiconset/Contents.json.erb +58 -0
  44. data/lib/rswift/templates/app/osx/app/Info.plist.erb +30 -0
  45. data/lib/rswift/templates/app/osx/app/main.swift.erb +5 -0
  46. data/lib/rswift/templates/app/osx/spec/AppDelegateSpec.swift.erb +24 -0
  47. data/lib/rswift/templates/app/osx/spec/Info.plist.erb +24 -0
  48. data/lib/rswift/templates/app/tvos/.gitignore.erb +21 -0
  49. data/lib/rswift/templates/app/tvos/Gemfile.erb +4 -0
  50. data/lib/rswift/templates/app/tvos/Podfile.erb +11 -0
  51. data/lib/rswift/templates/app/tvos/Rakefile.erb +1 -0
  52. data/lib/rswift/templates/app/tvos/app/AppDelegate.swift.erb +15 -0
  53. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/AppIcon.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json.erb +12 -0
  54. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/AppIcon.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json.erb +6 -0
  55. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/AppIcon.brandassets/App Icon - Large.imagestack/Contents.json.erb +17 -0
  56. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/AppIcon.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json.erb +12 -0
  57. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/AppIcon.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json.erb +6 -0
  58. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/AppIcon.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json.erb +12 -0
  59. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/AppIcon.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json.erb +6 -0
  60. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/AppIcon.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json.erb +12 -0
  61. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/AppIcon.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json.erb +6 -0
  62. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/AppIcon.brandassets/App Icon - Small.imagestack/Contents.json.erb +17 -0
  63. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/AppIcon.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json.erb +12 -0
  64. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/AppIcon.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json.erb +6 -0
  65. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/AppIcon.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json.erb +12 -0
  66. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/AppIcon.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json.erb +6 -0
  67. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/AppIcon.brandassets/Contents.json.erb +26 -0
  68. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/AppIcon.brandassets/Top Shelf Image.imageset/Contents.json.erb +12 -0
  69. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/Contents.json.erb +6 -0
  70. data/lib/rswift/templates/app/tvos/app/Assets.xcassets/LaunchImage.launchimage/Contents.json.erb +15 -0
  71. data/lib/rswift/templates/app/tvos/app/Info.plist.erb +30 -0
  72. data/lib/rswift/templates/app/tvos/spec/AppDelegateSpec.swift.erb +24 -0
  73. data/lib/rswift/templates/app/tvos/spec/Info.plist.erb +24 -0
  74. data/lib/rswift/templates/app/watchos/wk_app/Assets.xcassets/AppIcon.appiconset/Contents.json.erb +55 -0
  75. data/lib/rswift/templates/app/watchos/wk_app/Info.plist.erb +35 -0
  76. data/lib/rswift/templates/app/watchos/wk_app/Interface.storyboard.erb +15 -0
  77. data/lib/rswift/templates/app/watchos/wk_ext/Assets.xcassets/README__ignoredByTemplate__ +1 -0
  78. data/lib/rswift/templates/app/watchos/wk_ext/ExtensionDelegate.swift.erb +4 -0
  79. data/lib/rswift/templates/app/watchos/wk_ext/Info.plist.erb +40 -0
  80. data/lib/rswift/templates/app/watchos/wk_ext/InterfaceController.swift.erb +6 -0
  81. data/lib/rswift/version.rb +3 -0
  82. data/lib/rswift/workspace_provider.rb +11 -0
  83. data/rswift.gemspec +26 -0
  84. metadata +227 -0
@@ -0,0 +1,22 @@
1
+ build/
2
+ *.pbxuser
3
+ !default.pbxuser
4
+ *.mode1v3
5
+ !default.mode1v3
6
+ *.mode2v3
7
+ !default.mode2v3
8
+ *.perspectivev3
9
+ !default.perspectivev3
10
+ xcuserdata
11
+ *.xccheckout
12
+ *.moved-aside
13
+ DerivedData
14
+ *.hmap
15
+ *.ipa
16
+ *.xcuserstate
17
+ *.xcworkspacedata
18
+ .idea/
19
+ Pods/
20
+ node_modules/
21
+ Carthage/
22
+ .irb-history
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'cocoapods'
4
+ gem 'rswift-ios'
@@ -0,0 +1,11 @@
1
+ platform :ios, '9.0'
2
+ use_frameworks!
3
+
4
+ target '<%= @name %>' do
5
+ pod 'Reveal-iOS-SDK', configurations: ['Debug']
6
+ end
7
+
8
+ target '<%= @name %>Specs' do
9
+ pod 'Quick'
10
+ pod 'Nimble'
11
+ end
@@ -0,0 +1 @@
1
+ require 'rswift/ios'
@@ -0,0 +1,15 @@
1
+ import UIKit
2
+
3
+ @UIApplicationMain
4
+ class AppDelegate: UIResponder, UIApplicationDelegate {
5
+
6
+ var window: UIWindow?
7
+
8
+ func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject:AnyObject]?) -> Bool {
9
+ window = UIWindow(frame: UIScreen.mainScreen().bounds)
10
+ window?.rootViewController = UIViewController()
11
+ window?.backgroundColor = UIColor.whiteColor()
12
+ window?.makeKeyAndVisible()
13
+ return true
14
+ }
15
+ }
@@ -0,0 +1,73 @@
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
+ "idiom" : "ipad",
65
+ "size" : "83.5x83.5",
66
+ "scale" : "2x"
67
+ }
68
+ ],
69
+ "info" : {
70
+ "version" : 1,
71
+ "author" : "xcode"
72
+ }
73
+ }
@@ -0,0 +1,45 @@
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>UIRequiredDeviceCapabilities</key>
28
+ <array>
29
+ <string>armv7</string>
30
+ </array>
31
+ <key>UISupportedInterfaceOrientations</key>
32
+ <array>
33
+ <string>UIInterfaceOrientationPortrait</string>
34
+ <string>UIInterfaceOrientationLandscapeLeft</string>
35
+ <string>UIInterfaceOrientationLandscapeRight</string>
36
+ </array>
37
+ <key>UISupportedInterfaceOrientations~ipad</key>
38
+ <array>
39
+ <string>UIInterfaceOrientationPortrait</string>
40
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
41
+ <string>UIInterfaceOrientationLandscapeLeft</string>
42
+ <string>UIInterfaceOrientationLandscapeRight</string>
43
+ </array>
44
+ </dict>
45
+ </plist>
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
3
+ <dependencies>
4
+ <deployment identifier="iOS"/>
5
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
6
+ </dependencies>
7
+ <scenes>
8
+ <!--View Controller-->
9
+ <scene sceneID="EHf-IW-A2E">
10
+ <objects>
11
+ <viewController id="01J-lp-oVM" sceneMemberID="viewController">
12
+ <layoutGuides>
13
+ <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
14
+ <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
15
+ </layoutGuides>
16
+ <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
17
+ <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
18
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19
+ <animations/>
20
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
21
+ </view>
22
+ </viewController>
23
+ <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
24
+ </objects>
25
+ <point key="canvasLocation" x="53" y="375"/>
26
+ </scene>
27
+ </scenes>
28
+ </document>
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "<%= @name.downcase %>",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "ios-deploy": ">=0.0.0"
13
+ }
14
+ }
@@ -0,0 +1,24 @@
1
+ import Quick
2
+ import Nimble
3
+
4
+ @testable import <%= @name %>
5
+
6
+ class AppDelegateSpec: QuickSpec {
7
+
8
+ override func spec() {
9
+
10
+ var sut: AppDelegate!
11
+
12
+ beforeEach {
13
+ sut = AppDelegate()
14
+ }
15
+
16
+ afterEach {
17
+ sut = nil
18
+ }
19
+
20
+ it("should pass") {
21
+ expect(true).to(beTruthy())
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,24 @@
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>BNDL</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
+ </dict>
24
+ </plist>
@@ -0,0 +1,21 @@
1
+ build/
2
+ *.pbxuser
3
+ !default.pbxuser
4
+ *.mode1v3
5
+ !default.mode1v3
6
+ *.mode2v3
7
+ !default.mode2v3
8
+ *.perspectivev3
9
+ !default.perspectivev3
10
+ xcuserdata
11
+ *.xccheckout
12
+ *.moved-aside
13
+ DerivedData
14
+ *.hmap
15
+ *.ipa
16
+ *.xcuserstate
17
+ *.xcworkspacedata
18
+ .idea/
19
+ Pods/
20
+ Carthage/
21
+ .irb-history
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'cocoapods'
4
+ gem 'rswift-osx'
@@ -0,0 +1,7 @@
1
+ platform :osx, '10.11'
2
+ use_frameworks!
3
+
4
+ target '<%= @name %>Specs' do
5
+ pod 'Quick'
6
+ pod 'Nimble'
7
+ end
@@ -0,0 +1 @@
1
+ require 'rswift/osx'
@@ -0,0 +1,30 @@
1
+ import Cocoa
2
+
3
+ class AppDelegate: NSObject, NSApplicationDelegate {
4
+
5
+ var window: NSWindow?
6
+
7
+ func applicationDidFinishLaunching(aNotification: NSNotification) {
8
+ let appName = NSBundle.mainBundle().infoDictionary?["CFBundleName"] as! String
9
+
10
+ let mainMenu = NSMenu(title: appName)
11
+ let appNameMenuItem = NSMenuItem(title: "", action: nil, keyEquivalent: "")
12
+ let appNameMenu = NSMenu(title: appName)
13
+ appNameMenu.addItemWithTitle("Quit \(appName)", action: #selector(terminate), keyEquivalent: "q")
14
+ appNameMenuItem.submenu = appNameMenu
15
+ mainMenu.addItem(appNameMenuItem)
16
+ NSApp.mainMenu = mainMenu
17
+
18
+ window = NSWindow(contentRect: NSMakeRect(240, 180, 480, 360),
19
+ styleMask: NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask,
20
+ backing: .Buffered,
21
+ defer: false)
22
+ window?.title = appName
23
+ window?.orderFrontRegardless()
24
+ }
25
+
26
+ // MARK - Actions
27
+ func terminate() {
28
+ NSApp.terminate(self)
29
+ }
30
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "images" : [
3
+ {
4
+ "idiom" : "mac",
5
+ "size" : "16x16",
6
+ "scale" : "1x"
7
+ },
8
+ {
9
+ "idiom" : "mac",
10
+ "size" : "16x16",
11
+ "scale" : "2x"
12
+ },
13
+ {
14
+ "idiom" : "mac",
15
+ "size" : "32x32",
16
+ "scale" : "1x"
17
+ },
18
+ {
19
+ "idiom" : "mac",
20
+ "size" : "32x32",
21
+ "scale" : "2x"
22
+ },
23
+ {
24
+ "idiom" : "mac",
25
+ "size" : "128x128",
26
+ "scale" : "1x"
27
+ },
28
+ {
29
+ "idiom" : "mac",
30
+ "size" : "128x128",
31
+ "scale" : "2x"
32
+ },
33
+ {
34
+ "idiom" : "mac",
35
+ "size" : "256x256",
36
+ "scale" : "1x"
37
+ },
38
+ {
39
+ "idiom" : "mac",
40
+ "size" : "256x256",
41
+ "scale" : "2x"
42
+ },
43
+ {
44
+ "idiom" : "mac",
45
+ "size" : "512x512",
46
+ "scale" : "1x"
47
+ },
48
+ {
49
+ "idiom" : "mac",
50
+ "size" : "512x512",
51
+ "scale" : "2x"
52
+ }
53
+ ],
54
+ "info" : {
55
+ "version" : 1,
56
+ "author" : "xcode"
57
+ }
58
+ }
@@ -0,0 +1,30 @@
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>CFBundleIconFile</key>
10
+ <string></string>
11
+ <key>CFBundleIdentifier</key>
12
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13
+ <key>CFBundleInfoDictionaryVersion</key>
14
+ <string>6.0</string>
15
+ <key>CFBundleName</key>
16
+ <string>$(PRODUCT_NAME)</string>
17
+ <key>CFBundlePackageType</key>
18
+ <string>APPL</string>
19
+ <key>CFBundleShortVersionString</key>
20
+ <string>1.0</string>
21
+ <key>CFBundleSignature</key>
22
+ <string>????</string>
23
+ <key>CFBundleVersion</key>
24
+ <string>1</string>
25
+ <key>LSMinimumSystemVersion</key>
26
+ <string>$(MACOSX_DEPLOYMENT_TARGET)</string>
27
+ <key>NSPrincipalClass</key>
28
+ <string>NSApplication</string>
29
+ </dict>
30
+ </plist>
@@ -0,0 +1,5 @@
1
+ import Cocoa
2
+
3
+ let delegate = AppDelegate()
4
+ NSApplication.sharedApplication().delegate = delegate
5
+ NSApplicationMain(Process.argc, Process.unsafeArgv);