lazy resolve bootstrap deps
This commit is contained in:
@@ -4,20 +4,13 @@ import org.gradle.kotlin.dsl.*
|
||||
|
||||
class BootstrapPlugin : Plugin<Project> {
|
||||
override fun apply(project: Project): Unit = with(project) {
|
||||
val clientJar by configurations.creating {
|
||||
isCanBeConsumed = false
|
||||
isCanBeResolved = true
|
||||
isTransitive = false
|
||||
}
|
||||
val bootstrapDependencies by configurations.creating {
|
||||
extendsFrom(clientJar)
|
||||
isCanBeConsumed = false
|
||||
isCanBeResolved = true
|
||||
isTransitive = false
|
||||
}
|
||||
|
||||
dependencies {
|
||||
clientJar(tasks["jar"].outputs.files)
|
||||
bootstrapDependencies(project(":runelite-api"))
|
||||
bootstrapDependencies(project(":runescape-api"))
|
||||
bootstrapDependencies(project(":http-api"))
|
||||
@@ -29,6 +22,9 @@ class BootstrapPlugin : Plugin<Project> {
|
||||
tasks.register<BootstrapTask>("bootstrapStable", "stable")
|
||||
|
||||
tasks.withType<BootstrapTask> {
|
||||
this.group = "openosrs"
|
||||
this.clientJar.fileProvider(provider { tasks["jar"].outputs.files.singleFile })
|
||||
|
||||
dependsOn(bootstrapDependencies)
|
||||
dependsOn("publish")
|
||||
dependsOn(project(":runelite-api").tasks["publish"])
|
||||
@@ -36,8 +32,6 @@ class BootstrapPlugin : Plugin<Project> {
|
||||
dependsOn(project(":http-api").tasks["publish"])
|
||||
dependsOn(project(":injected-client").tasks["publish"])
|
||||
|
||||
this.clientJar = clientJar.singleFile
|
||||
|
||||
doLast {
|
||||
copy {
|
||||
from(bootstrapDependencies)
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.tasks.Input
|
||||
import org.gradle.api.tasks.InputFile
|
||||
import org.gradle.api.tasks.PathSensitive
|
||||
import org.gradle.api.tasks.PathSensitivity
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
import org.gradle.api.file.RegularFileProperty
|
||||
import org.gradle.api.tasks.*
|
||||
import org.gradle.kotlin.dsl.extra
|
||||
import org.gradle.kotlin.dsl.get
|
||||
import java.io.File
|
||||
@@ -14,7 +11,7 @@ open class BootstrapTask @Inject constructor(@Input val type: String) : DefaultT
|
||||
|
||||
@InputFile
|
||||
@PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
var clientJar: File? = null
|
||||
val clientJar: RegularFileProperty = project.objects.fileProperty()
|
||||
|
||||
@Input
|
||||
val launcherJvm11Arguments = arrayOf("-XX:+DisableAttachMechanism", "-Drunelite.launcher.nojvm=true", "-Xmx1G", "-Xss2m", "-XX:CompileThreshold=1500", "-Djna.nosys=true")
|
||||
@@ -81,11 +78,12 @@ open class BootstrapTask @Inject constructor(@Input val type: String) : DefaultT
|
||||
}
|
||||
}
|
||||
|
||||
val cjar = clientJar.get().asFile
|
||||
artifacts.add(JsonBuilder(
|
||||
"name" to clientJar!!.name,
|
||||
"path" to "https://github.com/open-osrs/hosting/raw/master/${type}/${clientJar!!.name}",
|
||||
"size" to clientJar!!.length(),
|
||||
"hash" to hash(clientJar!!.readBytes())
|
||||
"name" to cjar.name,
|
||||
"path" to "https://github.com/open-osrs/hosting/raw/master/${type}/${cjar.name}",
|
||||
"size" to cjar.length(),
|
||||
"hash" to hash(cjar.readBytes())
|
||||
))
|
||||
|
||||
return artifacts.toTypedArray()
|
||||
|
||||
Reference in New Issue
Block a user