import groovy.json.JsonOutput
def generateManifest(String archivePath) {
File archiveFile = new File(archivePath)
// Ensure build/distributions directory exists
File distributionsDir = file("$buildDir/distributions")
if (!distributionsDir.exists()) {
distributionsDir.mkdirs()
}
File manifestFile = new File(distributionsDir, "manifest.json")
def manifestData = [
archive_name : archiveFile.name,
archive_path : archiveFile.absolutePath,
archive_size : archiveFile.length(),
project_name : project.name,
version : project.version.toString(),
build_date : new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(new Date())
]
manifestFile.text = JsonOutput.prettyPrint(JsonOutput.toJson(manifestData))
logger.lifecycle("Manifest successfully generated at: ${manifestFile.absolutePath}")
}
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)