Skip to content

Conversation

@patshaughnessy
Copy link
Contributor

Bug/issue #, if applicable: rdar://164210651

Summary

RenderContentMetadata, which is part of the Render JSON schema, doesn’t have a public initializer. This prevents other applications linking to Swift DocC from creating new metadata instances. This change adds a public initializer.

Dependencies

None.

Testing

Write a small Swift CLI executable program that links to Swift DocC, and then test that you can create an instance of RenderContentMetadata using this new public initializer.

let package = Package(
    name: "CreateRenderMetadata",
    platforms: [.macOS(.v15) ],
    dependencies: [
      .package(url: "[email protected]:patshaughnessy/swift-docc.git", branch: "r164210651-add-public-initializer-RenderContentMetadata"),
    ],
    targets: [
        .executableTarget(
            name: "CreateRenderMetadata",
            dependencies: [
                .product(name: "SwiftDocC", package: "swift-docc")
            ]
        ),
    ]
)
import SwiftDocC

@main
struct CreateRenderMetadata {
    static func main() {
        print("Hello, world!")
        let metadata = RenderContentMetadata()
        print(metadata)
    }
}

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded

@patshaughnessy
Copy link
Contributor Author

@swift-ci please test

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

Successfully merging this pull request may close these issues.

3 participants