Created
July 16, 2022 15:20
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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