Apinotes with SPM?

I'm trying to use a C library (libexif) in an SPM package, but as with any C library, it needs some refinement for Swift use. However, I can't seem to get Xcode to pick up my apinotes file.

Package structure:

+- Package.swift
++ Sources
+++ CommandLineTarget
  +- CommandLineTarget.swift
+++ LibExif
  +- LibExif.h
  +- LibExif.apinotes
  +- module.modulemap

package.swift:

    …
    targets: [
        .executableTarget(
            name: "CommandLineTarget",
            dependencies: [
                .product(name: "ArgumentParser", package: "swift-argument-parser"),
                "LibExif",
            ]
        ),
        .systemLibrary(
            name: "LibExif",
            pkgConfig: "libexif",
            providers: [.brew(["libexif", "libiptcdata"])]
        )
    ]
)

Sources/LibExif/LibExif.h

#ifndef Header_h
#define Header_h

#include <libexif/exif-data.h>
#endif /* Header_h */

Sources/LibExif/module.modulemap

module LibExif {
    header "LibExif.h"

    export *
}

Sources/LibExif/LibExif.apinotes

Name: LibExif
Functions:
- Name: exif_content_dump
  SwiftName: 'exifContentDump(content:indent)'
- Name: exif_data_new_from_file
  SwiftPrivate: true

Neither the SwiftName nor the SwiftPrivate annotations are picked up, so it seems LibExif.apinotes is ignored.

Is there anything wrong with my file layout or the apinotes file itself or is apinotes support in SPM just broken?

I think APINotes with SwiftPM has had extremely poor support for years. I was able to get something like this to work with swift-playdate-examples. See: swift-playdate-examples/Sources/CPlaydate/include at main · apple/swift-playdate-examples · GitHub

I'd recommend filing an issue on swift-package-manager with this minimal repro. cc @dschaefer2 for visibility.

Thank you, Rauhul, your repository was one of my main sources for doing this.
Strangely, looking even closer at your repo, I replaced

#ifndef Header_h
#define Header_h

with

#pragma once

and suddenly the compiler told me that exif_data_new_from_file was unavailable. I then also noticed that I had forgotten a colon in my SwiftName. I had written 'exifContentDump(content:indent)' when it should be 'exifContentDump(content:indent:)' and then that was picked up as well.
If I change it back, I also get a warning "/usr/local/Cellar/libexif/0.6.24/include/libexif/exif-content.h:168:6 'swift_name' attribute argument must be a string literal specifying a Swift function name" which previously never surfaced.