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

bazel + spm #42

Closed
wweevv-johndpope opened this issue Aug 29, 2022 · 1 comment
Closed

bazel + spm #42

wweevv-johndpope opened this issue Aug 29, 2022 · 1 comment

Comments

@wweevv-johndpope
Copy link

wweevv-johndpope commented Aug 29, 2022

it's possible to use spm + bazel with some scripts by @cgrindel

I want to do it with firebase - there's a long discussion here - and Google haven't been able to come to the party....
I'm thinking with your xcframework approach - it maybe possible.
I don't expect you to invest too much time -
firebase/firebase-ios-sdk#6115

here's a top level write up with spm + bazel
https://chuckgrindel.com/swift-packages-in-bazel

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "cgrindel_rules_spm",
    sha256 = "03718eb865a100ba4449ebcbca6d97bf6ea78fa17346ce6d55532312e8bf9aa8",
    strip_prefix = "rules_spm-0.11.0",
    urls = [
        "http://github.com/cgrindel/rules_spm/archive/v0.11.0.tar.gz",
    ],
)

load(
    "@cgrindel_rules_spm//spm:deps.bzl",
    "spm_rules_dependencies",
)

spm_rules_dependencies()

load(
    "@build_bazel_rules_swift//swift:repositories.bzl",
    "swift_rules_dependencies",
)

swift_rules_dependencies()

load(
    "@build_bazel_rules_swift//swift:extras.bzl",
    "swift_rules_extra_dependencies",
)

swift_rules_extra_dependencies()


load("@cgrindel_rules_spm//spm:defs.bzl", "spm_pkg", "spm_repositories")

spm_repositories(
    name = "swift_pkgs",
    dependencies = [
        spm_pkg(
            "https://github.com/firebase/firebase-ios-sdk.git",
            from_version = "8.10.0",
            products = ["Firebase"],
        ),
    ],
)

unfortunately -


spm_repositories(
    name = "swift_pkgs",
    dependencies = [
        spm_pkg(
            "https://github.com/akaffenberger/firebase-ios-sdk-xcframeworks.git",
            from_version = "8.10.0",
            products = ["Firebase"],
        ),
    ],
)

couldn't get it to work with your spm either.

"@swift_pkgs//Firebase:Firebase",

@wweevv-johndpope
Copy link
Author

wweevv-johndpope commented Aug 29, 2022

I got it working - but it's not as elegant as your solution using xcframeworks.
would be nice to automate.

UPDATE - had to use this route instead
https://github.com/vikage/DemoBazel/tree/firebase

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

1 participant