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