build: Move to using Indra
This commit is contained in:
parent
6a100c9ca1
commit
98f389a72a
6 changed files with 138 additions and 127 deletions
|
|
@ -2,6 +2,22 @@ plugins {
|
|||
id ("com.github.johnrengelman.shadow")
|
||||
}
|
||||
|
||||
val velocityRunClasspath by configurations.creating {
|
||||
attributes {
|
||||
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage::class, Usage.JAVA_RUNTIME))
|
||||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category::class, Category.LIBRARY))
|
||||
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements::class, LibraryElements.JAR))
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
ivy("https://versions.velocitypowered.com/download/") {
|
||||
patternLayout { artifact("[revision].[ext]") }
|
||||
metadataSources { artifact() }
|
||||
content { includeModule("com.velocitypowered", "velocity-proxy") }
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
shadowJar {
|
||||
dependencies {
|
||||
|
|
@ -11,12 +27,41 @@ tasks {
|
|||
build {
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
|
||||
val pluginJar = shadowJar.map { it.outputs }
|
||||
val spongeRunFiles = velocityRunClasspath.asFileTree
|
||||
register("runVelocity", JavaExec::class) {
|
||||
group = "cloud"
|
||||
description = "Spin up a Velocity server environment"
|
||||
standardInput = System.`in`
|
||||
javaLauncher.set(project.javaToolchains.launcherFor { languageVersion.set(JavaLanguageVersion.of(11)) })
|
||||
|
||||
inputs.files(pluginJar)
|
||||
|
||||
classpath(spongeRunFiles)
|
||||
workingDir = layout.projectDirectory.dir("run").asFile
|
||||
|
||||
doFirst {
|
||||
// Prepare
|
||||
val modsDir = workingDir.resolve("plugins")
|
||||
if (!modsDir.isDirectory) {
|
||||
modsDir.mkdirs()
|
||||
}
|
||||
|
||||
project.copy {
|
||||
into(modsDir.absolutePath)
|
||||
from(pluginJar) {
|
||||
rename { "${rootProject.name}-${project.name}.jar" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(project(":cloud-velocity"))
|
||||
api(project(":cloud-minecraft-extras"))
|
||||
api(project(":cloud-annotations"))
|
||||
compileOnly("com.velocitypowered", "velocity-api", Versions.velocityApi)
|
||||
annotationProcessor("com.velocitypowered", "velocity-api", Versions.velocityApi)
|
||||
annotationProcessor(compileOnly("com.velocitypowered", "velocity-api", Versions.velocityApi))
|
||||
velocityRunClasspath("com.velocitypowered", "velocity-proxy", "1.1.3")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue