Skip to content

Commit

Permalink
Merge branch 'master' into feature/migration-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
djbe authored May 22, 2017
2 parents 76bcec9 + 742b26a commit ca8c7ee
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ Due to the removal of legacy code, there are a few breaking changes in this new

### Bug Fixes

_None_
* Fix `snakeToCamelCase` parameters information in README.
[Liquidsoul](https://github.com/Liquidsoul)
[#45](https://github.com/SwiftGen/StencilSwiftKit/pulls/45)

### Breaking Changes

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* [String filters](Documentation/filters-strings.md):
* `escapeReservedKeywords`: Escape keywods reserved in the Swift language, by wrapping them inside backticks so that the can be used as regular escape keywords in Swift code.
* `lowerFirstWord`
* `snakeToCamelCase`: Transforms text from snake_case to camelCase. By default it keeps leading underscores, unless a single optional argument is set to "true", "no" or "0".
* `snakeToCamelCase`: Transforms text from snake_case to camelCase. By default it keeps leading underscores, unless a single optional argument is set to "true", "yes" or "1".
* `camelToSnakeCase`: Transforms text from camelCase to snake_case. By default it converts to lower case, unless a single optional argument is set to "false", "no" or "0".
* `swiftIdentifier`: Transforms an arbitrary string into a valid Swift identifier (using only valid characters for a Swift identifier as defined in the Swift language reference)
* `titlecase`
Expand Down
41 changes: 41 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,46 @@ SCHEME_NAME = 'Tests'
CONFIGURATION = 'Debug'
POD_NAME = 'StencilSwiftKit'

## [ Release a new version ] ##################################################

namespace :release do
desc 'Create a new release on CocoaPods'
task :new => [:check_versions, 'xcode:test', :cocoapods]

desc 'Check if all versions from the podspecs and CHANGELOG match'
task :check_versions do
results = []

# Check if bundler is installed first, as we'll need it for the cocoapods task (and we prefer to fail early)
`which bundler`
results << Utils.table_result($?.success?, 'Bundler installed', 'Please install bundler using `gem install bundler` and run `bundle install` first.')

# Extract version from podspec
podspec_version = Utils.podspec_version(POD_NAME)
Utils.table_info("#{POD_NAME}.podspec", podspec_version)

# Check if version in Podfile.lock matches
podfile_lock_version = Utils.podfile_lock_version(POD_NAME)
results << Utils.table_result(podfile_lock_version == podspec_version, "Podfile.lock", "Please run pod install")

# Check if entry present in CHANGELOG
changelog_entry = system(%Q{grep -q '^## #{Regexp.quote(podspec_version)}$' CHANGELOG.md})
results << Utils.table_result(changelog_entry, "CHANGELOG, Entry added", "Please add an entry for #{podspec_version} in CHANGELOG.md")

changelog_master = system(%q{grep -qi '^## Master' CHANGELOG.md})
results << Utils.table_result(!changelog_master, "CHANGELOG, No master", 'Please remove entry for master in CHANGELOG')

exit 1 unless results.all?

print "Release version #{podspec_version} [Y/n]? "
exit 2 unless (STDIN.gets.chomp == 'Y')
end

desc "pod trunk push #{POD_NAME} to CocoaPods"
task :cocoapods do
Utils.print_header "Pushing pod to CocoaPods Trunk"
sh "bundle exec pod trunk push #{POD_NAME}.podspec"
end
end

task :default => 'xcode:test'

0 comments on commit ca8c7ee

Please sign in to comment.