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

Missin SPM Integration #29

Open
RolandasRazma opened this issue Jun 17, 2021 · 4 comments
Open

Missin SPM Integration #29

RolandasRazma opened this issue Jun 17, 2021 · 4 comments

Comments

@RolandasRazma
Copy link

Would be nice to have SPM Integration

@bas9990
Copy link

bas9990 commented Jan 11, 2022

Hey! Yes, we would like that. Should I contact my account manager? or will you read this request as well?

@bart-kneepkens
Copy link

bart-kneepkens commented Aug 26, 2022

@RolandasRazma what worked for us is to simply take the 4 (2 headers, 2 source) files from this repo and add them to your project manually - just make sure not to forget the bridging header. I hope you're not waiting for Segment to add SPM support because by the looks of it, they're not maintaining this at all.

@krin-san
Copy link

There's already a fork with a good looking Package.swift file: https://github.com/dotswift/analytics-ios-integration-adjust

I constructed somewhat similar file, keeping the target & product name in sync with an https://github.com/Appboy/appboy-segment-ios integration:

// swift-tools-version: 5.6

import PackageDescription

let package = Package(
    name: "Segment-Adjust",
    defaultLocalization: "en",
    platforms: [
        .iOS(.v12)
    ],
    products: [
        .library(name: "AdjustSegment", targets: ["AdjustSegment"])
    ],
    dependencies: [
        .package(url: "https://github.com/segmentio/analytics-ios.git", from: "4.1.0"),
        .package(url: "https://github.com/adjust/ios_sdk.git", from: "4.29.3")
    ],
    targets: [
        .target(
            name: "AdjustSegment",
            dependencies: [
                .product(name: "Segment", package: "analytics-ios"),
                .product(name: "Adjust", package: "ios_sdk")
            ],
            path: "Pod/",
            sources: ["Classes"],
            publicHeadersPath: "Classes",
            cSettings: [
                .headerSearchPath("Classes")
            ],
            linkerSettings: [
                .unsafeFlags(["-ObjC"])
            ]
        )
    ]
)

Unfortunately I had to add an unsafe -ObjC linker flag to fix the [ABKPersistentData configureForDataVersioning] unrecognized selector sent to instance crash. And having an unsafe flag makes this package only usable via branch or path arguments:

.package(url: "<URL>/analytics-ios-integration-adjust.git", branch: "spm") // OK
.package(name: "analytics-ios-integration-adjust", path: "../<DIR>") // OK
.package(url: "<URL>/analytics-ios-integration-adjust.git", from: "<VERSION>") // the target 'AdjustSegment' in project 'AdjustSegment' contains unsafe build flags

@Saulenco
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants