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

Added "SourceryLib" product to Package.swift #1170

Conversation

art-divin
Copy link
Collaborator

In order to facilitate importing of SourceryLib when Sourcery and Configuration types are needed,
"SourceryLib" product needs to be exposed.

Example:

import SourceryLib
import PathKit

public struct SourceryUseExample {
    public private(set) var text = "Hello, World!"

    public init() throws {
        let sourcery = Sourcery()
        let configuration = try Configuration(path: Path(), relativePath: Path())
        let watchers = try sourcery.processFiles(configuration.source, usingTemplates: configuration.templates, output: configuration.output, baseIndentation: configuration.baseIndentation)
        // use [FolderWatcher.Local] ...
    }
}

Here, user of SourceryLib can implement custom additonal post-processing, as well as use different techniques around calls to Sourcery as compared to using compiled executable when these types are inaccessible, as well as SouceryFramework which does not expose these types does not help in achieving such uses.

@krzysztofzablocki krzysztofzablocki merged commit 56c4b08 into krzysztofzablocki:master Jul 1, 2023
@art-divin art-divin deleted the expose-sourcerylib-product branch July 3, 2023 18:58
@art-divin art-divin self-assigned this Jul 23, 2023
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.

2 participants