mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-30 13:05:27 -05:00
Skip remapping in AbstractRemapJarTasks when source and target namespaces match (#985)
* Skip remapping in `AbstractRemapJarTask`s when source and target namespaces match The "remap jar" tasks have much more functionality than simply remapping jars at this point, such as adding namespace metadata, nesting jars, ensuring reproducible builds, etc. Some custom build logic may want to take advantage of these features without the full overhead of no-op remapping with TinyRemapper/Mercury. * Add test
This commit is contained in:
@@ -173,6 +173,18 @@ public abstract class AbstractRemapJarTask extends Jar {
|
||||
Property<String> getSourceNamespace();
|
||||
Property<String> getTargetNamespace();
|
||||
|
||||
/**
|
||||
* Checks whether {@link #getSourceNamespace()} and {@link #getTargetNamespace()}
|
||||
* have the same value. When this is {@code true}, the user does not intend for any
|
||||
* remapping to occur. They are using the task for its other features, such as adding
|
||||
* namespace to the manifest, nesting jars, reproducible builds, etc.
|
||||
*
|
||||
* @return whether the source and target namespaces match
|
||||
*/
|
||||
default boolean namespacesMatch() {
|
||||
return this.getSourceNamespace().get().equals(this.getTargetNamespace().get());
|
||||
}
|
||||
|
||||
Property<Boolean> getArchivePreserveFileTimestamps();
|
||||
Property<Boolean> getArchiveReproducibleFileOrder();
|
||||
Property<ZipEntryCompression> getEntryCompression();
|
||||
|
||||
Reference in New Issue
Block a user