crafter 0.1.6 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec1865d0739ef829a9f23e761d112832a75f4ed7
4
- data.tar.gz: 999dcded8d33d3c4230dc8886667dd60a1f3e733
3
+ metadata.gz: 274618fe58464761e8ee8539c47f6ad7dd400b37
4
+ data.tar.gz: a6d9ccef4636ef3c4c6ad2f7e1c463ed8f6bcb45
5
5
  SHA512:
6
- metadata.gz: 58728b7bc622d37d2c2c5d45444fc95ee8f5d07d57f6b122b143a6a7d3ee041428538016b3674dfb32609a9b39f291b4b8e779aa22dad10f82c6c91d68684651
7
- data.tar.gz: 9851b9a5f383a3ca9d742aba66fdb1a041d5a1c5cdafcac3db8859783f081c4d1b941ad7a94c073ac103f7db6cefe4601da236b014b3670dd12ebf5496e481dd
6
+ metadata.gz: 717b547af092e49e332d8a32abbbd0fae446bcdc5e2b71fb0da427d3561cd01e7883f8e7c0090eafe2b18fd6a0bbb787d94b792eba0b12852ebbff2f290d2c27
7
+ data.tar.gz: 12b045dc54de32e15283da885dfdaf2524a9c5e0496f5a855263a9b5ca1051fbfebca56ed2d14d099f8f08075a4cea09584b4e980b9dfdd5e0ae7d4bbc4519de
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = 'crafter'
6
- gem.version = '0.1.6'
6
+ gem.version = '0.2'
7
7
  gem.authors = ['Krzysztof Zabłocki']
8
8
  gem.email = ['merowing2@gmail.com']
9
9
  gem.description = %q{CLI for setting up new Xcode projects. Inspired by thoughtbot liftoff.}
@@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
11
11
  gem.homepage = 'https://github.com/krzysztofzablocki/crafter'
12
12
  gem.license = 'MIT'
13
13
 
14
- gem.add_dependency 'xcodeproj', '~> 0.5.5'
14
+ gem.add_dependency 'xcodeproj', '~> 1.4'
15
15
  gem.add_dependency 'highline', '~> 1.6'
16
16
 
17
17
  gem.files = `git ls-files`.split($/)
@@ -4,9 +4,9 @@ load "#{Crafter::ROOT}/config/default_scripts.rb"
4
4
  Crafter.configure do
5
5
 
6
6
  # This are projects wide instructions
7
- add_platform({:platform => :ios, :deployment => 6.0})
7
+ add_platform({:platform => :ios, :deployment => 8.0})
8
8
  add_git_ignore
9
- duplicate_configurations({:adhoc => :debug, :profiling => :debug})
9
+ duplicate_configurations({:Adhoc => :Release})
10
10
 
11
11
  # set of options, warnings, static analyser and anything else normal xcode treats as build options
