fwtoolkit 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/fwt +42 -8
- data/lib/fwtoolkit/tasks/frank.rb +2 -2
- data/lib/fwtoolkit/version.rb +1 -1
- metadata +4 -4
data/bin/fwt
CHANGED
@@ -23,17 +23,21 @@ class FWT < Thor
|
|
23
23
|
|
24
24
|
@project = Xcodeproj::Project.new
|
25
25
|
@project.root_object.build_configuration_list
|
26
|
-
@project.add_system_framework('UIKit')
|
27
|
-
@project.add_system_framework('CoreGraphics') # bug in latest RestKit pod?
|
28
26
|
|
29
27
|
info_plist = "#{@app_name}-Info.plist"
|
30
28
|
process_template("Info.plist.erb", info_plist, supporting_files)
|
31
29
|
|
32
30
|
target = @project.new_target(:application, @app_name, :ios)
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
|
32
|
+
add_system_framework('UIKit')
|
33
|
+
add_system_framework('CoreGraphics')
|
34
|
+
|
35
|
+
add_build_settings_to_target({
|
36
|
+
'INFOPLIST_FILE' => "$(SRCROOT)/#{@app_name}/#{@app_name}-Info.plist",
|
37
|
+
'GCC_PREFIX_HEADER' => "#{@app_name}/#{@app_name}-Prefix.pch",
|
38
|
+
'SKIP_INSTALL' => 'NO',
|
39
|
+
'IPHONEOS_DEPLOYMENT_TARGET' => '6.0',
|
40
|
+
}, target)
|
37
41
|
|
38
42
|
app_d_h = process_template("AppDelegate.h.erb", "#{@prefix}AppDelegate.h")
|
39
43
|
app_d_m = process_template("AppDelegate.m.erb", "#{@prefix}AppDelegate.m")
|
@@ -54,18 +58,32 @@ class FWT < Thor
|
|
54
58
|
template 'templates/fwt/Podfile.erb', File.join(@path, 'Podfile')
|
55
59
|
template 'templates/fwt/gitignore.erb', File.join(@path, '.gitignore')
|
56
60
|
|
57
|
-
sleep
|
61
|
+
sleep 2 # flushing issues?
|
58
62
|
|
59
63
|
inside(@path) do
|
60
64
|
run "rvm gemset create #{@app_name}", {:capture => true}
|
61
65
|
run "rvm gemset use #{@app_name}", {:capture => true}
|
62
66
|
run 'bundle', {:capture => true}
|
63
|
-
run 'rake pod:clean_install', {:capture => true}
|
67
|
+
#run 'rake pod:clean_install', {:capture => true}
|
64
68
|
run "rake frank:setup['#{@app_name}','#{@prefix}']", {:capture => true}
|
65
69
|
end
|
66
70
|
end
|
67
71
|
|
68
72
|
private
|
73
|
+
def add_build_settings_to_target(map, target)
|
74
|
+
target.build_settings('Debug').merge! map
|
75
|
+
target.build_settings('Release').merge! map
|
76
|
+
|
77
|
+
puts target.build_settings('Debug')
|
78
|
+
end
|
79
|
+
|
80
|
+
def add_system_framework(name)
|
81
|
+
framework = @project.add_system_framework(name)
|
82
|
+
target = @project.targets.first
|
83
|
+
build_phase = target.frameworks_build_phase
|
84
|
+
build_phase.add_file_reference framework
|
85
|
+
end
|
86
|
+
|
69
87
|
def setup_cocoapods
|
70
88
|
unless Dir.exists?(File.join(Dir.home, '.cocoapods', 'fw'))
|
71
89
|
run 'gem install cocoapods', {:capture => true}
|
@@ -80,4 +98,20 @@ class FWT < Thor
|
|
80
98
|
|
81
99
|
end
|
82
100
|
|
101
|
+
module Xcodeproj
|
102
|
+
class Project
|
103
|
+
def add_system_framework(name)
|
104
|
+
path = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/System/Library/Frameworks/#{name}.framework"
|
105
|
+
if file = frameworks_group.files.select { |f| f.path == path }.first
|
106
|
+
file
|
107
|
+
else
|
108
|
+
framework_ref = frameworks_group.new_file(path)
|
109
|
+
framework_ref.name = "#{name}.framework"
|
110
|
+
framework_ref.source_tree = 'SDKROOT'
|
111
|
+
framework_ref
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
83
117
|
FWT.start
|
@@ -35,11 +35,11 @@ module FWToolkit
|
|
35
35
|
@models.each do |entity|
|
36
36
|
@model = entity
|
37
37
|
@class_name = class_name(@model)
|
38
|
-
factory_template = File.join 'models', 'model.rb.erb'
|
38
|
+
factory_template = File.join 'templates', 'models', 'model.rb.erb'
|
39
39
|
template(factory_template, File.join(output_dir, "#{class_name(@model).ruby_format}.rb"))
|
40
40
|
end
|
41
41
|
|
42
|
-
factory_template = File.join 'models', 'factories.rb.erb'
|
42
|
+
factory_template = File.join 'templates', 'models', 'factories.rb.erb'
|
43
43
|
template(factory_template, File.join(output_dir, 'factories.rb'))
|
44
44
|
end
|
45
45
|
|
data/lib/fwtoolkit/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fwtoolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cucumber
|
@@ -326,7 +326,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
326
326
|
version: '0'
|
327
327
|
segments:
|
328
328
|
- 0
|
329
|
-
hash:
|
329
|
+
hash: 4188321226862509111
|
330
330
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
331
331
|
none: false
|
332
332
|
requirements:
|
@@ -335,7 +335,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
335
335
|
version: '0'
|
336
336
|
segments:
|
337
337
|
- 0
|
338
|
-
hash:
|
338
|
+
hash: 4188321226862509111
|
339
339
|
requirements: []
|
340
340
|
rubyforge_project:
|
341
341
|
rubygems_version: 1.8.24
|