Fix buildPlugin, fix #335

This commit is contained in:
Him188 2021-04-16 12:52:55 +08:00
parent 6534b8177f
commit b20d49f6ce
3 changed files with 23 additions and 3 deletions

View File

@ -23,7 +23,7 @@ abstract class AbstractTest {
File settingsFile
File propertiesFile
def gradleRunner() {
GradleRunner gradleRunner() {
println(PluginUnderTestMetadataReading.readImplementationClasspath())
GradleRunner.create()
.withProjectDir(tempDir)

View File

@ -0,0 +1,22 @@
/*
* Copyright 2019-2021 Mamoe Technologies and contributors.
*
* 使 GNU AFFERO GENERAL PUBLIC LICENSE version 3 , .
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
package net.mamoe.mirai.console.gradle
import org.junit.jupiter.api.Test
class TestBuildPlugin extends AbstractTest {
@Test
void "can build plugin"() {
gradleRunner()
.withArguments("buildPlugin", "--stacktrace")
.build()
}
}

View File

@ -11,7 +11,6 @@ package net.mamoe.mirai.console.gradle
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.OutputFile
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
import java.io.File
import javax.inject.Inject
@ -23,7 +22,6 @@ public open class BuildMiraiPluginTask @Inject constructor(
/**
* ShadowJar 打包结果
*/
@get:OutputFile
public val output: File
get() = outputs.files.singleFile