Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

releasinate card.io #75

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Required Information

- card.io-iOS-SDK Version (call `[CardIOView libraryVersion]`):
- iOS version and device:

### Issue Description
> Please include as many details (logs, steps to reproduce, screenshots) as you can to help us reproduce this issue faster.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ icc.xcodeproj/project.xcworkspace/xcuserdata/*
/Release/SampleApp/ScanExample.xcodeproj/xcuserdata/
/Release/SampleApp-Swift/SampleApp-Swift.xcodeproj/project.xcworkspace/
/Release/SampleApp-Swift/SampleApp-Swift.xcodeproj/xcuserdata/
# releasinator
downstream_repos/
card.io_ios_sdk_*/
136 changes: 136 additions & 0 deletions .releasinator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
#### releasinator config ####
configatron.product_name = "card.io iOS SDK "

# The directory where all distributed docs are. Default is '.'
configatron.base_docs_dir = 'Release'

configatron.release_to_github = false

configatron.use_git_flow = true

# List of items to confirm from the person releasing. Required, but empty list is ok.
configatron.prerelease_checklist_items = [
"Test on a device in release mode",
"Check the header files.",
"Sanity check the develop branch.",
]

def no_task(version="")
end

def podspec_version()
File.open("Release/CardIO.podspec", 'r') do |f|
f.each_line do |line|
if line.match (/spec.version\s*=\s*'\d*\.\d*\.\d*'/)
return line.strip.split('\'')[1]
end
end
end
return 0
end

def validate_podspec_version()
if podspec_version() != @current_release.version
Printer.fail("podspec version #{podspec_version()} does not match changelog version #{@current_release.version}.")
abort()
end
Printer.success("podspec version #{podspec_version()} matches latest changelog version #{@current_release.version}.")
end

def validate_paths()
@validator.validate_in_path("pip")
@validator.validate_in_path("virtualenv")
@validator.validate_in_path("type mkvirtualenv")
end

# Custom validation methods. Optional.
configatron.custom_validation_methods = [
method(:validate_paths),
method(:validate_podspec_version)
]

# build process moved to releasinator.sh file
def build_cardio()
CommandProcessor.command("VERSION=#{@current_release.version} ./releasinator.sh", live_output=true)
end

# The method that builds the sdk. Required.
configatron.build_method = method(:build_cardio)

# steps to push cocoapods moved after downstreamrepo code push
def publish_to_cocoapods()
command = "cd downstream_repos/card.io-iOS-SDK;"
command += "pod trunk push CardIO.podspec"

CommandProcessor.command(command, live_output=true)
end

# The method that publishes the sdk to the package manager. Required.
configatron.publish_to_package_manager_method = method(:no_task)

def wait_for_cocoapods()
CommandProcessor.wait_for("wget -U \"non-empty-user-agent\" -qO- https://github.com/CocoaPods/Specs/blob/master/Specs/CardIO/#{podspec_version()}/CardIO.podspec.json | cat")
end

# the method that waits for published artifact
configatron.wait_for_package_manager_method = method(:no_task)

def add_content_to_file (filepath, location, new_content)
require 'fileutils'
tempfile=File.open("file.tmp", 'w')
File.open(filepath, 'r') do |f|
f.each_line do |line|
tempfile<<line
if line.strip == location.strip
tempfile << new_content
end
end
end
tempfile.close
FileUtils.mv("file.tmp", filepath)
end

def update_cordova_plugin_release_notes(new_version)
current_changelog = @current_release.changelog.dup
add_content_to_file("CHANGELOG.md", "===================================", "TODO\n-----\n" + (current_changelog.gsub! /^\*/,'* iOS:')+"\n\n")
end

def build_app()
CommandProcessor.command("pod lib lint", live_output=true)
end

# Distribution GitHub repo if different from the source repo. Optional.
configatron.downstream_repos = [
DownstreamRepo.new(
name="card.io-iOS-SDK",
url="git@github.com:card-io/card.io-iOS-SDK.git",
branch="master",
:release_to_github => true,
:full_file_sync => false,
:files_to_copy => [
CopyFile.new("card.io_ios_sdk_#{podspec_version}*/*", ".", ".")
],
:build_methods => [
method(:build_app)
]
),
DownstreamRepo.new(
name="card.io-Cordova-Plugin",
url="git@github.com:card-io/card.io-Cordova-Plugin.git",
branch="master",
:full_file_sync => false,
:release_to_github => true,
:new_branch_name => "ios-__VERSION__",
:files_to_copy => [
CopyFile.new("card.io_ios_sdk_#{podspec_version}\*/CardIO/*", ".", "src/ios/CardIO")
],
:post_copy_methods => [
method(:update_cordova_plugin_release_notes)
]
)
]

task :"local:push" do
publish_to_cocoapods()
wait_for_cocoapods()
end
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ General Guidelines
------------------

* **Code style.** Please follow local code style. Ask if you're unsure. Python code should conform to PEP8.
* **No warnings.** All generated code must compile without warnings. All generated code must pass the static analyzer. All python code must run without warnings.
* **No warnings.** All code must compile without warnings. All code must pass the static analyzer. All python code must run without warnings.
* **iOS version support.** The library should support one major iOS version back. E.g., if iOS 8.x is the newest version of iOS, then the code should build and run correctly in an app targeting and deployed on iOS 7.x.
* **Architecture support.** The library should support armv7, armv7s, arm64, i386 and x86_64.
* **ARC agnostic.** No code that depends on the presence or absence of ARC should appear in public header files.
* **No logging in Release builds.** Always use the `CardIOLog()` macro rather than `NSLog()`.
* **Testing.** Test both with the `icc` demo app, and with the included `ScanExample` sample app. Test both on the iOS simulator and on at least one physical device.
2 changes: 1 addition & 1 deletion CardIO_Public_API/CardIOPaymentViewControllerDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
/// @param paymentViewController The active CardIOPaymentViewController.
- (void)userDidProvideCreditCardInfo:(CardIOCreditCardInfo *)cardInfo inPaymentViewController:(CardIOPaymentViewController *)paymentViewController;

@end
@end
2 changes: 1 addition & 1 deletion CardIO_Public_API/CardIOViewDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
/// @note cardInfo will be nil if exiting due to a problem (e.g., no available camera).
- (void)cardIOView:(CardIOView *)cardIOView didScanCard:(CardIOCreditCardInfo *)cardInfo;

@end
@end
2 changes: 1 addition & 1 deletion Classes/CardIOBundle.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
- (BOOL)passesSelfTest:(NSError **)error;
#endif

@end
@end
2 changes: 1 addition & 1 deletion Classes/CardIOCameraView.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@

@end

#endif
#endif
2 changes: 1 addition & 1 deletion Classes/CardIONumbersTextFieldDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

- (BOOL)cleanupTextField:(UITextField *)textField;

@end
@end
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

gem 'releasinator', '~> 0.6'
gem 'cocoapods'
92 changes: 92 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.6)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
claide (1.0.0)
cocoapods (1.0.1)
activesupport (>= 4.0.2)
claide (>= 1.0.0, < 2.0)
cocoapods-core (= 1.0.1)
cocoapods-deintegrate (>= 1.0.0, < 2.0)
cocoapods-downloader (>= 1.0.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.0.0, < 2.0)
cocoapods-try (>= 1.0.0, < 2.0)
colored (~> 1.2)
escape (~> 0.0.4)
fourflusher (~> 0.3.0)
molinillo (~> 0.4.5)
nap (~> 1.0)
xcodeproj (>= 1.1.0, < 2.0)
cocoapods-core (1.0.1)
activesupport (>= 4.0.2)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.0)
cocoapods-downloader (1.0.0)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.0.0)
nap (>= 0.8, < 2.0)
netrc (= 0.7.8)
cocoapods-try (1.0.0)
colored (1.2)
colorize (0.8.1)
configatron (4.5.0)
escape (0.0.4)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
fourflusher (0.3.1)
fuzzy_match (2.0.4)
github-markup (1.4.0)
i18n (0.7.0)
json (1.8.3)
minitest (5.8.3)
molinillo (0.4.5)
multipart-post (2.0.0)
nap (1.1.0)
netrc (0.7.8)
octokit (4.3.0)
sawyer (~> 0.7.0, >= 0.5.3)
redcarpet (3.3.4)
releasinator (0.6.0)
colorize (~> 0.7)
configatron (~> 4.5)
json (~> 1.8)
octokit (~> 4.0)
semantic (~> 1.4)
vandamme (~> 0.0.11)
sawyer (0.7.0)
addressable (>= 2.3.5, < 2.5)
faraday (~> 0.8, < 0.10)
semantic (1.4.1)
thread_safe (0.3.5)
tzinfo (1.2.2)
thread_safe (~> 0.1)
vandamme (0.0.11)
github-markup (~> 1.3)
redcarpet (~> 3.3.2)
xcodeproj (1.1.0)
activesupport (>= 3)
claide (>= 1.0.0, < 2.0)
colored (~> 1.2)

PLATFORMS
ruby

DEPENDENCIES
cocoapods
releasinator (~> 0.6)

BUNDLED WITH
1.11.2
23 changes: 23 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
All files are released under the MIT License:

The MIT License (MIT)

Copyright (c) 2013-2016 PayPal Holdings, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
22 changes: 0 additions & 22 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,23 +1 @@
All files are released under the MIT License:

The MIT License (MIT)

Copyright (c) 2013-2016 PayPal Holdings, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ Contributors
Subsequent help has come from [Brent Fitzgerald](https://github.com/burnto/), [Tom Whipple](https://github.com/tomwhipple), [Dave Goldman](https://github.com/dgoldman-ebay), [Roman Punskyy](https://github.com/romk1n), [Mark Rogers](https://github.com/mgroger2), and [Martin Rybak](https://github.com/martinrybak).

And from **you**! Pull requests and new issues are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for details.

## License
Code released under [MIT LICENSE](LICENSE)
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
spec = Gem::Specification.find_by_name 'releasinator'
load "#{spec.gem_dir}/lib/tasks/releasinator.rake"
7 changes: 7 additions & 0 deletions Release/.github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Required Information

- card.io-iOS-SDK Version (call `[CardIOView libraryVersion]`):
- iOS version and device:

### Issue Description
> Please include as many details (logs, steps to reproduce, screenshots) as you can to help us reproduce this issue faster.
17 changes: 17 additions & 0 deletions Release/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
build/
icc.xcodeproj/xcuserdata/*
icc.xcodeproj/project.xcworkspace/xcuserdata/*
.DS_Store
**/*.pbxuser
*.pyc
.baler_env
/icc.xcodeproj/project.xcworkspace/xcshareddata/
/icc.xcodeproj/project.xcworkspace/xcshareddata/icc.xccheckout
/Classes/CardIOIccVersion.h
/Release/SampleApp/ScanExample.xcodeproj/project.xcworkspace/
/Release/SampleApp/ScanExample.xcodeproj/xcuserdata/
/Release/SampleApp-Swift/SampleApp-Swift.xcodeproj/project.xcworkspace/
/Release/SampleApp-Swift/SampleApp-Swift.xcodeproj/xcuserdata/
# releasinator
downstream_repos/
card.io_ios_sdk_*/
Loading