bazel-xcode / PodToBUILD

An easy way to integrate CocoaPods into Bazel
Apache License 2.0
323 stars 69 forks source link

can't get AnyCodable to work #225

Open johndpope opened 1 year ago

johndpope commented 1 year ago

I try this https://github.com/wweevv-johndpope/MinimalBazelFrameworkDemo

Podfile

pod install

project 'MinimalBazelFrameworkDemo.xcodeproj' target 'MinimalBazelFrameworkDemo' do pod "AnyCodable" end

Pods.WORKSPACE

new_pod_repository(
  name = "AnyCodable",
  podspec_url = "https://github.com/Flight-School/AnyCodable/blob/master/AnyCodable-FlightSchool.podspec",
  url = "https://github.com/Flight-School/AnyCodable/archive/refs/tags/0.6.5.zip",
  is_dynamic_framework = True,  # AmazonIVSPlayer is dynamic XCFramework
  is_xcframework = True
)

fails

this isn't json extension - how do I get it to transform?


new_pod_repository(
  name = "AnyCodable",
  podspec_url = "Vendor/AnyCodable/AnyCodable-0.6.5/AnyCodable-FlightSchool.podspec",
  url = "https://github.com/Flight-School/AnyCodable/archive/refs/tags/0.6.5.zip",
  is_dynamic_framework = True,  # AmazonIVSPlayer is dynamic XCFramework
  is_xcframework = True
)

I attempt to extract podspec to json and feed it in shell pod ipc spec /Users/johndpope/Documents/gitWorkspace/MinimalBazelFrameworkDemo/Vendor/AnyCodable/AnyCodable-0.6.5/AnyCodable-FlightSchool.podspec > test.json

no joy

test.json


{
  "name": "AnyCodable-FlightSchool",
  "module_name": "AnyCodable",
  "version": "0.6.5",
  "summary": "Type-erased wrappers for Encodable, Decodable, and Codable values.",
  "description": "This functionality is discussed in Chapter 3 of Flight School Guide to Swift Codable.",
  "homepage": "https://flight.school/books/codable/",
  "license": {
    "type": "MIT",
    "file": "LICENSE.md"
  },
  "authors": {
    "Mattt": "mattt@flight.school"
  },
  "social_media_url": "https://twitter.com/mattt",
  "frameworks": "Foundation",
  "platforms": {
    "ios": "9.0",
    "osx": "10.10",
    "watchos": "2.0",
    "tvos": "9.0"
  },
  "source": {
    "git": "https://github.com/Flight-School/AnyCodable.git",
    "tag": "0.6.5"
  },
  "source_files": "Sources/**/*.swift",
  "swift_versions": "5.1",
  "swift_version": "5.1"
}

new_pod_repository(
  name = "AnyCodable",
  podspec_url = "/test.json",
  url = "https://github.com/Flight-School/AnyCodable/archive/refs/tags/0.6.5.zip",
  is_dynamic_framework = True,  
  is_xcframework = True
)
Screen Shot 2022-09-03 at 11 07 55 pm

I fork repo - rename the podspec file create a release -publish then specify this repo


new_pod_repository(
  name = "AnyCodable",
  url = "https://github.com/johndpope/AnyCodable/archive/refs/tags/1.0.1.zip",
  is_dynamic_framework = True,  # AmazonIVSPlayer is dynamic XCFramework
  is_xcframework = True
)

I can see the files correctly checkout

Screen Shot 2022-09-03 at 11 18 48 pm

why????

Screen Shot 2022-09-03 at 11 19 23 pm

I put the podspec in the root of repo - doesn't help - same error.

Screen Shot 2022-09-03 at 11 22 09 pm

I also altered the podspec contents to make sure the source is pointing to new repo - still not working... https://github.com/johndpope/AnyCodable/blob/master/AnyCodable.podspec#L26

fyi


http_archive(
    name = "rules_pods",
    urls = ["https://github.com/pinterest/PodToBUILD/releases/download/4.1.0-412495/PodToBUILD.zip"],
)
# Load the new_pod_repository macro - needed for `WORKSPACE` usage
load("@rules_pods//BazelExtensions:workspace.bzl", "new_pod_repository")