12
12
  set_options %w(
@@ -18,6 +18,7 @@ module Crafter
18
18
  @add_git_ignore = false
19
19
  @platforms = []
20
20
  @build_settings = {}
21
+ @language_swift = false
21
22
 
22
23
  def configure(&block)
23
24
  instance_eval &block
@@ -59,6 +60,10 @@ module Crafter
59
60
  @build_settings[configuration] = build_settings
60
61
  end
61
62
 
63
+ def set_language_swift(is_swift)
64
+ @language_swift = is_swift
65
+ end
66
+
62
67
  def setup_project
63
68
  process_optional()
64
69
  process_configurations() if @configuration && !@configuration.empty?
@@ -97,6 +102,10 @@ module Crafter
97
102
  puts 'preparing pod file'
98
103
  File.open('Podfile', File::WRONLY|File::CREAT|File::EXCL) do |f|
99
104
 
105
+ if @language_swift
106
+ f.puts "use_frameworks!"
107
+ end
108
+
100
109
  @platforms.each do |hash|
101
110
  name = hash[:platform]
102
111
  deployment = hash[:deployment]
@@ -119,7 +128,9 @@ module Crafter
119
128
  @targets.each { |_, v| v.process_scripts(self.project) }
120
129
  end
121
130
 
122
- if File.exists?(File.join(ENV['HOME'], '.crafter.rb')) then
131
+ if File.exists?(File.join('./', 'crafter.rb')) then
132
+ load './crafter.rb'
133
+ elsif File.exists?(File.join(ENV['HOME'], '.crafter.rb')) then
123
134
  load '~/.crafter.rb'
124
135
  else
125
136
  load "#{Crafter::ROOT}/config/default.rb"
@@ -22,33 +22,84 @@
22
22
  #WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
 
24
24
  GITIGNORE_CONTENTS = <<GITIGNORE
25
- # OS X Finder
25
+
26
+ #### Mac Finder specific (in case it's not elsewhere)
26
27
  .DS_Store
27
28
 
28
- # Xcode per-user config
29
- *.mode1
29
+
30
+ #### Xcode
31
+
32
+ # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
33
+
34
+ #### Build generated
35
+ build/
36
+ DerivedData/
37
+
38
+ #### Various settings
39
+ *.pbxuser
40
+ !default.pbxuser
30
41
  *.mode1v3
42
+ !default.mode1v3
31
43
  *.mode2v3
32
- *.perspective
44
+ !default.mode2v3
33
45
  *.perspectivev3
34
- *.pbxuser
35
- xcuserdata
46
+ !default.perspectivev3
47
+ xcuserdata/
36
48
 
37
- # Build products
38
- build/
39
- *.o
40
- *.LinkFileList
49
+ #### Other
50
+ *.moved-aside
51
+ *.xcuserstate
52
+
53
+ #### Obj-C/Swift specific
41
54
  *.hmap
55
+ *.ipa
56
+ *.dSYM.zip
57
+ *.dSYM
42
58
 
43
- # Automatic backup files
59
+ #### Automatic backup files
44
60
  *~.nib/
45
61
  *.swp
46
62
  *~
47
63
  *.dat
48
64
  *.dep
49
65
 
50
- # AppCode
51
- .idea
66
+
67
+ #### CocoaPods
68
+
69
+ # We recommend against adding the Pods directory to your .gitignore. However
70
+ # you should judge for yourself, the pros and cons are mentioned at:
71
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
72
+
73
+ Pods/
74
+
75
+
76
+ #### Carthage
77
+
78
+ # Add this line if you want to avoid checking in source code from Carthage dependencies.
79
+ # Carthage/Checkouts
80
+
81
+ # Carthage/Build
82
+
83
+
84
+ #### fastlane
85
+
86
+ # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
87
+ # screenshots whenever they are needed.
88
+ # For more information about the recommended setup visit:
89
+ # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
90
+
91
+ fastlane/report.xml
92
+ fastlane/Preview.html
93
+ fastlane/screenshots
94
+ fastlane/test_output
95
+
96
+
97
+ #### Code Injection
98
+
99
+ # After new code Injection tools there's a generated folder /iOSInjectionProject
100
+ # https://github.com/johnno1962/injectionforxcode
101
+
102
+ iOSInjectionProject/
52
103
 
53
104
  GITIGNORE
54
105
 
@@ -85,9 +136,8 @@ class GitHelper
85
136
  end
86
137
 
87
138
  new_contents = current_file_contents + contents.split("\n")
88
-
89
139
  File.open(filename, 'w') do |file|
90
140
  file.write(new_contents.uniq.join("\n"))
91
141
  end
92
142
  end
93
- end
143
+ end
@@ -5,7 +5,7 @@ class ProjectHelper
5
5
  PROJECTS = Dir.glob('*.xcodeproj')
6
6
 
7
7
  def initialize
8
- @project = Xcodeproj::Project.new(xcode_project_file)
8
+ @project = Xcodeproj::Project.open(xcode_project_file)
9
9
  end
10
10
 
11
11
  def enable_options(options)
@@ -110,6 +110,6 @@ class ProjectHelper
110
110
  end
111
111
 
112
112
  def save_changes
113
- @project.save_as xcode_project_file
113
+ @project.save xcode_project_file
114
114
  end
115
- end
115
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crafter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Zabłocki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-19 00:00:00.000000000 Z
11
+ date: 2017-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xcodeproj
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.5.5
19
+ version: '1.4'
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
- version: 0.5.5
26
+ version: '1.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: highline
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -75,9 +75,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  version: '0'
76
76
  requirements: []
77
77
  rubyforge_project:
78
- rubygems_version: 2.2.2
78
+ rubygems_version: 2.5.1
79
79
  signing_key:
80
80
  specification_version: 4
81
81
  summary: Define your craft rules once, then apply it to all your Xcode projects.
82
82
  test_files: []
83
- has_rdoc: