-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX]: Fix parchment detection (#236)
- Loading branch information
1 parent
714f31d
commit cd10dca
Showing
3 changed files
with
69 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
userdev/src/functionalTest/groovy/net/neoforged/gradle/userdev/ParchmentTests.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package net.neoforged.gradle.userdev | ||
|
||
import net.neoforged.trainingwheels.gradle.functional.BuilderBasedTestSpecification | ||
import org.gradle.testkit.runner.TaskOutcome | ||
|
||
class ParchmentTests extends BuilderBasedTestSpecification { | ||
|
||
@Override | ||
protected void configurePluginUnderTest() { | ||
pluginUnderTest = "net.neoforged.gradle.neoform"; | ||
injectIntoAllProject = true; | ||
} | ||
|
||
def "parchment can be used"() { | ||
given: | ||
def project = create("parchment_can_be_used", { | ||
it.property("neogradle.subsystems.parchment.minecraftVersion", "1.21") | ||
it.property("neogradle.subsystems.parchment.mappingsVersion", "2024.07.28") | ||
it.build(""" | ||
plugins { | ||
id 'net.neoforged.gradle.userdev' | ||
} | ||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(21) | ||
} | ||
} | ||
dependencies { | ||
implementation 'net.neoforged:neoforge:+' | ||
} | ||
""") | ||
it.file("src/main/java/net/neoforged/gradle/userdev/ConfigurationCacheTests.java", """ | ||
package net.neoforged.gradle.userdev; | ||
import net.minecraft.client.Minecraft; | ||
public class ConfigurationCacheTests { | ||
public static void main(String[] args) { | ||
System.out.println(Minecraft.getInstance().getClass().toString()); | ||
} | ||
} | ||
""") | ||
it.withToolchains() | ||
it.withGlobalCacheDirectory(tempDir) | ||
}) | ||
|
||
when: | ||
def run = project.run { | ||
it.tasks('compileJava') | ||
it.arguments('--warning-mode', 'fail', '--stacktrace') | ||
} | ||
|
||
then: | ||
run.task(':compileJava').outcome == TaskOutcome.SUCCESS | ||
run.task(':neoFormApplyParchment').outcome == TaskOutcome.SUCCESS | ||
} | ||
} |