Skip to content

Improve input/output handling in the gradle plugin #159

@jzbrooks

Description

@jzbrooks

The current api requires you to create all the files before the outputs will be honored due to the semantics of https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileTree.html

Ideally in the conversion scenario, you could specify a path (or paths) that don't yet exist as the output without having to know anything about the input.

vgo {
    outputs = files(project.fileTree(project.projectDir) {
        include("**/res/drawable*/*.xml")
    }.map {
        val file = file("src/main/java/com/jzbrooks/myapplication/icons/${it.nameWithoutExtension}.kt")
        file.parentFile?.mkdirs()
        file.createNewFile()
        file
    }).asFileTree
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions