DEV Community

Query Filter
Query Filter

Posted on

gradle-75

tasks.register('inspectExternalManifest') {
    description = "Reads and logs the contents of the generated external manifest.json"
    group = "reporting"

    def manifestFile = layout.buildDirectory.file("distributions/${manifestFileName}")
    inputs.file(manifestFile).optional()

    doLast {
        File f = manifestFile.get().asFile
        if (f.exists()) {
            logger.lifecycle("********************************************************************************")
            logger.lifecycle("--- External Manifest Inspection (${f.name}) ---")
            logger.lifecycle("Location: ${f.absolutePath}")
            logger.lifecycle("--------------------------------------------------------------------------------")
            logger.lifecycle(f.text)
            logger.lifecycle("********************************************************************************")
        } else {
            logger.warn("External manifest file not found at: ${f.absolutePath}")
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)