diff --git a/.gitignore b/.gitignore index 9f332f5..234fc00 100644 --- a/.gitignore +++ b/.gitignore @@ -62,7 +62,6 @@ Carthage/Build # For more information about the recommended setup visit: # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md -fastlane fastlane/report.xml fastlane/Preview.html fastlane/screenshots diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..4ba17fd --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: objective-c +osx_image: xcode8.2 +script: + - ./fastlane/travis.sh diff --git a/Cartfile b/Cartfile index bd33c11..7abfe60 100644 --- a/Cartfile +++ b/Cartfile @@ -1,6 +1,6 @@ github "SVProgressHUD/SVProgressHUD" github "radex/SwiftyUserDefaults" -github "libgit2/objective-git" "master" +github "libgit2/objective-git" github "zahlz/SwiftPasscodeLock" "master" github "bitserf/FavIcon" github "kishikawakatsumi/KeychainAccess" "master" diff --git a/fastlane/Fastfile b/fastlane/Fastfile new file mode 100644 index 0000000..cbfcbcf --- /dev/null +++ b/fastlane/Fastfile @@ -0,0 +1,76 @@ +# Customise this file, documentation can be found here: +# https://github.com/fastlane/fastlane/tree/master/fastlane/docs +# All available actions: https://docs.fastlane.tools/actions +# can also be listed using the `fastlane actions` command + +# Change the syntax highlighting to Ruby +# All lines starting with a # are ignored when running `fastlane` + +# If you want to automatically update fastlane if a new version is available: +# update_fastlane + +# This is the minimum version number required. +# Update this, if you use features of a newer version +fastlane_version "2.17.0" + +default_platform :ios + +platform :ios do + before_all do + cocoapods + carthage(platform: "iOS") + end + + desc "Runs all the tests" + lane :test do + scan(scheme: "pass") + end + + desc "Submit a new Beta Build to Apple TestFlight" + desc "This will also make sure the profile is up to date" + lane :beta do + # match(type: "appstore") # more information: https://codesigning.guide + ensure_git_status_clean + increment_build_number(xcodeproj: "pass.xcodeproj") + commit_version_bump(xcodeproj: "pass.xcodeproj") + push_to_git_remote + gym(scheme: "pass") # Build your app - more options available + pilot(skip_waiting_for_build_processing: true) + + # sh "your_script.sh" + # You can also use other beta testing services here (run `fastlane actions`) + end + + desc "Deploy a new version to the App Store" + lane :release do + # match(type: "appstore") + # snapshot + gym(scheme: "pass") # Build your app - more options available + deliver(force: true) + # frameit + end + + # You can define as many lanes as you want + + after_all do |lane| + # This block is called, only if the executed lane was successful + + # slack( + # message: "Successfully deployed new App Update." + # ) + end + + error do |lane, exception| + # slack( + # message: exception.message, + # success: false + # ) + end +end + + +# More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md +# All available actions: https://docs.fastlane.tools/actions + +# fastlane reports which actions are used +# No personal data is recorded. Learn more at https://github.com/fastlane/enhancer diff --git a/fastlane/travis.sh b/fastlane/travis.sh new file mode 100755 index 0000000..2804715 --- /dev/null +++ b/fastlane/travis.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +gem update fastlane +fastlane test +exit $? diff --git a/pass.xcodeproj/project.pbxproj b/pass.xcodeproj/project.pbxproj index 80aac60..516d07f 100644 --- a/pass.xcodeproj/project.pbxproj +++ b/pass.xcodeproj/project.pbxproj @@ -24,6 +24,7 @@ DC037CBF1E4ED4E100609409 /* TextViewTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC037CBD1E4ED4E100609409 /* TextViewTableViewCell.swift */; }; DC037CC01E4ED4E100609409 /* TextViewTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = DC037CBE1E4ED4E100609409 /* TextViewTableViewCell.xib */; }; DC1208581E35EBE60042942E /* ObjectiveGit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC1208571E35EBE60042942E /* ObjectiveGit.framework */; }; + DC13B1511E8640810097803F /* passTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC13B1501E8640810097803F /* passTests.swift */; }; DC193FFA1E49B4430077E0A3 /* AdvancedSettingsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC193FF91E49B4430077E0A3 /* AdvancedSettingsTableViewController.swift */; }; DC193FFC1E49E0340077E0A3 /* PasscodeLock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC193FFB1E49E0340077E0A3 /* PasscodeLock.framework */; }; DC193FFE1E49E0760077E0A3 /* PasscodeLockRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC193FFD1E49E0760077E0A3 /* PasscodeLockRepository.swift */; }; @@ -67,6 +68,16 @@ DCFB77AB1E503729008DE471 /* ContentTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCFB77AA1E503729008DE471 /* ContentTableViewCell.swift */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + DC13B1531E8640810097803F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = DC917BCB1E2E8231000FDF54 /* Project object */; + proxyType = 1; + remoteGlobalIDString = DC917BD21E2E8231000FDF54; + remoteInfo = pass; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXFileReference section */ 274CCFCF32444A2FF46BE7F4 /* Pods-pass.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-pass.debug.xcconfig"; path = "Pods/Target Support Files/Pods-pass/Pods-pass.debug.xcconfig"; sourceTree = ""; }; A262A58C1E68749C006B0890 /* Base32.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Base32.framework; path = Carthage/Build/iOS/Base32.framework; sourceTree = ""; }; @@ -87,6 +98,9 @@ DC037CBD1E4ED4E100609409 /* TextViewTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextViewTableViewCell.swift; sourceTree = ""; }; DC037CBE1E4ED4E100609409 /* TextViewTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TextViewTableViewCell.xib; sourceTree = ""; }; DC1208571E35EBE60042942E /* ObjectiveGit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjectiveGit.framework; path = Carthage/Build/iOS/ObjectiveGit.framework; sourceTree = ""; }; + DC13B14E1E8640810097803F /* passTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = passTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + DC13B1501E8640810097803F /* passTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = passTests.swift; sourceTree = ""; }; + DC13B1521E8640810097803F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; DC193FF91E49B4430077E0A3 /* AdvancedSettingsTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AdvancedSettingsTableViewController.swift; sourceTree = ""; }; DC193FFB1E49E0340077E0A3 /* PasscodeLock.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PasscodeLock.framework; path = Carthage/Build/iOS/PasscodeLock.framework; sourceTree = ""; }; DC193FFD1E49E0760077E0A3 /* PasscodeLockRepository.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PasscodeLockRepository.swift; sourceTree = ""; }; @@ -134,6 +148,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + DC13B14B1E8640810097803F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; DC917BD01E2E8231000FDF54 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -162,6 +183,15 @@ name = Pods; sourceTree = ""; }; + DC13B14F1E8640810097803F /* passTests */ = { + isa = PBXGroup; + children = ( + DC13B1501E8640810097803F /* passTests.swift */, + DC13B1521E8640810097803F /* Info.plist */, + ); + path = passTests; + sourceTree = ""; + }; DC19400C1E4B39400077E0A3 /* Controllers */ = { isa = PBXGroup; children = ( @@ -239,6 +269,7 @@ isa = PBXGroup; children = ( DC917BD51E2E8231000FDF54 /* pass */, + DC13B14F1E8640810097803F /* passTests */, DC917BD41E2E8231000FDF54 /* Products */, DC917BED1E2F38C4000FDF54 /* Frameworks */, A51B01737D08DB47BB58F85A /* Pods */, @@ -249,6 +280,7 @@ isa = PBXGroup; children = ( DC917BD31E2E8231000FDF54 /* pass.app */, + DC13B14E1E8640810097803F /* passTests.xctest */, ); name = Products; sourceTree = ""; @@ -289,6 +321,24 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + DC13B14D1E8640810097803F /* passTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = DC13B1571E8640810097803F /* Build configuration list for PBXNativeTarget "passTests" */; + buildPhases = ( + DC13B14A1E8640810097803F /* Sources */, + DC13B14B1E8640810097803F /* Frameworks */, + DC13B14C1E8640810097803F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + DC13B1541E8640810097803F /* PBXTargetDependency */, + ); + name = passTests; + productName = passTests; + productReference = DC13B14E1E8640810097803F /* passTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; DC917BD21E2E8231000FDF54 /* pass */ = { isa = PBXNativeTarget; buildConfigurationList = DC917BE51E2E8231000FDF54 /* Build configuration list for PBXNativeTarget "pass" */; @@ -316,10 +366,16 @@ DC917BCB1E2E8231000FDF54 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0820; + LastSwiftUpdateCheck = 0830; LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Bob Sun"; TargetAttributes = { + DC13B14D1E8640810097803F = { + CreatedOnToolsVersion = 8.3; + DevelopmentTeam = 4WDM8E95VU; + ProvisioningStyle = Automatic; + TestTargetID = DC917BD21E2E8231000FDF54; + }; DC917BD21E2E8231000FDF54 = { CreatedOnToolsVersion = 8.2.1; DevelopmentTeam = 4WDM8E95VU; @@ -341,11 +397,19 @@ projectRoot = ""; targets = ( DC917BD21E2E8231000FDF54 /* pass */, + DC13B14D1E8640810097803F /* passTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + DC13B14C1E8640810097803F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; DC917BD11E2E8231000FDF54 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -437,6 +501,14 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + DC13B14A1E8640810097803F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DC13B1511E8640810097803F /* passTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; DC917BCF1E2E8231000FDF54 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -484,6 +556,14 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + DC13B1541E8640810097803F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = DC917BD21E2E8231000FDF54 /* pass */; + targetProxy = DC13B1531E8640810097803F /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ DC917BDA1E2E8231000FDF54 /* Main.storyboard */ = { isa = PBXVariantGroup; @@ -504,6 +584,38 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + DC13B1551E8640810097803F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + DEVELOPMENT_TEAM = 4WDM8E95VU; + INFOPLIST_FILE = passTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = me.mssun.passTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/pass.app/pass"; + }; + name = Debug; + }; + DC13B1561E8640810097803F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + DEVELOPMENT_TEAM = 4WDM8E95VU; + INFOPLIST_FILE = passTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = me.mssun.passTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/pass.app/pass"; + }; + name = Release; + }; DC917BE31E2E8231000FDF54 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -662,6 +774,14 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + DC13B1571E8640810097803F /* Build configuration list for PBXNativeTarget "passTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DC13B1551E8640810097803F /* Debug */, + DC13B1561E8640810097803F /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; DC917BCE1E2E8231000FDF54 /* Build configuration list for PBXProject "pass" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/pass.xcodeproj/xcshareddata/xcschemes/pass.xcscheme b/pass.xcodeproj/xcshareddata/xcschemes/pass.xcscheme new file mode 100644 index 0000000..95834d6 --- /dev/null +++ b/pass.xcodeproj/xcshareddata/xcschemes/pass.xcscheme @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/passTests/Info.plist b/passTests/Info.plist new file mode 100644 index 0000000..6c6c23c --- /dev/null +++ b/passTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/passTests/passTests.swift b/passTests/passTests.swift new file mode 100644 index 0000000..fbc5343 --- /dev/null +++ b/passTests/passTests.swift @@ -0,0 +1,35 @@ +// +// passTests.swift +// passTests +// +// Created by Mingshen Sun on 24/3/2017. +// Copyright © 2017 Bob Sun. All rights reserved. +// + +import XCTest + +class passTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +}