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

[Experimental][Build] Add support for building gyb files #1506

Closed
wants to merge 1 commit into from

Conversation

aciidgh
Copy link
Member

@aciidgh aciidgh commented Feb 23, 2018

This will generate commands to build gyb files if they're present in a
Swift target. Currently, there are no customization available and
the gyb compiler will be looked up in the environment variable "GYB".

I tested this patch with SwiftSyntax on macOS, using this manifest file:

// swift-tools-version:4.0

import PackageDescription

let package = Package(
    name: "SwiftSyntax",
    products: [
        .library(name: "libSwiftSyntax", type: .dynamic, targets: ["SwiftSyntax"]),
    ],
    targets: [
        .target(
            name: "SwiftSyntax", path: ".")
    ]
)

@aciidgh
Copy link
Member Author

aciidgh commented Feb 23, 2018

@ddunbar I hacked up this gyb support but I am not sure if this is something we should actually land. What do you think?

@aciidgh
Copy link
Member Author

aciidgh commented Feb 23, 2018

/cc @harlanhaskins

This will generate commands to build gyb files if they're present in a
Swift target. Currently, there are no customization available and
the gyb compiler will be looked up using the environment variable "GYB".
@harlanhaskins
Copy link
Collaborator

I’ll be honest, I really appreciate you taking the time for this, but I’m generally opposed to gyb leaking outside the swift repo. I wouldn’t want developers attempting to make use of these APIs by copying gyb from apple/swift...

@ddunbar
Copy link
Member

ddunbar commented Feb 23, 2018

Yeah, I don't want to do this. If we want something like this, it should come via extensible build tools.

@harlanhaskins
Copy link
Collaborator

There are a lot of code generators out there. Maybe a customizable preprocessing step for certain build files?

@aciidgh
Copy link
Member Author

aciidgh commented Feb 23, 2018

Thats fair! Instead of supporting this with extensible build tools, maybe we can add support for code generators in general? I think that may be an easier proposal than extensible build tools but OTOH will provide less flexibility.

@aciidgh aciidgh closed this Feb 23, 2018
@aciidgh aciidgh deleted the gyb-support branch February 23, 2018 16:16
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.

None yet

3 participants