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

[gradle] Add a customization for resources directories. #5016

Merged
merged 1 commit into from
Jun 25, 2024
Merged

Conversation

terrakok
Copy link
Collaborator

@terrakok terrakok commented Jun 24, 2024

With the new API it is possible to customize compose resources directories. For example:

abstract class GenerateAndroidRes : DefaultTask() {
    @get:Inject
    abstract val layout: ProjectLayout

    @get:OutputDirectory
    val outputDir = layout.buildDirectory.dir("generatedAndroidResources")

    @TaskAction
    fun run() {...}
}
compose.resources {
    customDirectory(
        sourceSetName = "androidMain",
        directoryProvider = tasks.register<GenerateAndroidRes>("generateAndroidRes").map { it.outputDir.get() }
    )
    customDirectory(
        sourceSetName = "desktopMain",
        directoryProvider = provider { layout.projectDirectory.dir("desktopResources") }
    )
}

Fixes #4718
Fixes #4564

Release Notes

Features - Resources

  • Add a customization for resources directories. Now it is possible to use e.g downloaded resources.

@terrakok terrakok merged commit c86df61 into master Jun 25, 2024
12 checks passed
@terrakok terrakok deleted the k.tskh/4718 branch June 25, 2024 08:57
@igordmn
Copy link
Collaborator

igordmn commented Jul 1, 2024

The new API looks good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants