Skip to content

Commit

Permalink
Merge pull request #3 from Hxucaa/develop
Browse files Browse the repository at this point in the history
A bunch of fixes to travis and scripts.
  • Loading branch information
Lance Zhu authored Aug 4, 2016
2 parents 28cfab6 + dde96dc commit d0c7662
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 19 deletions.
47 changes: 37 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
language: objective-c
osx_image: xcode7.3
git:
submodules: false
env:
global:
- FRAMEWORK_NAME=ValidationNEL
script:
- carthage bootstrap
- sh bin/ci
after_success:
- bash <(curl -s https://codecov.io/bash) -J 'ValidationNEL'
- LC_CTYPE=en_US.UTF-8
- FRAMEWORK_NAME=ValidationNEL
matrix:
include:
- os: osx
language: objective-c
osx_image: xcode7.3
script:
- pod lib lint
- os: osx
language: objective-c
osx_image: xcode7.3
before_install:
- brew update
- brew outdated carthage || brew upgrade carthage
before_script:
# rebuild frameworks if Cartfile.resolved is changed from last build
- sh bin/bootstrap-if-needed
script:
- sh bin/ci
after_success:
- bash <(curl -s https://codecov.io/bash) -J 'ValidationNEL'
cache:
directories:
- Carthage/Build
before_deploy:
- carthage build --no-skip-current
- carthage archive $FRAMEWORK_NAME
deploy:
provider: releases
api_key:
secure: DpMEwhskvDdD86ippGTDFtj4EsLet6As4zC0xR3TrEpQx6QPEwnKgKCkW8gyMlDndOYPHoSiPCn046zMLWPfSPnl7ihqhOos/khws/vZvjA7oiwUEW6ujTxvngrosMxoDOOeJGoA6lCUf232R+kgKBpOVkTdscAfjh9BrTkeTlCGhAxY/tk/vjoA6fRpx+tYNcIRu1mA8oWKlqpOv8WZVN0A/gCr3siTrZHdFLJ8MW7mw4bsI/S9SZQfnlrfUDWCp6FOGM69QgHpd7Zo5JgVAjBowmzOYvodtWMKZlotTrRVSoIN6sTRCTyr8bHn6mMYi6ItMx5nkNvnW+DQKEdMVGE3X2kHZY1B+5eDz2/vpq5EhaNVLnY3DZjAnSYC9RlgYsWYz1Wek6MzNyphP5W4KO+YEfG6imB04ZrSqJd5a0ZXRYnBSKSu/QQnAa55BJESdHepZTXS5kuTWihUVZghC4zfirQLIRvAYOVOFoI3ZqMVc61x2pzGnl/NjLuqEGSB/NtLQ/gznMYaCIKOGEJc9J7ZBAa1qNvCqSA33hLzV7DpAAOXutStPJkCJ8qiICX2HTR4hW8WdF64CLr0ng1WcXk+ChV0XfC/Qdm6PD/Mw9uPV9xp8g98Mr9IukGdgQUco+1UMbhdB4MOukV7txFXlNSn/5ZoWPdnN3PXMN4I4c8=
file: ValidationNEL.framework.zip
skip_cleanup: true
on:
repo: Hxucaa/ValidationNEL
tags: true
4 changes: 2 additions & 2 deletions Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "Quick/Quick"
github "Quick/Nimble"
github "Quick/Quick" == 0.9.3
github "Quick/Nimble" == 4.1.0
10 changes: 10 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import PackageDescription

let package = Package(
name: "ValidationNEL",
targets: [
Target(name: "ValidationNEL-iOS"),
Target(name: "ValidationNEL-macOS"),
Target(name: "ValidationNEL-tvOS"),
]
)
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

[![Build Status](https://travis-ci.org/Hxucaa/ValidationNEL.svg?branch=master)](https://travis-ci.org/Hxucaa/ValidationNEL)
[![License MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/Hxucaa/ValidationNEL/blob/master/LICENSE)
![pod](https://img.shields.io/cocoapods/v/ValidationNEL.svg)
![Platform (iOS | OS X | tvOS | watchOS)](https://img.shields.io/badge/platforms-iOS%20%7C%20OSX%20%7C%20tvOS%20%7C%20watchOS-blue.svg)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

ValidationNEL accumulates failures instead of exiting out upon first failure. This is useful in situations where examing all possible failures is desirable.

For example, when asking a user to enter a password, we should make sure it satisfies certain constraints such as length, containing special characters. All constraints should be examined and corresponding error messages should be displayed.


## Installation

### CocoaPods
Expand Down Expand Up @@ -37,6 +41,14 @@ And run:
carthage update
```

## To Run The Prorject

```console
git clone https://github.com/Hxucaa/ValidationNEL
cd ValidationNEL
bin/setup
```

## Features

Currently `ValidationNEL` supports the following features:
Expand Down
10 changes: 10 additions & 0 deletions ValidationNEL.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@
7E22235E1D531DC500CE1256 /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Nimble.framework; path = Carthage/Build/Mac/Nimble.framework; sourceTree = "<group>"; };
7E22235F1D531DC500CE1256 /* Quick.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quick.framework; path = Carthage/Build/Mac/Quick.framework; sourceTree = "<group>"; };
7E2223601D531DC500CE1256 /* Swiftz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Swiftz.framework; path = Carthage/Build/Mac/Swiftz.framework; sourceTree = "<group>"; };
7E2223641D53A2AC00CE1256 /* .gitignore */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitignore; sourceTree = "<group>"; };
7E2223651D53A2AC00CE1256 /* .gitmodules */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitmodules; sourceTree = "<group>"; };
7E2223661D53A2AC00CE1256 /* .travis.yml */ = {isa = PBXFileReference; lastKnownFileType = text; path = .travis.yml; sourceTree = "<group>"; };
7E22238C1D53D1D800CE1256 /* bootstrap */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = bootstrap; sourceTree = "<group>"; };
7E22238D1D53D1D800CE1256 /* bootstrap-if-needed */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "bootstrap-if-needed"; sourceTree = "<group>"; };
7E65844C1D2F665200BC8204 /* ValidationNEL-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ValidationNEL-iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
7E6584511D2F665200BC8204 /* ValidationNELTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValidationNELTests.swift; sourceTree = "<group>"; };
7E6584531D2F665200BC8204 /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -290,6 +295,9 @@
7E6585161D316F1C00BC8204 /* codecov.yml */,
7E6585171D316F1C00BC8204 /* LICENSE */,
7E6585181D316F1C00BC8204 /* README.md */,
7E2223641D53A2AC00CE1256 /* .gitignore */,
7E2223651D53A2AC00CE1256 /* .gitmodules */,
7E2223661D53A2AC00CE1256 /* .travis.yml */,
);
name = Metadata;
sourceTree = "<group>";
Expand Down Expand Up @@ -329,6 +337,8 @@
7ED7FB951D4FE3DC00ECDF17 /* bin */ = {
isa = PBXGroup;
children = (
7E22238C1D53D1D800CE1256 /* bootstrap */,
7E22238D1D53D1D800CE1256 /* bootstrap-if-needed */,
7ED7FB971D4FE3DC00ECDF17 /* ci */,
7ED7FB981D4FE3DC00ECDF17 /* setup */,
);
Expand Down
6 changes: 6 additions & 0 deletions bin/bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

echo "Bootstrap frameworks..."
carthage bootstrap
echo "Copy Cartfile.resolved..."
cp Cartfile.resolved Carthage/Build
8 changes: 8 additions & 0 deletions bin/bootstrap-if-needed
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

if cmp -s Cartfile.resolved Carthage/Build/Cartfile.resolved; then
echo "Frameworks are the same as last build. No need to rebuild."
else
echo "Frameworks are missing or have been updated. Proceed to rebuild"
bin/bootstrap
fi
6 changes: 2 additions & 4 deletions bin/ci
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh

set -e

Expand All @@ -12,13 +12,11 @@ MACOS_TEST_CMD="xcodebuild build test -workspace ValidationNEL.xcworkspace -sche

WATCHOS_TEST_CMD="xcodebuild build -workspace ValidationNEL.xcworkspace -scheme ValidationNEL-watchOS -sdk watchsimulator -destination 'platform=watchOS Simulator,name=Apple Watch - 42mm'"

# Validate podspec
#pod lib lint

which -s xcpretty
XCPRETTY_INSTALLED=$?

# Run tests
echo "Running tests..."

if [[ $TRAVIS || $XCPRETTY_INSTALLED == 0 ]]; then
eval "set -o pipefail && ${IOS_TEST_CMD} | tee xcodebuild.log | xcpretty -c"
Expand Down
5 changes: 3 additions & 2 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/usr/bin/env sh
#!/bin/sh

if ! command -v carthage > /dev/null; then
printf 'Carthage is not installed.\n'
printf 'See https://github.com/Carthage/Carthage for install instructions.\n'
exit 1
fi

carthage update
echo "Update frameworks..."
carthage update --use-submodules --no-use-binaries

0 comments on commit d0c7662

Please sign in to comment.