Skip to content

Commit

Permalink
Fix InstallPluginsToTestBotTask
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Nov 4, 2024
1 parent 19e5d16 commit 82c7957
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import dev.schlaubi.mikbot.gradle.extension.pluginId
import org.gradle.api.DefaultTask
import org.gradle.api.file.Directory
import org.gradle.api.file.FileSystemOperations
import org.gradle.api.file.RegularFile
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.Input
Expand All @@ -16,7 +17,7 @@ import javax.inject.Inject
abstract class InstallPluginsToTestBotTask : DefaultTask() {

@get:Input
abstract val pluginArchive: Property<TaskProvider<Zip>>
abstract val pluginArchive: Property<RegularFile>

@get:OutputDirectory
val outputDirectory: Provider<Directory> = project.layout.buildDirectory.dir("test-bot/plugins")
Expand All @@ -26,11 +27,8 @@ abstract class InstallPluginsToTestBotTask : DefaultTask() {

@TaskAction
fun install() {
val task = pluginArchive.get().get()

val result = fs.copy {
from(task.destinationDirectory)
include(task.archiveFile.get().asFile.name)
from(pluginArchive.get())
into(outputDirectory)
rename { "plugin-${project.pluginId}.zip" }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class MikBotPluginGradlePlugin : Plugin<Project> {
val installPlugins = task<InstallPluginsToTestBotTask>("installPluginsToTestBot") {
dependsOn(assemblePlugin)

pluginArchive = assemblePlugin
pluginArchive = assemblePlugin.flatMap { it.archiveFile }
}

task<RunBotTask>("runBot") {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ coroutines = "1.9.0"
serialization = "1.7.3"
ktor = "3.0.1"
kord = "feature-user-apps-20241102.180018-12"
api = "4.0.0"
api = "4.0.1"
ksp = "2.0.21-1.0.26"
lavakord = "8.0.1"
kordex-plugin = "1.5.5"
Expand Down

0 comments on commit 82c7957

Please sign in to comment.