fwtoolkit 0.9.3 → 1.0.1

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.
Files changed (130) hide show
  1. checksums.yaml +8 -8
  2. data/bin/fwt +2 -112
  3. data/features/cocoapods/setup.feature +60 -0
  4. data/features/frank/model.feature +20 -0
  5. data/features/frank/setup.feature +28 -0
  6. data/features/git/create.feature +29 -0
  7. data/features/project/create.feature +25 -0
  8. data/features/step_definitions/aruba_steps.rb +11 -0
  9. data/features/step_definitions/git_steps.rb +30 -0
  10. data/features/step_definitions/project_steps.rb +50 -0
  11. data/features/step_definitions/rvm_steps.rb +11 -0
  12. data/features/step_definitions/system_steps.rb +8 -0
  13. data/features/support/env.rb +23 -0
  14. data/features/support/lib_test/aruba_fwt.rb +30 -0
  15. data/features/support/lib_test/aruba_mod.rb +28 -0
  16. data/features/support/lib_test/fake_gem.rb +47 -0
  17. data/features/xcode/create.feature +42 -0
  18. data/lib/fwtoolkit/cli/bootstrap.rb +75 -0
  19. data/lib/fwtoolkit/cli/ci.rb +52 -0
  20. data/lib/fwtoolkit/cli/cocoapods.rb +73 -0
  21. data/lib/fwtoolkit/cli/ext/thor.rb +35 -0
  22. data/lib/fwtoolkit/cli/frank.rb +113 -0
  23. data/lib/fwtoolkit/cli/fw_actions/template_dir.rb +59 -0
  24. data/lib/fwtoolkit/cli/fw_actions.rb +2 -0
  25. data/lib/fwtoolkit/cli/git.rb +42 -0
  26. data/lib/fwtoolkit/cli/ota.rb +109 -0
  27. data/lib/fwtoolkit/cli/ota_client/hockeyapp_client.rb +70 -0
  28. data/lib/fwtoolkit/cli/project.rb +83 -0
  29. data/lib/fwtoolkit/cli/thorutils.rb +14 -0
  30. data/lib/fwtoolkit/cli/xcode.rb +105 -0
  31. data/lib/fwtoolkit/cli.rb +27 -36
  32. data/lib/fwtoolkit/config/config.sample +8 -0
  33. data/lib/fwtoolkit/config.rb +41 -0
  34. data/lib/fwtoolkit/configfile.rb +36 -0
  35. data/lib/fwtoolkit/executable/executable.rb +45 -0
  36. data/lib/fwtoolkit/executable.rb +1 -0
  37. data/lib/fwtoolkit/ext/gem.rb +9 -0
  38. data/lib/fwtoolkit/ext/hash_yaml.rb +17 -0
  39. data/lib/fwtoolkit/git_client/git_client.rb +225 -0
  40. data/lib/fwtoolkit/git_client.rb +1 -0
  41. data/lib/fwtoolkit/projectfile.rb +50 -0
  42. data/lib/fwtoolkit/rake/ext/rake.rb +7 -0
  43. data/lib/fwtoolkit/rake/tasks/ci.rb +25 -0
  44. data/lib/fwtoolkit/rake/tasks/config.rb +13 -0
  45. data/lib/fwtoolkit/rake/tasks/ota.rb +31 -0
  46. data/lib/fwtoolkit/rake/tasks/project.rb +28 -0
  47. data/lib/fwtoolkit/rake/tasks/test.rb +59 -0
  48. data/lib/fwtoolkit/rake/tasks/xcode.rb +69 -0
  49. data/lib/fwtoolkit/rake/tasks.rb +20 -0
  50. data/lib/fwtoolkit/version.rb +1 -1
  51. data/lib/fwtoolkit.rb +4 -7
  52. data/spec/git_client_spec.rb +316 -0
  53. data/spec/project_config_spec.rb +40 -0
  54. data/spec/rake/project.rb +28 -0
  55. data/spec/rake/test.rb +85 -0
  56. data/spec/rake/xcode.rb +66 -0
  57. data/spec/support/aruba-doubles-rspec.rb +21 -0
  58. data/spec/support/ctx_rake.rb +23 -0
  59. data/spec/support/double_helper.rb +13 -0
  60. data/spec/support/project_generator.rb +45 -0
  61. data/templates/default_project/frank/%project_name%/%target_name%/%class_prefix%AppDelegate+Frank.h.tt +15 -0
  62. data/templates/{cucumber/AppDelegate+Frank.m.erb → default_project/frank/%project_name%/%target_name%/%class_prefix%AppDelegate+Frank.m.tt} +25 -21
  63. data/templates/{cucumber → default_project/frank/%project_name%/Frank}/features/example.feature +0 -0
  64. data/templates/{cucumber → default_project/frank/%project_name%/Frank}/features/step_definitions/launch_steps.rb +0 -0
  65. data/templates/{cucumber → default_project/frank/%project_name%/Frank}/features/support/env.rb +0 -0
  66. data/templates/{cucumber → default_project/frank/%project_name%/Frank}/features/support/mimic.rb +0 -0
  67. data/templates/default_project/frank/~template_config.rb +11 -0
  68. data/templates/default_project/frank_seed_core_data/%project_name%/Frank/features/support/models/%class_name%.rb.tt +30 -0
  69. data/templates/default_project/frank_seed_support/%project_name%/Frank/features/support/models/factories.rb.tt +10 -0
  70. data/templates/{cucumber → default_project/frank_seed_support/%project_name%/Frank}/features/support/views/my_objects_json.erb +0 -0
  71. data/templates/{cucumber → default_project/frank_seed_support/%project_name%/Frank}/features/support/views/my_objects_xml.erb +0 -0
  72. data/templates/{fwt/gitignore.erb → default_project/git/.gitignore} +0 -0
  73. data/templates/{fwt/rvmrc.erb → default_project/rvm/.rvmrc.tt} +2 -2
  74. data/templates/default_project/rvm/Gemfile +4 -0
  75. data/templates/default_project/xcode/%project_name%/%project_name%.xcodeproj/project.pbxproj.tt +583 -0
  76. data/templates/default_project/xcode/%project_name%/%project_name%.xcodeproj/project.xcworkspace/contents.xcworkspacedata.tt +7 -0
  77. data/templates/default_project/xcode/%project_name%/%project_name%.xcodeproj/xcshareddata/xcschemes/%project_name%-Release.xcscheme.tt +105 -0
  78. data/templates/default_project/xcode/%project_name%/%project_name%.xcodeproj/xcshareddata/xcschemes/%project_name%-Testing.xcscheme.tt +105 -0
  79. data/templates/default_project/xcode/%project_name%/%project_name%.xcodeproj/xcshareddata/xcschemes/%project_name%.xcscheme.tt +105 -0
  80. data/templates/default_project/xcode/%project_name%/%target_name%/%class_prefix%AppDelegate.h.tt +15 -0
  81. data/templates/default_project/xcode/%project_name%/%target_name%/%class_prefix%AppDelegate.m.tt +49 -0
  82. data/templates/{fwt/default_project/Info.plist.erb → default_project/xcode/%project_name%/%target_name%/Supporting Files/%project_name%-Info.plist} +0 -0
  83. data/templates/default_project/xcode/%project_name%/%target_name%/Supporting Files/%project_name%-Prefix.pch.tt +14 -0
  84. data/templates/default_project/xcode/%project_name%/%target_name%/Supporting Files/Settings.bundle/Root.plist +53 -0
  85. data/templates/default_project/xcode/%project_name%/%target_name%/Supporting Files/Settings.bundle/en.lproj/Root.strings +0 -0
  86. data/templates/default_project/xcode/%project_name%/%target_name%/Supporting Files/en.lproj/InfoPlist.strings +2 -0
  87. data/templates/default_project/xcode/%project_name%/%target_name%/Supporting Files/fw-shared.xcconfig +49 -0
  88. data/templates/default_project/xcode/%project_name%/%target_name%/Supporting Files/info.plist.h.tt +8 -0
  89. data/templates/default_project/xcode/%project_name%/%target_name%/Supporting Files/main.m.tt +18 -0
  90. data/templates/default_project/xcode/%project_name%/%target_name%/Supporting Files/version.sh +159 -0
  91. data/templates/default_project/xcode/%project_name%/%tests_target_name%/%project_name%Tests.h.tt +13 -0
  92. data/templates/default_project/xcode/%project_name%/%tests_target_name%/%project_name%Tests.m.tt +32 -0
  93. data/templates/default_project/xcode/%project_name%/%tests_target_name%/Supporting Files/%tests_target_name%-Info.plist +22 -0
  94. data/templates/default_project/xcode/%project_name%/%tests_target_name%/Supporting Files/en.lproj/InfoPlist.strings +2 -0
  95. data/templates/default_project/xcode/%project_name%/Default.png +0 -0
  96. data/templates/default_project/xcode/%project_name%/Resources/Default-568h@2x.png +0 -0
  97. data/templates/default_project/xcode/%project_name%/Resources/Default.png +0 -0
  98. data/templates/default_project/xcode/%project_name%/Resources/Default@2x.png +0 -0
  99. data/templates/default_project/xcode/%project_name%.xcworkspace/contents.xcworkspacedata.tt +7 -0
  100. data/templates/default_project/xcode/FWProjectfile.tt +14 -0
  101. data/templates/default_project/xcode/Podfile.tt +4 -0
  102. data/templates/default_project/xcode/Rakefile.tt +14 -0
  103. data/templates/default_project/xcode/cruise_config.rb +3 -0
  104. data/templates/default_project/xcode/~template_config.rb +5 -0
  105. metadata +187 -141
  106. data/lib/fwtoolkit/tasks/build.rb +0 -121
  107. data/lib/fwtoolkit/tasks/ci.rb +0 -30
  108. data/lib/fwtoolkit/tasks/cocoapods.rb +0 -32
  109. data/lib/fwtoolkit/tasks/frank.rb +0 -119
  110. data/lib/fwtoolkit/tasks/helper.rb +0 -16
  111. data/lib/fwtoolkit/tasks/services.rb +0 -41
  112. data/lib/fwtoolkit/tasks.rb +0 -24
  113. data/lib/fwtoolkit/test/frank_model.rb +0 -120
  114. data/lib/fwtoolkit/test/misc_steps.rb +0 -9
  115. data/lib/fwtoolkit/test/model_helper.rb +0 -94
  116. data/lib/fwtoolkit/test/network_steps.rb +0 -60
  117. data/lib/fwtoolkit/test/pickle_steps.rb +0 -101
  118. data/lib/fwtoolkit/test/timeout_helper.rb +0 -21
  119. data/lib/fwtoolkit/test/ui_helper.rb +0 -19
  120. data/lib/fwtoolkit/test/ui_steps.rb +0 -17
  121. data/templates/cucumber/AppDelegate+Frank.h.erb +0 -15
  122. data/templates/fwt/Gemfile.erb +0 -3
  123. data/templates/fwt/Podfile.erb +0 -4
  124. data/templates/fwt/Rakefile.erb +0 -24
  125. data/templates/fwt/default_project/AppDelegate.h.erb +0 -12
  126. data/templates/fwt/default_project/AppDelegate.m.erb +0 -20
  127. data/templates/fwt/default_project/Prefix.pch.erb +0 -6
  128. data/templates/fwt/default_project/main.m.erb +0 -15
  129. data/templates/models/factories.rb.erb +0 -10
  130. data/templates/models/model.rb.erb +0 -30
