Fix yet another gradle deprecation, expand tests to cover it
This commit is contained in:
parent
8ce991dadc
commit
b24e067215
3 changed files with 12 additions and 4 deletions
|
@ -47,7 +47,7 @@ public class UnpickJarTask extends JavaExec {
|
|||
public UnpickJarTask() {
|
||||
getOutputs().upToDateWhen(e -> false);
|
||||
classpath(getProject().getConfigurations().getByName(Constants.Configurations.UNPICK_CLASSPATH));
|
||||
setMain("daomephsta.unpick.cli.Main");
|
||||
getMainClass().set("daomephsta.unpick.cli.Main");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -42,17 +42,25 @@ class UnpickTest extends Specification implements ProjectTestTrait {
|
|||
|
||||
def "unpick decompile"() {
|
||||
when:
|
||||
def result = create("genSources")
|
||||
def result = create("genSources", gradle)
|
||||
then:
|
||||
result.task(":genSources").outcome == SUCCESS
|
||||
getClassSource("net/minecraft/block/CakeBlock.java").contains("Block.DEFAULT_SET_BLOCK_STATE_FLAG")
|
||||
where:
|
||||
gradle | _
|
||||
DEFAULT_GRADLE | _
|
||||
PRE_RELEASE_GRADLE | _
|
||||
}
|
||||
|
||||
def "unpick build"() {
|
||||
when:
|
||||
def result = create("build")
|
||||
def result = create("build", gradle)
|
||||
then:
|
||||
result.task(":build").outcome == SUCCESS
|
||||
where:
|
||||
gradle | _
|
||||
DEFAULT_GRADLE | _
|
||||
PRE_RELEASE_GRADLE | _
|
||||
}
|
||||
|
||||
String getClassSource(String classname, String mappings = MAPPINGS) {
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.gradle.testkit.runner.GradleRunner
|
|||
|
||||
trait ProjectTestTrait {
|
||||
final static String DEFAULT_GRADLE = "7.0.1"
|
||||
final static String PRE_RELEASE_GRADLE = "7.2-20210703221006+0000"
|
||||
final static String PRE_RELEASE_GRADLE = "7.2-20210704221017+0000"
|
||||
|
||||
static File gradleHome = File.createTempDir()
|
||||
File testProjectDir = File.createTempDir()
|
||||
|
|
Loading…
Reference in a new issue