-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
960 additions
and
1,969 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
codecov: | ||
branch: develop | ||
|
||
coverage: | ||
precision: 1 | ||
round: nearest | ||
ignore: | ||
- "XCDYouTubeKit Tests" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
CIRCLE_ARTIFACTS ?= artifacts | ||
CIRCLE_TEST_REPORTS ?= test_reports | ||
|
||
export SCAN_PROJECT = XCDYouTubeKit.xcodeproj | ||
export SCAN_SCHEME = XCDYouTubeKit Framework | ||
export SCAN_BUILDLOG_PATH = ${CIRCLE_ARTIFACTS}/$@ | ||
export SCAN_OUTPUT_TYPES = | ||
|
||
.PHONY: default test_macOS_report test_iOS_report test_tvOS_report test_macOS test_iOS test_tvOS test_iOS_9 check_scan check_slather | ||
|
||
default: check_slather check_scan | ||
scan --clean --device "iPhone 5s" --code_coverage --buildlog_path "~/Library/Logs/scan" | ||
slather coverage --verbose --output-directory "${TMPDIR}/${SCAN_SCHEME} Coverage Report" --html --show --ignore "../**/Contents/Developer/**" --scheme "${SCAN_SCHEME}" "${SCAN_PROJECT}" || true | ||
|
||
test_macOS_report: check_scan | ||
scan --output_directory "${CIRCLE_TEST_REPORTS}" --output_types junit --custom_report_file_name $@.xml | ||
|
||
test_iOS_report: check_scan | ||
scan --output_directory "${CIRCLE_TEST_REPORTS}" --output_types junit --custom_report_file_name $@.xml --device "iPhone 5s" --code_coverage --xcargs "OBJROOT=build GCC_GENERATE_TEST_COVERAGE_FILES=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES" | ||
|
||
test_tvOS_report: check_scan | ||
scan --output_directory "${CIRCLE_TEST_REPORTS}" --output_types junit --custom_report_file_name $@.xml --device "Apple TV 1080p" | ||
|
||
test_macOS: check_scan | ||
scan --configuration Release --xcargs "RUN_CLANG_STATIC_ANALYZER=YES CLANG_STATIC_ANALYZER_MODE=Deep MACOSX_DEPLOYMENT_TARGET=`xcrun --sdk "macosx" --show-sdk-version`" | ||
|
||
test_iOS: check_scan | ||
scan --configuration Release --device "iPhone 5s" --xcargs "RUN_CLANG_STATIC_ANALYZER=YES CLANG_STATIC_ANALYZER_MODE=Deep IPHONEOS_DEPLOYMENT_TARGET=`xcrun --sdk "iphonesimulator" --show-sdk-version`" | ||
|
||
test_tvOS: check_scan | ||
scan --configuration Release --device "Apple TV 1080p" --xcargs "RUN_CLANG_STATIC_ANALYZER=YES CLANG_STATIC_ANALYZER_MODE=Deep TVOS_DEPLOYMENT_TARGET=`xcrun --sdk "appletvsimulator" --show-sdk-version`" | ||
|
||
test_iOS_9: check_scan | ||
scan --device "iPhone 5s (9.0)" | ||
|
||
check_scan: | ||
@scan --version > /dev/null 2>&1 || (printf "❌ Please install \e[1;30mscan\e[0m (https://github.com/fastlane/fastlane/tree/master/scan) to run unit tests: $$ [sudo] \e[1;30mgem install scan\e[0m\n" && false) | ||
|
||
check_slather: | ||
@slather version > /dev/null 2>&1 || printf "⚠️ Please install \e[1;30mslather\e[0m (https://github.com/SlatherOrg/slather) to get a code coverage report: $$ [sudo] \e[1;30mgem install slather\e[0m\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,44 @@ | ||
import XCPlayground | ||
import XCDYouTubeKit | ||
#if swift(>=3.0) | ||
import PlaygroundSupport | ||
struct YouTubeVideoQuality { | ||
static let hd720 = NSNumber(value: XCDYouTubeVideoQuality.HD720.rawValue) | ||
static let medium360 = NSNumber(value: XCDYouTubeVideoQuality.medium360.rawValue) | ||
static let small240 = NSNumber(value: XCDYouTubeVideoQuality.small240.rawValue) | ||
} | ||
#else | ||
import XCPlayground | ||
typealias Error = NSError | ||
struct YouTubeVideoQuality { | ||
static let hd720 = NSNumber(unsignedLong: XCDYouTubeVideoQuality.HD720.rawValue) | ||
static let medium360 = NSNumber(unsignedLong: XCDYouTubeVideoQuality.Medium360.rawValue) | ||
static let small240 = NSNumber(unsignedLong: XCDYouTubeVideoQuality.Small240.rawValue) | ||
} | ||
#endif | ||
|
||
setenv("XCDYouTubeKitLogLevel", "0", 1) | ||
|
||
var client = XCDYouTubeClient(languageIdentifier: "en") | ||
|
||
client.getVideoWithIdentifier("6v2L2UGZJAM") { (video: XCDYouTubeVideo?, error: NSError?) -> Void in | ||
video | ||
error?.localizedDescription | ||
client.getVideoWithIdentifier("6v2L2UGZJAM") { (video: XCDYouTubeVideo?, error: Error?) -> Void in | ||
if let video = video { | ||
video.description | ||
video.streamURLs[XCDYouTubeVideoQualityHTTPLiveStreaming] | ||
video.streamURLs[YouTubeVideoQuality.hd720] | ||
video.streamURLs[YouTubeVideoQuality.medium360] | ||
video.streamURLs[YouTubeVideoQuality.small240] | ||
} else { | ||
error?.localizedDescription | ||
} | ||
} | ||
|
||
client.getVideoWithIdentifier("xxxxxxxxxxx") { (video: XCDYouTubeVideo?, error: NSError?) -> Void in | ||
client.getVideoWithIdentifier("xxxxxxxxxxx") { (video: XCDYouTubeVideo?, error: Error?) -> Void in | ||
video | ||
error?.localizedDescription | ||
} | ||
|
||
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true | ||
#if swift(>=3.0) | ||
PlaygroundPage.current.needsIndefiniteExecution = true | ||
#else | ||
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true | ||
#endif |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.