@@ -0,0 +1,159 @@
1
+ #!/bin/sh
2
+
3
+ # Script for managing build and version numbers using git and agvtool.
4
+
5
+ # Change log:
6
+ # v1.0 18-Jul-11 First public release.
7
+
8
+ version() {
9
+ echo "version.sh 1.0 by Joachim Bondo <osteslag@gmail.com> http://osteslag.tumblr.com"
10
+ }
11
+
12
+ usage() {
13
+ version
14
+ cat << EOF >&2
15
+
16
+ Manages build and version numbers using git and agvtool.
17
+
18
+ Usage:
19
+ $(basename $0) [options]
20
+
21
+ Options:
22
+ --terse Prints the version number in the terse format
23
+ -s, --set Sets the version number using agvtool
24
+ -p, --plist-path <path> Write to the built Info.plist file directly
25
+ -b, --bump Bumps the build number
26
+ -q, --quiet Supresses output
27
+ -h, --help Displays this help text
28
+ -v, --version Displays script version number
29
+
30
+ Notes:
31
+ - If no options are given, the current versions are printed
32
+ - Specifying -s requires a --plist-path and uses the git tag
33
+ EOF
34
+ }
35
+
36
+ list() {
37
+
38
+ # List current project version and git version. Ignore $should_echo_output.
39
+ # If the --terse option is given, make the output terse.
40
+
41
+ # Add --abbrev=0 to reduce to latest git tag only (without commit count and SAH):
42
+ git_version=`git describe --tags`
43
+ git_version=`git describe --tags`
44
+ if [ -z "$git_version" ]; then
45
+ git_version="dev-"`git rev-parse --short HEAD`
46
+ fi
47
+ build_number=`agvtool what-version -terse`
48
+
49
+ if [ $# == 1 ]; then
50
+ echo "${git_version} (${build_number})"
51
+ else
52
+ echo "Version: ${git_version} (${build_number})"
53
+ fi
54
+ }
55
+
56
+ bump() {
57
+
58
+ # Bumps the build number, i.e. the number in parenthesis.
59
+
60
+ # Don't print the output of the command itself.
61
+ agvtool bump -all &> /dev/null
62
+ new_version=`agvtool what-version -terse`
63
+ if [ $should_echo_output == true ]; then
64
+ echo "Bumped build number to: ${new_version}"
65
+ fi
66
+ }
67
+
68
+ set_version() {
69
+
70
+ # Set the marketing version of the project.
71
+ # Take the number from git and apply it to the project.
72
+ # Any "v" prepended to the git tag will be removed.
73
+
74
+ # Get the current release description from git.
75
+ git_version=`git describe --tags`
76
+
77
+ # Check to see if the tag starts with with "v", and remove if so.
78
+ if [[ "${git_version}" == v* ]]; then
79
+ git_version="${git_version#*v}"
80
+ fi
81
+
82
+ # Set the project version.
83
+
84
+ # If we use agvtool for this, and this script runs as a build phase, Xcode
85
+ # insists on reloading the project file which is undesired. But if run from
86
+ # the command line, it makes good sense. If plist_path is not empty, we'll
87
+ # set the version number in it directly.
88
+
89
+ if [ -z "$1" ]; then
90
+ agvtool new-marketing-version "${git_version}" &> /dev/null
91
+ new_version=`agvtool what-marketing-version -terse1`
92
+ else
93
+ # Remove the (.plist) extension from the path.
94
+ defaults write "${1%.*}" 'CFBundleShortVersionString' "${git_version}" &> /dev/null
95
+ new_version=`defaults read "${1%.*}" 'CFBundleShortVersionString'`
96
+ fi
97
+
98
+ if [ $should_echo_output == true ]; then
99
+ echo "New version: ${new_version}"
100
+ fi
101
+
102
+ }
103
+
104
+ # --- Main entry point --------------------------------------------------------
105
+
106
+ # If we don't have any options, just list versions, or if terse, list terse.
107
+ if [ $# == 0 ]; then
108
+ list
109
+ exit 0
110
+ elif [ $# == 1 -a $1 == --terse ]; then
111
+ list --terse
112
+ exit 0
113
+ fi
114
+
115
+ # Set default values.
116
+ should_set_version_number=false
117
+ plist_path=""
118
+ should_echo_output=true
119
+
120
+ # Parse command line options.
121
+ while [ $# -gt 0 ]; do
122
+ # Check parameters.
123
+ case $1 in
124
+ -s | --set )
125
+ should_set_version_number=true
126
+ ;;
127
+ -p | --plist-path )
128
+ plist_path=$2
129
+ shift;;
130
+ -b | --bump )
131
+ bump
132
+ ;;
133
+ -q | --quiet )
134
+ should_echo_output=false
135
+ ;;
136
+ -h | --help )
137
+ usage
138
+ exit 1;;
139
+ -v | --version )
140
+ version
141
+ exit 1;;
142
+ * ) # Unknown option
143
+ echo "Error: Unknown option '$1'" 1>&2
144
+ usage
145
+ exit 1;;
146
+ esac
147
+ shift
148
+ done
149
+
150
+ if [ $should_set_version_number == true ]; then
151
+ if [ ! -e "$plist_path" ]; then
152
+ echo "Error: File does not exist '$plist_path'. Specify a valid --plist-path." 1>&2
153
+ exit 1
154
+ else
155
+ set_version "$plist_path"
156
+ fi
157
+ fi
158
+
159
+ exit 0
@@ -0,0 +1,13 @@
1
+ //
2
+ // __project_name__Tests.h
3
+ // <%= config[:project_name] %>Tests
4
+ //
5
+ // Created by <%= config[:project_creator] %> on 06/02/2013.
6
+ // Copyright (c) 2013 <%= config[:organization_name] %>. All rights reserved.
7
+ //
8
+
9
+ #import <SenTestingKit/SenTestingKit.h>
10
+
11
+ @interface <%= config[:project_name] %>Tests : SenTestCase
12
+
13
+ @end
@@ -0,0 +1,32 @@
1
+ //
2
+ // __project_name__Tests.m
3
+ // <%= config[:project_name] %>Tests
4
+ //
5
+ // Created by <%= config[:project_creator] %> on 06/02/2013.
6
+ // Copyright (c) 2013 <%= config[:organization_name] %>. All rights reserved.
7
+ //
8
+
9
+ #import "<%= config[:project_name] %>Tests.h"
10
+
11
+ @implementation <%= config[:project_name] %>Tests
12
+
13
+ - (void)setUp
14
+ {
15
+ [super setUp];
16
+
17
+ // Set-up code here.
18
+ }
19
+
20
+ - (void)tearDown
21
+ {
22
+ // Tear-down code here.
23
+
24
+ [super tearDown];
25
+ }
26
+
27
+ - (void)testExample
28
+ {
29
+ STFail(@"Unit tests are not implemented yet in <%= config[:project_name] %>Tests");
30
+ }
31
+
32
+ @end
@@ -0,0 +1,22 @@
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>com.futureworkshops.company-identifier.${PRODUCT_NAME:rfc1034identifier}</string>
11
+ <key>CFBundleInfoDictionaryVersion</key>
12
+ <string>6.0</string>
13
+ <key>CFBundlePackageType</key>
14
+ <string>BNDL</string>
15
+ <key>CFBundleShortVersionString</key>
16
+ <string>1.0</string>
17
+ <key>CFBundleSignature</key>
18
+ <string>????</string>
19
+ <key>CFBundleVersion</key>
20
+ <string>1</string>
21
+ </dict>
22
+ </plist>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ <FileRef
5
+ location = "group:<%= config[:project_name] %>/<%= config[:project_name] %>.xcodeproj">
6
+ </FileRef>
7
+ </Workspace>
@@ -0,0 +1,14 @@
1
+ project_name: <%= config[:project_name] %> # required
2
+ class_prefix: <%= config[:class_prefix] %> # required
3
+ # target_name: <%= config[:target_name] %> # default: project_name
4
+ # binary_name: <%= config[:binary_name] %> # default: project_name
5
+ # xcode_scheme:
6
+ # develop:<%= config[:xcode_scheme][:dev] %> # default: project_name
7
+ # testing:<%= config[:xcode_scheme][:testing] %> # default: project_name-Testing
8
+ # release:<%= config[:xcode_scheme][:release] %> # default: project_name-Release
9
+ # tests_target_name: <%= config[:tests_target_name] %> # default: project_nameTests
10
+ # xcode_workspace: <%= config[:xcode_workspace] %> # default: [project_root]/project_name.xcworkspace
11
+ # xcode_project: <%= config[:xcode_project] %> # default: [project_root]/project_name/project_name.xcproj
12
+ # source_root: <%= config[:source_root] %> # default: [project_root]/project_name/target_name/
13
+ # tests_source_root: <%= config[:tests_source_root] %> # default: [project_root]/project_name/tests_target_name/
14
+ # frank_root: <%= config[:frank_root] %> # default: [project_root]/project_name/target_name/Frank
@@ -0,0 +1,4 @@
1
+ xcodeproj '<%= File.join(config[:project_name], "#{config[:project_name]}.xcodeproj")%>'
2
+ platform :ios, '<%= config[:target_platform]%>'
3
+
4
+ pod 'RestKit', '~> 0.20.rc1'
@@ -0,0 +1,14 @@
1
+ require 'fwtoolkit/tasks'
2
+
3
+ FWToolkit::Rake.new_all
4
+
5
+ namespace :services do
6
+ task :seed do
7
+ # define any seeds to use with rake services:run here
8
+ # t = TestObject.new
9
+ # t.save!
10
+ end
11
+ end
12
+
13
+ task :cruise => ["test:ci:frank"]
14
+ task :default => ["cruise"]
@@ -0,0 +1,3 @@
1
+ Project.configure do |project|
2
+ #project.email_notifier.emails << ['dev@futureworkshops.com']
3
+ end
@@ -0,0 +1,5 @@
1
+ require 'fileutils'
2
+
3
+ project_config do |destination_root, config|
4
+ FileUtils.chmod 0755, File.join(destination_root, config[:project_name], config[:project_name], 'Supporting Files', 'version.sh')
5
+ end