diff options
author | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2021-09-10 21:08:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-11 02:08:41 +0800 |
commit | e1f5f3d6eb674b3513e7dd848c202ef7479a70a8 (patch) | |
tree | d7e1c58e1fad0ef3711e1e6143e7fd9fadebe576 /src/test/groovy/net | |
parent | aaacd23c8bdd2c52c727ab7119afd8dd968f762a (diff) | |
download | architectury-loom-e1f5f3d6eb674b3513e7dd848c202ef7479a70a8.tar.gz architectury-loom-e1f5f3d6eb674b3513e7dd848c202ef7479a70a8.tar.bz2 architectury-loom-e1f5f3d6eb674b3513e7dd848c202ef7479a70a8.zip |
Convert AWs on Forge to ATs in RemapJarTask (#24)
* Aw2At
* Hook Aw2At up to remapJar
* Checkstyle
* Checkstyle, part II
* Now it's Spotless' turn
* Remap the resulting AT
* you see, this is why mojmap is bad
* Inject(method = "<init>")
* Use file systems because ZipUtil is bad
* Make it false by default
* Add integ tests for aw2at
* spotless please
* fix year
Diffstat (limited to 'src/test/groovy/net')
-rw-r--r-- | src/test/groovy/net/fabricmc/loom/test/integration/forge/Aw2AtTest.groovy | 50 | ||||
-rw-r--r-- | src/test/groovy/net/fabricmc/loom/test/integration/forge/LegacyAw2AtTest.groovy | 50 |
2 files changed, 100 insertions, 0 deletions
diff --git a/src/test/groovy/net/fabricmc/loom/test/integration/forge/Aw2AtTest.groovy b/src/test/groovy/net/fabricmc/loom/test/integration/forge/Aw2AtTest.groovy new file mode 100644 index 00000000..fc7c016d --- /dev/null +++ b/src/test/groovy/net/fabricmc/loom/test/integration/forge/Aw2AtTest.groovy @@ -0,0 +1,50 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2021 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package net.fabricmc.loom.test.integration.forge + +import net.fabricmc.loom.test.util.ArchiveAssertionsTrait +import net.fabricmc.loom.test.util.ProjectTestTrait +import spock.lang.Specification + +import static org.gradle.testkit.runner.TaskOutcome.SUCCESS + +class Aw2AtTest extends Specification implements ProjectTestTrait, ArchiveAssertionsTrait { + @Override + String name() { + "forge/aw2At" + } + + def build() { + when: + def result = create("build", DEFAULT_GRADLE) + then: + result.task(":build").outcome == SUCCESS + getArchiveEntry("fabric-example-mod-1.0.0.jar", "META-INF/accesstransformer.cfg") == expected().replaceAll('\r', '') + } + + String expected() { + return new File(testProjectDir, "expected.accesstransformer.cfg").text + } +} diff --git a/src/test/groovy/net/fabricmc/loom/test/integration/forge/LegacyAw2AtTest.groovy b/src/test/groovy/net/fabricmc/loom/test/integration/forge/LegacyAw2AtTest.groovy new file mode 100644 index 00000000..bdd9a5aa --- /dev/null +++ b/src/test/groovy/net/fabricmc/loom/test/integration/forge/LegacyAw2AtTest.groovy @@ -0,0 +1,50 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2021 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package net.fabricmc.loom.test.integration.forge + +import net.fabricmc.loom.test.util.ArchiveAssertionsTrait +import net.fabricmc.loom.test.util.ProjectTestTrait +import spock.lang.Specification + +import static org.gradle.testkit.runner.TaskOutcome.SUCCESS + +class LegacyAw2AtTest extends Specification implements ProjectTestTrait, ArchiveAssertionsTrait { + @Override + String name() { + "forge/legacyAw2At" + } + + def build() { + when: + def result = create("build", DEFAULT_GRADLE) + then: + result.task(":build").outcome == SUCCESS + getArchiveEntry("fabric-example-mod-1.0.0.jar", "META-INF/accesstransformer.cfg") == expected().replaceAll('\r', '') + } + + String expected() { + return new File(testProjectDir, "expected.accesstransformer.cfg").text + } +} |