Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Swift Package Manager support (Fixes #7047) #7052

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions Package.swift
@@ -0,0 +1,26 @@
// swift-tools-version:4.1
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription

let package = Package(
name: "Protobuf",
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(name: "Protobuf", targets: ["Protobuf"]),
],
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: "Protobuf",
dependencies: [],
path: "objectivec/",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does path, exclude, and sources all work together? There are sources needed that don't live under that sources reference. I don't suppose there's any way to use globs to help cut down on what has to be explicitly listed?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thomasvl unfortunately, no globbing. You can use more explicit sources, or explicit exclude. For example: https://github.com/getsentry/sentry-cocoa/pull/352/files

exclude: ["ProtocolBuffers_OSX.xcodeproj", "ProtocolBuffers_iOS.xcodeproj", "ProtocolBuffers_tvOS.xcodeproj", "DevTools/", "Tests/", ".gitignore", "README.md", "generate_well_known_types.sh"],
sources: ["google/protobuf/"],
publicHeadersPath: "objectivec/"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, how do we test things to be sure things are working? We're also seeing some issue with CocoaPods around case sensitive/case insensitive file systems (#6803) and how it handles the path names. So if we are looking to add SwiftPM support, it would be nice to sure things are working for all setups.

]
)