Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use BUCK build with a pod that has several files with the same name?

I'm trying to use BUCK with the Realm pod.

I've set up my buck file as:

apple_pod_lib(
    name = "Realm",
    visibility = ["PUBLIC"],
    exported_headers = glob([
        "Realm/**/*.h",
        "Realm/**/*.hpp",
    ]),
    srcs = glob([
        "Realm/**/.{m,mm,cpp}",
    ]),
)

apple_pod_lib(
    name = "RealmSwift",
    visibility = ["PUBLIC"],
    swift_version = "4",
    deps = [
        "//Pods:Realm"
    ],
    srcs = glob([
        "RealmSwift/**/*.swift",
    ]),
)

using the pod macro from Airbnb.

However I can't build my project as this failed with

In target '//Pods:Realm', 'Realm/history.hpp' maps to the following header files:
- /BuckSample/Pods/Realm/include/core/realm/sync/history.hpp
- /BuckSample/Pods/Realm/include/core/realm/history.hpp

Please rename one of them or export one of them to a different path.

I've also tried manually specifying the files & headers to include, looking at the PodSpec from those repos, but I could not get it to work as I was then missing some files for the project to compile in Xcode.

like image 689
Guig Avatar asked Dec 19 '18 07:12

Guig


People also ask

How do I create a pod in Kubernetes?

Then creating the pod from pod.json file by simply using kubectl create -f pod.json command as shown below. You can also verify the pod.json contents by opening the file using our favorite vi editor as shown below. Alternatively you can also use cat pod.json command to view the contents.

How to create a pod in YAML file using Nginx?

You can specify all the resources like name of pod, label, image, ports etc required to create pod in a YAML File and then create it using a single line command. Here we are creating a pod web-app in current namespace using nginx image and container running on Port 80.

How to create a pod web-app using Nginx on port 80?

Here we are creating a pod web-app in current namespace using nginx image and container running on Port 80. After providing all the pod configuration on pod.yaml file, we are creating the pod by using kubectl apply -f pod.yaml command as shown below.


Video Answer


1 Answers

As a workaround, I was able to install the prebuilt framework through Carthage as:

# Cartfile
github "realm/realm-cocoa"

# Carthage/BUCK
prebuilt_apple_framework(
    name = "Realm",
    framework = "Build/iOS/Realm.framework",
    preferred_linkage = "shared",
    visibility = ["PUBLIC"],
)

prebuilt_apple_framework(
    name = "RealmSwift",
    framework = "Build/iOS/RealmSwift.framework",
    preferred_linkage = "shared",
    visibility = ["PUBLIC"],
    deps = [
      ":Realm",
    ]
)

# Where my library is
apple_library(
    name = "LibraryWithRealm",
    visibility = ["PUBLIC"],
    swift_version = "5.0",
    modular = True,
    deps = [
        "//Carthage:RealmSwift",
    ]
)
like image 90
Guig Avatar answered Oct 09 '22 17:10

Guig