-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
65 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package voodoo.cli | ||
|
||
import com.github.ajalt.clikt.core.CliktCommand | ||
import com.github.ajalt.clikt.core.requireObject | ||
import kotlinx.coroutines.runBlocking | ||
import kotlinx.coroutines.slf4j.MDCContext | ||
import mu.KotlinLogging | ||
import mu.withLoggingContext | ||
import voodoo.util.maven.MavenUtil | ||
import voodoo.voodoo.GeneratedConstants | ||
import java.io.StringWriter | ||
import java.util.* | ||
|
||
class UpdateCommand : CliktCommand( | ||
name = "update", | ||
help = "updates the version of voodoo" | ||
) { | ||
private val logger = KotlinLogging.logger {} | ||
val cliContext by requireObject<CLIContext>() | ||
|
||
override fun run(): Unit = withLoggingContext("command" to commandName) { | ||
val rootDir = cliContext.rootDir | ||
|
||
runBlocking(MDCContext()) { | ||
val propertiesFile = rootDir.resolve("wrapper/wrapper.properties") | ||
propertiesFile.absoluteFile.parentFile.mkdirs() | ||
|
||
val properties = Properties().also { prop -> | ||
propertiesFile.bufferedReader().use { | ||
prop.load(it) | ||
} | ||
} | ||
|
||
val version = MavenUtil.getLatestVersionFromMavenMetadata( | ||
GeneratedConstants.MAVEN_URL, | ||
GeneratedConstants.MAVEN_GROUP, | ||
"voodoo" | ||
) | ||
val groupPath = GeneratedConstants.MAVEN_GROUP.replace('.', '/') | ||
properties["distributionUrl"] = | ||
"${GeneratedConstants.MAVEN_URL}/$groupPath/voodoo/$version/voodoo-$version-${GeneratedConstants.MAVEN_SHADOW_CLASSIFIER}.jar" | ||
// prop["distributionPath"] = "wrapper/bin" | ||
|
||
StringWriter().use { | ||
properties.store(it, "generated by: voodoo generateWrapper") | ||
propertiesFile.writeText(it.toString()) | ||
} | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
wrapper/multimc-installer/src/main/resources/maven.properties
This file was deleted.
Oops, something went wrong.