How do you use one subspec as the dependency of another subspec with cocoapods?
I'm trying to create a podspec for vapor/core. It already has a Swift Package Manager manifest file so I'm basing the podspec of of that.
Package.swift:
// swift-tools-version:4.0
import PackageDescription
let package = Package(
name: "Core",
products: [
.library(name: "Async", targets: ["Async"]),
.library(name: "Bits", targets: ["Bits"]),
.library(name: "Core", targets: ["Core"]),
.library(name: "COperatingSystem", targets: ["COperatingSystem"]),
.library(name: "Debugging", targets: ["Debugging"]),
],
dependencies: [
/// Event-driven network application framework for high performance protocol servers & clients, non-blocking.
.package(url: "https://github.com/apple/swift-nio.git", from: "1.8.0"),
],
targets: [
.target(name: "Async", dependencies: ["NIO"]),
.testTarget(name: "AsyncTests", dependencies: ["Async"]),
.target(name: "Bits", dependencies: ["Debugging", "NIO"]),
.testTarget(name: "BitsTests", dependencies: ["Bits", "NIO"]),
.target(name: "Core", dependencies: ["Async", "Bits", "COperatingSystem", "Debugging", "NIOFoundationCompat"]),
.testTarget(name: "CoreTests", dependencies: ["Core"]),
.target(name: "COperatingSystem"),
.target(name: "Debugging"),
.testTarget(name: "DebuggingTests", dependencies: ["Debugging"]),
]
)
I think what I want to do is create a subspec
for each non-test target, although I'm not sure that's correct, so please correct me if that's wrong. This is what I've got for Core.podspec:
Pod::Spec.new do |s|
s.name = "Core"
s.version = "3.4.4"
s.summary = "🌎 Utility package containing tools for byte manipulation, Codable, OS APIs, and debugging."
s.description = <<-DESC
Utility package containing tools for byte manipulation, Codable, OS APIs, and debugging.
DESC
s.homepage = "https://github.com/vapor/core"
s.license = :type => "MIT", :file => "LICENSE.txt"
s.author = "Tanner Nelson" => ""
s.ios.deployment_target = "10.0"
s.source = :git => "https://github.com/twof/core.git", :branch => "master"
s.source_files = "Sources/**/*.swift"
s.exclude_files = [
'Pods/**'
]
s.module_name = "Core"
s.swift_version = "4.2"
s.dependency 'SwiftNIO'
s.subspec 'Debugging' do |debug|
debug.source_files = 'Sources/Debugging/**/*.swift'
end
s.subspec 'Async' do |async|
async.dependency 'SwiftNIO'
async.source_files = 'Sources/Async/**/*.swift'
end
s.subspec 'Bits' do |bits|
bits.dependency 'SwiftNIO'
bits.dependency 'Core/Debugging'
bits.source_files = 'Sources/Bits/**/*.swift'
end
s.subspec 'COperatingSystem' do |os|
os.source_files = 'Sources/COperatingSystem/**/*.swift'
end
s.subspec 'Core' do |core|
core.source_files = "Sources/Core/**/*.swift"
core.dependency 'Core/Debugging'
core.dependency 'Core/Async'
core.dependency 'Core/Bits'
core.dependency 'Core/COperatingSystem'
core.dependency 'SwiftNIOFoundationCompat'
end
end
However, the above fails linting with the following errors
-> Core (3.4.4)
- ERROR | [Core/Bits,Core/Core] xcodebuild: Returned an unsuccessful exit code.
- ERROR | [Core/Bits,Core/Core] xcodebuild: Core/Sources/Bits/BitsError.swift:1:8: error: no such module 'Debugging'
It seems like Core/Debugging
is not being used as a dependency for Core/Bits
and Core/Core
, and I can't tell why that is. If it helps, you can find the full output of pod spec lint Core.podspec --verbose
here.
ios swift cocoapods
|
show 1 more comment
I'm trying to create a podspec for vapor/core. It already has a Swift Package Manager manifest file so I'm basing the podspec of of that.
Package.swift:
// swift-tools-version:4.0
import PackageDescription
let package = Package(
name: "Core",
products: [
.library(name: "Async", targets: ["Async"]),
.library(name: "Bits", targets: ["Bits"]),
.library(name: "Core", targets: ["Core"]),
.library(name: "COperatingSystem", targets: ["COperatingSystem"]),
.library(name: "Debugging", targets: ["Debugging"]),
],
dependencies: [
/// Event-driven network application framework for high performance protocol servers & clients, non-blocking.
.package(url: "https://github.com/apple/swift-nio.git", from: "1.8.0"),
],
targets: [
.target(name: "Async", dependencies: ["NIO"]),
.testTarget(name: "AsyncTests", dependencies: ["Async"]),
.target(name: "Bits", dependencies: ["Debugging", "NIO"]),
.testTarget(name: "BitsTests", dependencies: ["Bits", "NIO"]),
.target(name: "Core", dependencies: ["Async", "Bits", "COperatingSystem", "Debugging", "NIOFoundationCompat"]),
.testTarget(name: "CoreTests", dependencies: ["Core"]),
.target(name: "COperatingSystem"),
.target(name: "Debugging"),
.testTarget(name: "DebuggingTests", dependencies: ["Debugging"]),
]
)
I think what I want to do is create a subspec
for each non-test target, although I'm not sure that's correct, so please correct me if that's wrong. This is what I've got for Core.podspec:
Pod::Spec.new do |s|
s.name = "Core"
s.version = "3.4.4"
s.summary = "🌎 Utility package containing tools for byte manipulation, Codable, OS APIs, and debugging."
s.description = <<-DESC
Utility package containing tools for byte manipulation, Codable, OS APIs, and debugging.
DESC
s.homepage = "https://github.com/vapor/core"
s.license = :type => "MIT", :file => "LICENSE.txt"
s.author = "Tanner Nelson" => ""
s.ios.deployment_target = "10.0"
s.source = :git => "https://github.com/twof/core.git", :branch => "master"
s.source_files = "Sources/**/*.swift"
s.exclude_files = [
'Pods/**'
]
s.module_name = "Core"
s.swift_version = "4.2"
s.dependency 'SwiftNIO'
s.subspec 'Debugging' do |debug|
debug.source_files = 'Sources/Debugging/**/*.swift'
end
s.subspec 'Async' do |async|
async.dependency 'SwiftNIO'
async.source_files = 'Sources/Async/**/*.swift'
end
s.subspec 'Bits' do |bits|
bits.dependency 'SwiftNIO'
bits.dependency 'Core/Debugging'
bits.source_files = 'Sources/Bits/**/*.swift'
end
s.subspec 'COperatingSystem' do |os|
os.source_files = 'Sources/COperatingSystem/**/*.swift'
end
s.subspec 'Core' do |core|
core.source_files = "Sources/Core/**/*.swift"
core.dependency 'Core/Debugging'
core.dependency 'Core/Async'
core.dependency 'Core/Bits'
core.dependency 'Core/COperatingSystem'
core.dependency 'SwiftNIOFoundationCompat'
end
end
However, the above fails linting with the following errors
-> Core (3.4.4)
- ERROR | [Core/Bits,Core/Core] xcodebuild: Returned an unsuccessful exit code.
- ERROR | [Core/Bits,Core/Core] xcodebuild: Core/Sources/Bits/BitsError.swift:1:8: error: no such module 'Debugging'
It seems like Core/Debugging
is not being used as a dependency for Core/Bits
and Core/Core
, and I can't tell why that is. If it helps, you can find the full output of pod spec lint Core.podspec --verbose
here.
ios swift cocoapods
1
Have you tried using justbits.dependency 'Debugging'
?
– zero3nna
Nov 15 '18 at 8:17
'Debugging' points to this pod: cocoapods.org/pods/Debugging unfortunately
– TWOF
Nov 15 '18 at 18:47
How does your podfile look like? You have to specify your Source first, if you are using private pods.source 'https://github.com/me/my-podspecs.git'
This way its looking for your pods first and you shouldnt run into naming problems
– zero3nna
Nov 16 '18 at 8:00
Can you explain what podfile you're talking about? I thought I'd just need the podspec in order to publish.
– TWOF
Nov 18 '18 at 5:28
Nvm, I thougt of something different but you are not trying to integrate the pod into a project yet. But your first attempt was right, itsCore/Debugging
otherwise you get these namespace collisions.
– zero3nna
Nov 19 '18 at 8:50
|
show 1 more comment
I'm trying to create a podspec for vapor/core. It already has a Swift Package Manager manifest file so I'm basing the podspec of of that.
Package.swift:
// swift-tools-version:4.0
import PackageDescription
let package = Package(
name: "Core",
products: [
.library(name: "Async", targets: ["Async"]),
.library(name: "Bits", targets: ["Bits"]),
.library(name: "Core", targets: ["Core"]),
.library(name: "COperatingSystem", targets: ["COperatingSystem"]),
.library(name: "Debugging", targets: ["Debugging"]),
],
dependencies: [
/// Event-driven network application framework for high performance protocol servers & clients, non-blocking.
.package(url: "https://github.com/apple/swift-nio.git", from: "1.8.0"),
],
targets: [
.target(name: "Async", dependencies: ["NIO"]),
.testTarget(name: "AsyncTests", dependencies: ["Async"]),
.target(name: "Bits", dependencies: ["Debugging", "NIO"]),
.testTarget(name: "BitsTests", dependencies: ["Bits", "NIO"]),
.target(name: "Core", dependencies: ["Async", "Bits", "COperatingSystem", "Debugging", "NIOFoundationCompat"]),
.testTarget(name: "CoreTests", dependencies: ["Core"]),
.target(name: "COperatingSystem"),
.target(name: "Debugging"),
.testTarget(name: "DebuggingTests", dependencies: ["Debugging"]),
]
)
I think what I want to do is create a subspec
for each non-test target, although I'm not sure that's correct, so please correct me if that's wrong. This is what I've got for Core.podspec:
Pod::Spec.new do |s|
s.name = "Core"
s.version = "3.4.4"
s.summary = "🌎 Utility package containing tools for byte manipulation, Codable, OS APIs, and debugging."
s.description = <<-DESC
Utility package containing tools for byte manipulation, Codable, OS APIs, and debugging.
DESC
s.homepage = "https://github.com/vapor/core"
s.license = :type => "MIT", :file => "LICENSE.txt"
s.author = "Tanner Nelson" => ""
s.ios.deployment_target = "10.0"
s.source = :git => "https://github.com/twof/core.git", :branch => "master"
s.source_files = "Sources/**/*.swift"
s.exclude_files = [
'Pods/**'
]
s.module_name = "Core"
s.swift_version = "4.2"
s.dependency 'SwiftNIO'
s.subspec 'Debugging' do |debug|
debug.source_files = 'Sources/Debugging/**/*.swift'
end
s.subspec 'Async' do |async|
async.dependency 'SwiftNIO'
async.source_files = 'Sources/Async/**/*.swift'
end
s.subspec 'Bits' do |bits|
bits.dependency 'SwiftNIO'
bits.dependency 'Core/Debugging'
bits.source_files = 'Sources/Bits/**/*.swift'
end
s.subspec 'COperatingSystem' do |os|
os.source_files = 'Sources/COperatingSystem/**/*.swift'
end
s.subspec 'Core' do |core|
core.source_files = "Sources/Core/**/*.swift"
core.dependency 'Core/Debugging'
core.dependency 'Core/Async'
core.dependency 'Core/Bits'
core.dependency 'Core/COperatingSystem'
core.dependency 'SwiftNIOFoundationCompat'
end
end
However, the above fails linting with the following errors
-> Core (3.4.4)
- ERROR | [Core/Bits,Core/Core] xcodebuild: Returned an unsuccessful exit code.
- ERROR | [Core/Bits,Core/Core] xcodebuild: Core/Sources/Bits/BitsError.swift:1:8: error: no such module 'Debugging'
It seems like Core/Debugging
is not being used as a dependency for Core/Bits
and Core/Core
, and I can't tell why that is. If it helps, you can find the full output of pod spec lint Core.podspec --verbose
here.
ios swift cocoapods
I'm trying to create a podspec for vapor/core. It already has a Swift Package Manager manifest file so I'm basing the podspec of of that.
Package.swift:
// swift-tools-version:4.0
import PackageDescription
let package = Package(
name: "Core",
products: [
.library(name: "Async", targets: ["Async"]),
.library(name: "Bits", targets: ["Bits"]),
.library(name: "Core", targets: ["Core"]),
.library(name: "COperatingSystem", targets: ["COperatingSystem"]),
.library(name: "Debugging", targets: ["Debugging"]),
],
dependencies: [
/// Event-driven network application framework for high performance protocol servers & clients, non-blocking.
.package(url: "https://github.com/apple/swift-nio.git", from: "1.8.0"),
],
targets: [
.target(name: "Async", dependencies: ["NIO"]),
.testTarget(name: "AsyncTests", dependencies: ["Async"]),
.target(name: "Bits", dependencies: ["Debugging", "NIO"]),
.testTarget(name: "BitsTests", dependencies: ["Bits", "NIO"]),
.target(name: "Core", dependencies: ["Async", "Bits", "COperatingSystem", "Debugging", "NIOFoundationCompat"]),
.testTarget(name: "CoreTests", dependencies: ["Core"]),
.target(name: "COperatingSystem"),
.target(name: "Debugging"),
.testTarget(name: "DebuggingTests", dependencies: ["Debugging"]),
]
)
I think what I want to do is create a subspec
for each non-test target, although I'm not sure that's correct, so please correct me if that's wrong. This is what I've got for Core.podspec:
Pod::Spec.new do |s|
s.name = "Core"
s.version = "3.4.4"
s.summary = "🌎 Utility package containing tools for byte manipulation, Codable, OS APIs, and debugging."
s.description = <<-DESC
Utility package containing tools for byte manipulation, Codable, OS APIs, and debugging.
DESC
s.homepage = "https://github.com/vapor/core"
s.license = :type => "MIT", :file => "LICENSE.txt"
s.author = "Tanner Nelson" => ""
s.ios.deployment_target = "10.0"
s.source = :git => "https://github.com/twof/core.git", :branch => "master"
s.source_files = "Sources/**/*.swift"
s.exclude_files = [
'Pods/**'
]
s.module_name = "Core"
s.swift_version = "4.2"
s.dependency 'SwiftNIO'
s.subspec 'Debugging' do |debug|
debug.source_files = 'Sources/Debugging/**/*.swift'
end
s.subspec 'Async' do |async|
async.dependency 'SwiftNIO'
async.source_files = 'Sources/Async/**/*.swift'
end
s.subspec 'Bits' do |bits|
bits.dependency 'SwiftNIO'
bits.dependency 'Core/Debugging'
bits.source_files = 'Sources/Bits/**/*.swift'
end
s.subspec 'COperatingSystem' do |os|
os.source_files = 'Sources/COperatingSystem/**/*.swift'
end
s.subspec 'Core' do |core|
core.source_files = "Sources/Core/**/*.swift"
core.dependency 'Core/Debugging'
core.dependency 'Core/Async'
core.dependency 'Core/Bits'
core.dependency 'Core/COperatingSystem'
core.dependency 'SwiftNIOFoundationCompat'
end
end
However, the above fails linting with the following errors
-> Core (3.4.4)
- ERROR | [Core/Bits,Core/Core] xcodebuild: Returned an unsuccessful exit code.
- ERROR | [Core/Bits,Core/Core] xcodebuild: Core/Sources/Bits/BitsError.swift:1:8: error: no such module 'Debugging'
It seems like Core/Debugging
is not being used as a dependency for Core/Bits
and Core/Core
, and I can't tell why that is. If it helps, you can find the full output of pod spec lint Core.podspec --verbose
here.
ios swift cocoapods
ios swift cocoapods
asked Nov 15 '18 at 7:22
TWOFTWOF
125111
125111
1
Have you tried using justbits.dependency 'Debugging'
?
– zero3nna
Nov 15 '18 at 8:17
'Debugging' points to this pod: cocoapods.org/pods/Debugging unfortunately
– TWOF
Nov 15 '18 at 18:47
How does your podfile look like? You have to specify your Source first, if you are using private pods.source 'https://github.com/me/my-podspecs.git'
This way its looking for your pods first and you shouldnt run into naming problems
– zero3nna
Nov 16 '18 at 8:00
Can you explain what podfile you're talking about? I thought I'd just need the podspec in order to publish.
– TWOF
Nov 18 '18 at 5:28
Nvm, I thougt of something different but you are not trying to integrate the pod into a project yet. But your first attempt was right, itsCore/Debugging
otherwise you get these namespace collisions.
– zero3nna
Nov 19 '18 at 8:50
|
show 1 more comment
1
Have you tried using justbits.dependency 'Debugging'
?
– zero3nna
Nov 15 '18 at 8:17
'Debugging' points to this pod: cocoapods.org/pods/Debugging unfortunately
– TWOF
Nov 15 '18 at 18:47
How does your podfile look like? You have to specify your Source first, if you are using private pods.source 'https://github.com/me/my-podspecs.git'
This way its looking for your pods first and you shouldnt run into naming problems
– zero3nna
Nov 16 '18 at 8:00
Can you explain what podfile you're talking about? I thought I'd just need the podspec in order to publish.
– TWOF
Nov 18 '18 at 5:28
Nvm, I thougt of something different but you are not trying to integrate the pod into a project yet. But your first attempt was right, itsCore/Debugging
otherwise you get these namespace collisions.
– zero3nna
Nov 19 '18 at 8:50
1
1
Have you tried using just
bits.dependency 'Debugging'
?– zero3nna
Nov 15 '18 at 8:17
Have you tried using just
bits.dependency 'Debugging'
?– zero3nna
Nov 15 '18 at 8:17
'Debugging' points to this pod: cocoapods.org/pods/Debugging unfortunately
– TWOF
Nov 15 '18 at 18:47
'Debugging' points to this pod: cocoapods.org/pods/Debugging unfortunately
– TWOF
Nov 15 '18 at 18:47
How does your podfile look like? You have to specify your Source first, if you are using private pods.
source 'https://github.com/me/my-podspecs.git'
This way its looking for your pods first and you shouldnt run into naming problems– zero3nna
Nov 16 '18 at 8:00
How does your podfile look like? You have to specify your Source first, if you are using private pods.
source 'https://github.com/me/my-podspecs.git'
This way its looking for your pods first and you shouldnt run into naming problems– zero3nna
Nov 16 '18 at 8:00
Can you explain what podfile you're talking about? I thought I'd just need the podspec in order to publish.
– TWOF
Nov 18 '18 at 5:28
Can you explain what podfile you're talking about? I thought I'd just need the podspec in order to publish.
– TWOF
Nov 18 '18 at 5:28
Nvm, I thougt of something different but you are not trying to integrate the pod into a project yet. But your first attempt was right, its
Core/Debugging
otherwise you get these namespace collisions.– zero3nna
Nov 19 '18 at 8:50
Nvm, I thougt of something different but you are not trying to integrate the pod into a project yet. But your first attempt was right, its
Core/Debugging
otherwise you get these namespace collisions.– zero3nna
Nov 19 '18 at 8:50
|
show 1 more comment
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314282%2fhow-do-you-use-one-subspec-as-the-dependency-of-another-subspec-with-cocoapods%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314282%2fhow-do-you-use-one-subspec-as-the-dependency-of-another-subspec-with-cocoapods%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Have you tried using just
bits.dependency 'Debugging'
?– zero3nna
Nov 15 '18 at 8:17
'Debugging' points to this pod: cocoapods.org/pods/Debugging unfortunately
– TWOF
Nov 15 '18 at 18:47
How does your podfile look like? You have to specify your Source first, if you are using private pods.
source 'https://github.com/me/my-podspecs.git'
This way its looking for your pods first and you shouldnt run into naming problems– zero3nna
Nov 16 '18 at 8:00
Can you explain what podfile you're talking about? I thought I'd just need the podspec in order to publish.
– TWOF
Nov 18 '18 at 5:28
Nvm, I thougt of something different but you are not trying to integrate the pod into a project yet. But your first attempt was right, its
Core/Debugging
otherwise you get these namespace collisions.– zero3nna
Nov 19 '18 at 8:50