Skip to content

Commit

Permalink
Add Configurable Swift Version (#292)
Browse files Browse the repository at this point in the history
* Dependancy bump

* Swift version field

* Documentation
  • Loading branch information
Gonah committed Apr 4, 2018
1 parent bbb147d commit 1898d3f
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Gemfile
@@ -1,7 +1,7 @@
source 'https://rubygems.org'

group :dist do
gem 'xcodeproj', '~> 1.0'
gem 'xcodeproj', '~> 1.5.7'
gem 'highline', '~> 1.7'
end

Expand Down
16 changes: 9 additions & 7 deletions Gemfile.lock
@@ -1,12 +1,13 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.3.5)
CFPropertyList (3.0.0)
atomos (0.1.2)
claide (1.0.2)
colored2 (3.1.2)
diff-lcs (1.3)
highline (1.7.8)
nanaimo (0.2.3)
nanaimo (0.2.4)
rspec (3.7.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
Expand All @@ -20,19 +21,20 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.0)
xcodeproj (1.5.3)
CFPropertyList (~> 2.3.3)
xcodeproj (1.5.7)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.2)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.2.3)
nanaimo (~> 0.2.4)

PLATFORMS
ruby

DEPENDENCIES
highline (~> 1.7)
rspec
xcodeproj (~> 1.0)
xcodeproj (~> 1.5.7)

BUNDLED WITH
1.16.0
1.16.1
1 change: 1 addition & 0 deletions defaults/liftoffrc
Expand Up @@ -17,6 +17,7 @@ dependency_managers: cocoapods
enable_settings: true
strict_prompts: false
deployment_target: 8.0
swift_version: 4.0

run_script_phases:
- file: todo.sh
Expand Down
2 changes: 2 additions & 0 deletions lib/liftoff/project.rb
Expand Up @@ -3,6 +3,7 @@ class Project
def initialize(configuration)
@name = configuration.project_name
@deployment_target = configuration.deployment_target
@swift_version = configuration.swift_version
@test_target_name = configuration.test_target_name
set_company_name(configuration.company)
set_prefix(configuration.prefix)
Expand Down Expand Up @@ -97,6 +98,7 @@ def configure_base_project_settings
configuration.build_settings['ASSETCATALOG_COMPILER_APPICON_NAME'] = 'AppIcon'
configuration.build_settings['SDKROOT'] = 'iphoneos'
configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = @deployment_target.to_s
configuration.build_settings['SWIFT_VERSION'] = @swift_version.to_s
end
end

Expand Down
3 changes: 2 additions & 1 deletion lib/liftoff/project_configuration.rb
Expand Up @@ -22,7 +22,8 @@ class ProjectConfiguration
:extra_test_config,
:deployment_target,
:schemes,
:build_configurations
:build_configurations,
:swift_version

attr_writer :author,
:company_identifier,
Expand Down
7 changes: 7 additions & 0 deletions man/liftoffrc.5
Expand Up @@ -86,6 +86,13 @@ default:
.Ic 8.0
.Pp
Set the desired deployment target for this project.
.It Ic swift_version
type: float
.br
default:
.Ic 4.0
.Pp
Set the desired swift version for this project.
.It Ic configure_git
type: boolean
.br
Expand Down

0 comments on commit 1898d3f

Please sign in to comment.