diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..998f4d0 --- /dev/null +++ b/Package.swift @@ -0,0 +1,37 @@ +// swift-tools-version:5.1 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "JPVideoPlayer", + platforms: [ + .iOS(.v8), + .tvOS(.v9), + .watchOS(.v2) + ], + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "JPVideoPlayer", + targets: ["JPVideoPlayer"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "JPVideoPlayer", + dependencies: [], + path: "Sources", + exclude: [], + sources: ["Core"], + publicHeadersPath: "Core"), + .testTarget( + name: "JPVideoPlayerTests", + dependencies: ["JPVideoPlayer"]), + ] +) diff --git a/JPVideoPlayer/JPGCDExtensions.h b/Sources/Core/JPGCDExtensions.h similarity index 100% rename from JPVideoPlayer/JPGCDExtensions.h rename to Sources/Core/JPGCDExtensions.h diff --git a/JPVideoPlayer/JPGCDExtensions.m b/Sources/Core/JPGCDExtensions.m similarity index 100% rename from JPVideoPlayer/JPGCDExtensions.m rename to Sources/Core/JPGCDExtensions.m diff --git a/JPVideoPlayer/JPMethodInjecting.h b/Sources/Core/JPMethodInjecting.h similarity index 100% rename from JPVideoPlayer/JPMethodInjecting.h rename to Sources/Core/JPMethodInjecting.h diff --git a/JPVideoPlayer/JPMethodInjecting.m b/Sources/Core/JPMethodInjecting.m similarity index 100% rename from JPVideoPlayer/JPMethodInjecting.m rename to Sources/Core/JPMethodInjecting.m diff --git a/JPVideoPlayer/JPResourceLoadingRequestTask.h b/Sources/Core/JPResourceLoadingRequestTask.h similarity index 100% rename from JPVideoPlayer/JPResourceLoadingRequestTask.h rename to Sources/Core/JPResourceLoadingRequestTask.h diff --git a/JPVideoPlayer/JPResourceLoadingRequestTask.m b/Sources/Core/JPResourceLoadingRequestTask.m similarity index 100% rename from JPVideoPlayer/JPResourceLoadingRequestTask.m rename to Sources/Core/JPResourceLoadingRequestTask.m diff --git a/JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_blur@2x.png b/Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_blur@2x.png similarity index 100% rename from JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_blur@2x.png rename to Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_blur@2x.png diff --git a/JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_blur@3x.png b/Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_blur@3x.png similarity index 100% rename from JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_blur@3x.png rename to Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_blur@3x.png diff --git a/JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_landscape@2x.png b/Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_landscape@2x.png similarity index 100% rename from JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_landscape@2x.png rename to Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_landscape@2x.png diff --git a/JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_landscape@3x.png b/Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_landscape@3x.png similarity index 100% rename from JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_landscape@3x.png rename to Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_landscape@3x.png diff --git a/JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_pause@2x.png b/Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_pause@2x.png similarity index 100% rename from JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_pause@2x.png rename to Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_pause@2x.png diff --git a/JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_pause@3x.png b/Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_pause@3x.png similarity index 100% rename from JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_pause@3x.png rename to Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_pause@3x.png diff --git a/JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_play@2x.png b/Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_play@2x.png similarity index 100% rename from JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_play@2x.png rename to Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_play@2x.png diff --git a/JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_play@3x.png b/Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_play@3x.png similarity index 100% rename from JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_play@3x.png rename to Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_play@3x.png diff --git a/JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_portrait@2x.png b/Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_portrait@2x.png similarity index 100% rename from JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_portrait@2x.png rename to Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_portrait@2x.png diff --git a/JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_portrait@3x.png b/Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_portrait@3x.png similarity index 100% rename from JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_portrait@3x.png rename to Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_portrait@3x.png diff --git a/JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_progress_handler_hightlight@2x.png b/Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_progress_handler_hightlight@2x.png similarity index 100% rename from JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_progress_handler_hightlight@2x.png rename to Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_progress_handler_hightlight@2x.png diff --git a/JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_progress_handler_hightlight@3x.png b/Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_progress_handler_hightlight@3x.png similarity index 100% rename from JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_progress_handler_hightlight@3x.png rename to Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_progress_handler_hightlight@3x.png diff --git a/JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_progress_handler_normal@2x.png b/Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_progress_handler_normal@2x.png similarity index 100% rename from JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_progress_handler_normal@2x.png rename to Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_progress_handler_normal@2x.png diff --git a/JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_progress_handler_normal@3x.png b/Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_progress_handler_normal@3x.png similarity index 100% rename from JPVideoPlayer/JPVideoPlayer.bundle/jp_videoplayer_progress_handler_normal@3x.png rename to Sources/Core/JPVideoPlayer.bundle/jp_videoplayer_progress_handler_normal@3x.png diff --git a/JPVideoPlayer/JPVideoPlayer.h b/Sources/Core/JPVideoPlayer.h similarity index 100% rename from JPVideoPlayer/JPVideoPlayer.h rename to Sources/Core/JPVideoPlayer.h diff --git a/JPVideoPlayer/JPVideoPlayer.m b/Sources/Core/JPVideoPlayer.m similarity index 100% rename from JPVideoPlayer/JPVideoPlayer.m rename to Sources/Core/JPVideoPlayer.m diff --git a/JPVideoPlayer/JPVideoPlayerCache.h b/Sources/Core/JPVideoPlayerCache.h similarity index 100% rename from JPVideoPlayer/JPVideoPlayerCache.h rename to Sources/Core/JPVideoPlayerCache.h diff --git a/JPVideoPlayer/JPVideoPlayerCache.m b/Sources/Core/JPVideoPlayerCache.m similarity index 100% rename from JPVideoPlayer/JPVideoPlayerCache.m rename to Sources/Core/JPVideoPlayerCache.m diff --git a/JPVideoPlayer/JPVideoPlayerCacheFile.h b/Sources/Core/JPVideoPlayerCacheFile.h similarity index 100% rename from JPVideoPlayer/JPVideoPlayerCacheFile.h rename to Sources/Core/JPVideoPlayerCacheFile.h diff --git a/JPVideoPlayer/JPVideoPlayerCacheFile.m b/Sources/Core/JPVideoPlayerCacheFile.m similarity index 100% rename from JPVideoPlayer/JPVideoPlayerCacheFile.m rename to Sources/Core/JPVideoPlayerCacheFile.m diff --git a/JPVideoPlayer/JPVideoPlayerCachePath.h b/Sources/Core/JPVideoPlayerCachePath.h similarity index 100% rename from JPVideoPlayer/JPVideoPlayerCachePath.h rename to Sources/Core/JPVideoPlayerCachePath.h diff --git a/JPVideoPlayer/JPVideoPlayerCachePath.m b/Sources/Core/JPVideoPlayerCachePath.m similarity index 100% rename from JPVideoPlayer/JPVideoPlayerCachePath.m rename to Sources/Core/JPVideoPlayerCachePath.m diff --git a/JPVideoPlayer/JPVideoPlayerCellProtocol.h b/Sources/Core/JPVideoPlayerCellProtocol.h similarity index 98% rename from JPVideoPlayer/JPVideoPlayerCellProtocol.h rename to Sources/Core/JPVideoPlayerCellProtocol.h index d378e30..2a3e821 100644 --- a/JPVideoPlayer/JPVideoPlayerCellProtocol.h +++ b/Sources/Core/JPVideoPlayerCellProtocol.h @@ -45,4 +45,4 @@ NS_ASSUME_NONNULL_BEGIN @end -NS_ASSUME_NONNULL_END \ No newline at end of file +NS_ASSUME_NONNULL_END diff --git a/JPVideoPlayer/JPVideoPlayerCellProtocol.m b/Sources/Core/JPVideoPlayerCellProtocol.m similarity index 100% rename from JPVideoPlayer/JPVideoPlayerCellProtocol.m rename to Sources/Core/JPVideoPlayerCellProtocol.m diff --git a/JPVideoPlayer/JPVideoPlayerCompat.h b/Sources/Core/JPVideoPlayerCompat.h similarity index 100% rename from JPVideoPlayer/JPVideoPlayerCompat.h rename to Sources/Core/JPVideoPlayerCompat.h diff --git a/JPVideoPlayer/JPVideoPlayerCompat.m b/Sources/Core/JPVideoPlayerCompat.m similarity index 100% rename from JPVideoPlayer/JPVideoPlayerCompat.m rename to Sources/Core/JPVideoPlayerCompat.m diff --git a/JPVideoPlayer/JPVideoPlayerControlViews.h b/Sources/Core/JPVideoPlayerControlViews.h similarity index 100% rename from JPVideoPlayer/JPVideoPlayerControlViews.h rename to Sources/Core/JPVideoPlayerControlViews.h diff --git a/JPVideoPlayer/JPVideoPlayerControlViews.m b/Sources/Core/JPVideoPlayerControlViews.m similarity index 100% rename from JPVideoPlayer/JPVideoPlayerControlViews.m rename to Sources/Core/JPVideoPlayerControlViews.m diff --git a/JPVideoPlayer/JPVideoPlayerDownloader.h b/Sources/Core/JPVideoPlayerDownloader.h similarity index 100% rename from JPVideoPlayer/JPVideoPlayerDownloader.h rename to Sources/Core/JPVideoPlayerDownloader.h diff --git a/JPVideoPlayer/JPVideoPlayerDownloader.m b/Sources/Core/JPVideoPlayerDownloader.m similarity index 100% rename from JPVideoPlayer/JPVideoPlayerDownloader.m rename to Sources/Core/JPVideoPlayerDownloader.m diff --git a/JPVideoPlayer/JPVideoPlayerKit.h b/Sources/Core/JPVideoPlayerKit.h similarity index 100% rename from JPVideoPlayer/JPVideoPlayerKit.h rename to Sources/Core/JPVideoPlayerKit.h diff --git a/JPVideoPlayer/JPVideoPlayerManager.h b/Sources/Core/JPVideoPlayerManager.h similarity index 100% rename from JPVideoPlayer/JPVideoPlayerManager.h rename to Sources/Core/JPVideoPlayerManager.h diff --git a/JPVideoPlayer/JPVideoPlayerManager.m b/Sources/Core/JPVideoPlayerManager.m similarity index 100% rename from JPVideoPlayer/JPVideoPlayerManager.m rename to Sources/Core/JPVideoPlayerManager.m diff --git a/JPVideoPlayer/JPVideoPlayerProtocol.h b/Sources/Core/JPVideoPlayerProtocol.h similarity index 100% rename from JPVideoPlayer/JPVideoPlayerProtocol.h rename to Sources/Core/JPVideoPlayerProtocol.h diff --git a/JPVideoPlayer/JPVideoPlayerResourceLoader.h b/Sources/Core/JPVideoPlayerResourceLoader.h similarity index 100% rename from JPVideoPlayer/JPVideoPlayerResourceLoader.h rename to Sources/Core/JPVideoPlayerResourceLoader.h diff --git a/JPVideoPlayer/JPVideoPlayerResourceLoader.m b/Sources/Core/JPVideoPlayerResourceLoader.m similarity index 100% rename from JPVideoPlayer/JPVideoPlayerResourceLoader.m rename to Sources/Core/JPVideoPlayerResourceLoader.m diff --git a/JPVideoPlayer/JPVideoPlayerScrollViewProtocol.h b/Sources/Core/JPVideoPlayerScrollViewProtocol.h similarity index 100% rename from JPVideoPlayer/JPVideoPlayerScrollViewProtocol.h rename to Sources/Core/JPVideoPlayerScrollViewProtocol.h diff --git a/JPVideoPlayer/JPVideoPlayerScrollViewProtocol.m b/Sources/Core/JPVideoPlayerScrollViewProtocol.m similarity index 100% rename from JPVideoPlayer/JPVideoPlayerScrollViewProtocol.m rename to Sources/Core/JPVideoPlayerScrollViewProtocol.m diff --git a/JPVideoPlayer/JPVideoPlayerSupportUtils.h b/Sources/Core/JPVideoPlayerSupportUtils.h similarity index 100% rename from JPVideoPlayer/JPVideoPlayerSupportUtils.h rename to Sources/Core/JPVideoPlayerSupportUtils.h diff --git a/JPVideoPlayer/JPVideoPlayerSupportUtils.m b/Sources/Core/JPVideoPlayerSupportUtils.m similarity index 100% rename from JPVideoPlayer/JPVideoPlayerSupportUtils.m rename to Sources/Core/JPVideoPlayerSupportUtils.m diff --git a/JPVideoPlayer/UICollectionView+WebVideoCache.h b/Sources/Core/UICollectionView+WebVideoCache.h similarity index 100% rename from JPVideoPlayer/UICollectionView+WebVideoCache.h rename to Sources/Core/UICollectionView+WebVideoCache.h diff --git a/JPVideoPlayer/UICollectionView+WebVideoCache.m b/Sources/Core/UICollectionView+WebVideoCache.m similarity index 100% rename from JPVideoPlayer/UICollectionView+WebVideoCache.m rename to Sources/Core/UICollectionView+WebVideoCache.m diff --git a/JPVideoPlayer/UICollectionViewCell+WebVideoCache.h b/Sources/Core/UICollectionViewCell+WebVideoCache.h similarity index 100% rename from JPVideoPlayer/UICollectionViewCell+WebVideoCache.h rename to Sources/Core/UICollectionViewCell+WebVideoCache.h diff --git a/JPVideoPlayer/UICollectionViewCell+WebVideoCache.m b/Sources/Core/UICollectionViewCell+WebVideoCache.m similarity index 100% rename from JPVideoPlayer/UICollectionViewCell+WebVideoCache.m rename to Sources/Core/UICollectionViewCell+WebVideoCache.m diff --git a/JPVideoPlayer/UITableView+WebVideoCache.h b/Sources/Core/UITableView+WebVideoCache.h similarity index 100% rename from JPVideoPlayer/UITableView+WebVideoCache.h rename to Sources/Core/UITableView+WebVideoCache.h diff --git a/JPVideoPlayer/UITableView+WebVideoCache.m b/Sources/Core/UITableView+WebVideoCache.m similarity index 100% rename from JPVideoPlayer/UITableView+WebVideoCache.m rename to Sources/Core/UITableView+WebVideoCache.m diff --git a/JPVideoPlayer/UITableViewCell+WebVideoCache.h b/Sources/Core/UITableViewCell+WebVideoCache.h similarity index 100% rename from JPVideoPlayer/UITableViewCell+WebVideoCache.h rename to Sources/Core/UITableViewCell+WebVideoCache.h diff --git a/JPVideoPlayer/UITableViewCell+WebVideoCache.m b/Sources/Core/UITableViewCell+WebVideoCache.m similarity index 100% rename from JPVideoPlayer/UITableViewCell+WebVideoCache.m rename to Sources/Core/UITableViewCell+WebVideoCache.m diff --git a/JPVideoPlayer/UIView+WebVideoCache.h b/Sources/Core/UIView+WebVideoCache.h similarity index 100% rename from JPVideoPlayer/UIView+WebVideoCache.h rename to Sources/Core/UIView+WebVideoCache.h diff --git a/JPVideoPlayer/UIView+WebVideoCache.m b/Sources/Core/UIView+WebVideoCache.m similarity index 100% rename from JPVideoPlayer/UIView+WebVideoCache.m rename to Sources/Core/UIView+WebVideoCache.m diff --git a/Tests/JPVideoPlayerTests/JPVideoPlayerTests.swift b/Tests/JPVideoPlayerTests/JPVideoPlayerTests.swift new file mode 100644 index 0000000..4eef609 --- /dev/null +++ b/Tests/JPVideoPlayerTests/JPVideoPlayerTests.swift @@ -0,0 +1,14 @@ +import XCTest +@testable import JPVideoPlayer + +final class JPVideoPlayerTests: XCTestCase { + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct + // results. + } + + static var allTests = [ + ("testExample", testExample), + ] +} diff --git a/Tests/JPVideoPlayerTests/XCTestManifests.swift b/Tests/JPVideoPlayerTests/XCTestManifests.swift new file mode 100644 index 0000000..9559f05 --- /dev/null +++ b/Tests/JPVideoPlayerTests/XCTestManifests.swift @@ -0,0 +1,9 @@ +import XCTest + +#if !canImport(ObjectiveC) +public func allTests() -> [XCTestCaseEntry] { + return [ + testCase(JPVideoPlayerTests.allTests), + ] +} +#endif diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift new file mode 100644 index 0000000..f5a5736 --- /dev/null +++ b/Tests/LinuxMain.swift @@ -0,0 +1,7 @@ +import XCTest + +import JPVideoPlayerTests + +var tests = [XCTestCaseEntry]() +tests += JPVideoPlayerTests.allTests() +XCTMain(tests)