Skip to content

Instantly share code, notes, and snippets.

@ilsubyeega
Created July 16, 2022 15:20
Show Gist options
  • Select an option

  • Save ilsubyeega/8dbd941607b9e503fe31a03aabcd1e9d to your computer and use it in GitHub Desktop.

Select an option

Save ilsubyeega/8dbd941607b9e503fe31a03aabcd1e9d to your computer and use it in GitHub Desktop.
This task imports the dependencies of this project and creates a property file at build
tasks.create("createProperties") {
dependsOn("processResources")
doLast {
val propertyFile = file("$buildDir/resources/mccore/versions.properties")
propertyFile.parentFile.mkdirs()
propertyFile.printWriter().use {
val property = Properties()
configurations.compileClasspath.get().allDependencies.forEach { dependency ->
property.setProperty("${dependency.group}:${dependency.name}", "${dependency.version}")
}
property.store(it, "This file shows a version of MCCore's dependencies.")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment