Skip to content

Commit

Permalink
Merge branch 'release/2.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
0xced committed Jun 24, 2015
2 parents 1388431 + 258d7d6 commit b130281
Show file tree
Hide file tree
Showing 193 changed files with 14,811 additions and 161 deletions.
1 change: 1 addition & 0 deletions .cocoadocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
explicit-references: true
28 changes: 20 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
language: objective-c
env:
global:
LC_CTYPE="en_US.UTF-8"
matrix:
- CONFIGURATION="Code Coverage" SCHEME="XCDYouTubeKit iOS Static Library" DESTINATION="platform=iOS Simulator,name=iPhone 5s" OBJROOT="build"
- CONFIGURATION="Release" SCHEME="XCDYouTubeKit iOS Static Library" DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=7.1"
- CONFIGURATION="Release" SCHEME="XCDYouTubeKit iOS Static Library" DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=8.1"
- CONFIGURATION="Release" SCHEME="XCDYouTubeKit iOS Static Library" DESTINATION="platform=iOS Simulator,name=iPhone 4s" RUN_CLANG_STATIC_ANALYZER="YES"
- CONFIGURATION="Release" SCHEME="XCDYouTubeKit iOS Static Library" DESTINATION="platform=iOS Simulator,name=iPhone 5s" RUN_CLANG_STATIC_ANALYZER="YES"
- CONFIGURATION="Release" SCHEME="XCDYouTubeKit iOS Framework" DESTINATION="platform=iOS Simulator,name=iPhone 4s" RUN_CLANG_STATIC_ANALYZER="YES"
- CONFIGURATION="Release" SCHEME="XCDYouTubeKit iOS Framework" DESTINATION="platform=iOS Simulator,name=iPhone 5s" RUN_CLANG_STATIC_ANALYZER="YES"
- CONFIGURATION="Release" SCHEME="XCDYouTubeKit OS X" DESTINATION="platform=OS X" RUN_CLANG_STATIC_ANALYZER="YES"
before_install:
- xcrun simctl list
install:
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
- sudo easy_install cpp-coveralls
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
- sudo easy_install cpp-coveralls
script:
- export LC_CTYPE=en_US.UTF-8
- set -o pipefail
- xcodebuild test -project XCDYouTubeKit.xcodeproj -scheme 'XCDYouTubeKit iOS Static Library' -destination 'platform=iOS Simulator,name=iPhone Retina (4-inch)' | xcpretty -c
- xcodebuild test -project XCDYouTubeKit.xcodeproj -scheme 'XCDYouTubeKit iOS Static Library' -destination 'platform=iOS Simulator,name=iPhone Retina (4-inch 64-bit)' OBJROOT=build | xcpretty -c
- xcodebuild test -project XCDYouTubeKit.xcodeproj -scheme 'XCDYouTubeKit OS X' | xcpretty -c
- ./Scripts/run-tests.sh
after_success:
- coveralls --include XCDYouTubeKit
- if [ "$CONFIGURATION" == "Code Coverage" ]; then
coveralls --include XCDYouTubeKit;
fi
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#### Version 2.2.0

