Skip to content

Commit

Permalink
Make swift_qrcodejs platform specific depedency
Browse files Browse the repository at this point in the history
- CocoaPods
- SPM (5.3+)

Need to do for Carthage
  • Loading branch information
ApolloZhu committed Nov 4, 2020
1 parent 2313b0c commit 8e1fc66
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 34 deletions.
19 changes: 4 additions & 15 deletions EFQRCode.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,16 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '9.0'
s.osx.deployment_target = '10.10'
s.tvos.deployment_target = '9.0'
s.watchos.deployment_target = '2.0'

s.swift_version = '5.0'
s.requires_arc = true

s.frameworks = 'ImageIO', 'CoreGraphics', 'Foundation'
s.ios.framework = 'CoreImage'
s.osx.framework = 'CoreImage'
s.tvos.framework = 'CoreImage'
s.watchos.dependency 'swift_qrcodejs', '~> 1.2.0'

s.default_subspec = 'Core'

s.subspec 'Core' do |core|
core.source_files = 'Source/**/*.{h,swift}'
end

s.subspec 'watchOS' do |watchos|
watchos.ios.deployment_target = '9.0'
watchos.osx.deployment_target = '10.10'
watchos.tvos.deployment_target = '9.0'
watchos.watchos.deployment_target = '2.0'

watchos.source_files = 'Source/**/*.{h,swift}'
watchos.dependency 'swift_qrcodejs', '~> 1.2.0'
end
s.source_files = 'Source/**/*.{h,swift}'
end
Original file line number Diff line number Diff line change
Expand Up @@ -63,46 +63,33 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/EFQRCode">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5282BCE21FF3AD9000DFB36B"
BuildableName = "watchOS Example.app"
BlueprintName = "watchOS Example"
ReferencedContainer = "container:iOS Example.xcodeproj">
</BuildableReference>
</RemoteRunnable>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/EFQRCode">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5282BCE21FF3AD9000DFB36B"
BuildableName = "watchOS Example.app"
BlueprintName = "watchOS Example"
ReferencedContainer = "container:iOS Example.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5282BCE21FF3AD9000DFB36B"
BuildableName = "watchOS Example.app"
BlueprintName = "watchOS Example"
ReferencedContainer = "container:iOS Example.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
48 changes: 48 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// swift-tools-version:5.3
//
// Package.swift
// EFQRCode
//
// Created by EyreFree on 2017/4/1.
//
// Copyright (c) 2017 EyreFree <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import PackageDescription

let package = Package(
name: "EFQRCode",
products: [
.library(name: "EFQRCode", targets: ["EFQRCode"])
],
dependencies: [
.package(url: "https://github.com/ApolloZhu/swift_qrcodejs.git",
.upToNextMinor(from: "1.2.0"))
],
targets: [
.target(name: "EFQRCode",
dependencies: [
.product(name: "swift_qrcodejs", package: "swift_qrcodejs",
condition: .when(platforms: [.watchOS])),
],
path: "Source")
],
swiftLanguageVersions: [.v5]
)

0 comments on commit 8e1fc66

Please sign in to comment.