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

Pre-build dependencies during the install phase #5

Open
orta opened this issue Nov 25, 2018 · 0 comments
Open

Pre-build dependencies during the install phase #5

orta opened this issue Nov 25, 2018 · 0 comments

Comments

@orta
Copy link
Member

orta commented Nov 25, 2018

#if canImport(PackageConfig)
    import PackageConfig

    let config = PackageConfig([
        "komondor": [
            "pre-push": "swift test",
            "pre-commit": [
                "swift test",
                "swift run swiftFormat .",
                "swift run swiftlint autocorrect --path Sources/",
                "git add .",
            ],
        ],
    ])
#endif

From this we can derive that swift run swiftlint and swift run swiftFormat rely on swift packages.

Komondor can batch look in the building folder to see if there are .build/*/[name].product but not .build/*/[name] and use swift build --product [name] to built them.

See sourcekitten, swiftFormat and swiftlint:

 ~/d/p/d/Komondor  $ ls .build/x86_64-apple-macosx10.10/debug/                                                                                                          master
CYaml.build                    KomondorPackageTests.product   Result.swiftmodule             SwiftyTextTable.swiftdoc       libPackageConfig.dylib
Clang_C.build                  ModuleCache                    SWXMLHash.build                SwiftyTextTable.swiftmodule    libPackageConfig.dylib.dSYM
Commandant.build               PackageConfig.build            SWXMLHash.swiftdoc             Yams.build                     package-config-example.product
Commandant.swiftdoc            PackageConfig.product          SWXMLHash.swiftmodule          Yams.swiftdoc                  sourcekitten.product
Commandant.swiftmodule         PackageConfig.swiftdoc         ShellOut.build                 Yams.swiftmodule               swiftFormat.product
CryptoSwift.build              PackageConfig.swiftmodule      ShellOut.swiftdoc              index                          swiftlint.product
Komondor.build                 QuickSpecBase.build            ShellOut.swiftmodule           komondor
Komondor.swiftdoc              Result.build                   SourceKit.build                komondor.dSYM
Komondor.swiftmodule           Result.swiftdoc                SwiftyTextTable.build          komondor.product
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

No branches or pull requests

1 participant