* Networking and parsing code is executed on a background thread for better performance. The `XCDYouTubeVideoOperation` class has changed from an asynchronous to a synchronous operation and must not be started on the main thread. (#147)
* Logging support, see the [README](README.md#logging) for documentation.
* Improved documentation.

#### Version 2.1.3

* Adaptation to YouTube API change. (#144)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013-2014 Cédric Luthi
Copyright (c) 2013-2015 Cédric Luthi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://img.shields.io/travis/0xced/XCDYouTubeKit/master.svg?style=flat)](https://travis-ci.org/0xced/XCDYouTubeKit)
[![Coverage Status](https://img.shields.io/coveralls/0xced/XCDYouTubeKit/master.svg?style=flat)](https://coveralls.io/r/0xced/XCDYouTubeKit?branch=master)
[![Platform](https://img.shields.io/cocoapods/p/XCDYouTubeKit.svg?style=flat)](http://cocoadocs.org/docsets/XCDYouTubeKit/)
[![Pod Version](https://img.shields.io/cocoapods/v/XCDYouTubeKit.svg?style=flat)](http://cocoadocs.org/docsets/XCDYouTubeKit/)
[![Pod Version](https://img.shields.io/cocoapods/v/XCDYouTubeKit.svg?style=flat)](https://cocoapods.org/pods/XCDYouTubeKit)
[![Carthage Compatibility](https://img.shields.io/badge/carthage-✓-f2a77e.svg?style=flat)](https://github.com/Carthage/Carthage/)
[![License](https://img.shields.io/cocoapods/l/XCDYouTubeKit.svg?style=flat)](LICENSE)

Expand All @@ -30,12 +30,12 @@ XCDYouTubeKit is available through CocoaPods and Carthage.

CocoaPods:
```ruby
pod "XCDYouTubeKit", "~> 2.1.3"
pod "XCDYouTubeKit", "~> 2.2.0"
```

Carthage:
```objc
github "0xced/XCDYouTubeKit" ~> 2.1.3
github "0xced/XCDYouTubeKit" ~> 2.2.0
```

Alternatively, you can manually use the provided static library on iOS or dynamic framework on OS X. In order to use the iOS static library, you must:
Expand Down Expand Up @@ -97,6 +97,31 @@ XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [[XCDYouTubeVid
See the demo project for more sample code.
## Logging
Since version 2.2.0, XCDYouTubeKit produces logs. XCDYouTubeKit supports [CocoaLumberjack](https://github.com/CocoaLumberjack/CocoaLumberjack) but does not require it. If your project includes CocoaLumberjack, all logs will be routed through CocoaLumberjack, else logs will be emitted with `NSLog`.
The context for identifying all XCDYouTubeKit logs in CocoaLumberjack is the number `(NSInteger)0xced70676`. Beware, CocoaLumberjack contexts are NSIntegers, don’t forget the cast.
### Controlling log levels
If you are using CocoaLumberjack, you are responsible for controlling the log levels with the CocoaLumberjack APIs.
If you are not using CocoaLumberjack, you can control the log levels with the `XCDYouTubeKitLogLevel` environment variable. The log levels are the same as CocoaLumberjack, with the addition of the *trace* level.
Level | Value
--------|------
Error | 0x01
Warning | 0x02
Info | 0x04
Debug | 0x08
Verbose | 0x10
Trace | 0x20
The levels are bitmasks, so you can combine them. For example, if you want to log *error*, *warning* and *info* levels, set the `XCDYouTubeKitLogLevel` environment variable to `0x7`.
If you do not set the `XCDYouTubeKitLogLevel` environment variable, only warning and error levels are logged.
## Credits
The URL extraction algorithms in *XCDYouTubeKit* are inspired by the [YouTube extractor](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/youtube.py) module of the *youtube-dl* project.
Expand Down
23 changes: 23 additions & 0 deletions Scripts/analyzer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/python

import os, plistlib, sys

run_clang_static_analyzer = os.environ.get('RUN_CLANG_STATIC_ANALYZER', '0').strip(' ')
if not run_clang_static_analyzer[:1] in 'YyTt123456789':
sys.exit(0)

analyzer_results_dir = os.path.join(os.environ['TARGET_TEMP_DIR'], 'StaticAnalyzer', os.environ['PROJECT_NAME'], os.environ['TARGET_NAME'], os.environ['CURRENT_VARIANT'], os.environ['CURRENT_ARCH'])
if not os.path.exists(analyzer_results_dir):
sys.exit("error: Static Anaylzer results not found, expected in %s" % analyzer_results_dir)

exit_code = 0
for result in os.listdir(analyzer_results_dir):
with open(os.path.join(analyzer_results_dir, result)) as f:
plist = plistlib.readPlist(f)
for diagnostic in plist['diagnostics']:
location = diagnostic['location']
path = plist['files'][location['file']]
print "%s:%s:%s: error: Static Anaylzer Issue: %s" % (path, location['line'], location['col'], diagnostic['description'])
exit_code = 1

sys.exit(exit_code)
22 changes: 22 additions & 0 deletions Scripts/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

set -o pipefail

: ${SCHEME:="XCDYouTubeKit iOS Static Library"}
: ${CONFIGURATION:="Release"}
: ${DESTINATION:="platform=iOS Simulator,name=iPhone 5s"}

COMMAND="xcodebuild clean test -project XCDYouTubeKit.xcodeproj -scheme '${SCHEME}' -configuration '${CONFIGURATION}' -destination '${DESTINATION}'"

for BUILD_SETTING in OBJROOT RUN_CLANG_STATIC_ANALYZER; do
VALUE=`eval echo \\$"${BUILD_SETTING}"`
if [ ! -z "${VALUE}" ]; then
COMMAND+=" ${BUILD_SETTING}='${VALUE}'"
unset ${BUILD_SETTING}
fi
done

xcpretty --version > /dev/null && COMMAND+=" | xcpretty -c"

set -x
eval "${COMMAND}"
3 changes: 3 additions & 0 deletions XCDYouTubeKit Demo.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion XCDYouTubeKit Demo/OS X Demo/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2014 Cédric Luthi. All rights reserved.
// Copyright (c) 2013-2015 Cédric Luthi. All rights reserved.
//

@interface AppDelegate : NSObject <NSApplicationDelegate>
Expand Down
6 changes: 5 additions & 1 deletion XCDYouTubeKit Demo/OS X Demo/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
//
// Copyright (c) 2014 Cédric Luthi. All rights reserved.
// Copyright (c) 2013-2015 Cédric Luthi. All rights reserved.
//

#import "AppDelegate.h"

#import <CocoaLumberjack/CocoaLumberjack.h>

@implementation AppDelegate

- (void) applicationDidFinishLaunching:(NSNotification *)aNotification
{
[[NSUserDefaults standardUserDefaults] registerDefaults:@{ @"VideoIdentifier": @"EdeVaT-zZt4" }];

[DDLog addLogger:[DDASLLogger sharedInstance]];
}

- (IBAction) playVideo:(id)sender
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2014 Cédric Luthi. All rights reserved.</string>
<string>Copyright © 2013-2015 Cédric Luthi. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion XCDYouTubeKit Demo/OS X Demo/Supporting Files/main.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2014 Cédric Luthi. All rights reserved.
// Copyright (c) 2013-2015 Cédric Luthi. All rights reserved.
//

int main(int argc, const char * argv[])
Expand Down
16 changes: 16 additions & 0 deletions XCDYouTubeKit Demo/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
xcodeproj 'XCDYouTubeKit Demo.xcodeproj'
workspace '../XCDYouTubeKit Demo.xcworkspace'

def import_pods
pod 'XCDLumberjackNSLogger', '~> 1.0.0'
end

target 'XCDYouTubeKit iOS Demo' do
platform :ios, '5.0'
import_pods
end

target 'XCDYouTubeKit OS X Demo' do
platform :osx, '10.9'
import_pods
end
25 changes: 25 additions & 0 deletions XCDYouTubeKit Demo/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
PODS:
- CocoaLumberjack (2.0.0):
- CocoaLumberjack/Default (= 2.0.0)
- CocoaLumberjack/Extensions (= 2.0.0)
- CocoaLumberjack/Core (2.0.0)
- CocoaLumberjack/Default (2.0.0):
- CocoaLumberjack/Core
- CocoaLumberjack/Extensions (2.0.0):
- CocoaLumberjack/Default
- NSLogger (1.5.1):
- NSLogger/Standard (= 1.5.1)
- NSLogger/Standard (1.5.1)
- XCDLumberjackNSLogger (1.0.0):
- CocoaLumberjack (~> 2.0.0)
- NSLogger (~> 1.5.1)

DEPENDENCIES:
- XCDLumberjackNSLogger (~> 1.0.0)

SPEC CHECKSUMS:
CocoaLumberjack: a6f77d987d65dc7ba86b0f84db7d0b9084f77bcb
NSLogger: 5ed223a2436df96244e033be750656dacdeec034
XCDLumberjackNSLogger: 499dd507ac73e41b63b600b3280b9920e35f53c6

COCOAPODS: 0.37.2
81 changes: 81 additions & 0 deletions XCDYouTubeKit Demo/Pods/CocoaLumberjack/Classes/CocoaLumberjack.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b130281

Please sign in to comment.