Skip to content

Commit 3afb032

Browse files
committed
Attempt to inform consumer if transformation failed
Exceptions that are thrown in artifact transforms are swallowed by Gradle unless it's necessary for a task execution. This means that artifact transforms that are run as part of IDE sync may have its exceptions silently ignored, while the dependency fails to resolve. The workaround for now is simply to try and log the thrown exception before throwing it, by wrapping the transform process in a try/catch.
1 parent 874a725 commit 3afb032

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

at-gradle/src/main/java/net/minecraftforge/accesstransformers/gradle/ArtifactAccessTransformer.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,15 @@ public ArtifactAccessTransformer() {
192192
/// @param outputs The outputs for this transform action
193193
@Override
194194
public void transform(TransformOutputs outputs) {
195+
try {
196+
this.exec(outputs);
197+
} catch (Exception e) {
198+
LOGGER.error("Failed to apply AccessTransformers to {}", this.getInputArtifact().get().getAsFile().getName(), e);
199+
throw new RuntimeException(e);
200+
}
201+
}
202+
203+
private void exec(TransformOutputs outputs) throws Exception {
195204
var parameters = this.getParameters();
196205

197206
// inputs

0 commit comments

Comments
 (0)