Skip to content

Commit be8fe04

Browse files
committed
Fix ATs causing IDEs to lose source jars
This was done by making the access transformer only target dependencies of type Usage: "library". Sources are of type Usage: "documentation". This problem is two-fold: 1. Gradle would access transform the sources, but wouldn't select it as an auxiliary artifact for the IDE. 2. IntelliJ would look for the auxiliary artifact but can't find it due to the variant change from Gradle transforming the artifact. This is a problem that would be fixed by gradle/gradle#35131. When it is, we can theoretically add support in AccessTransformers itself to transform `.java` files as well as `.class` files.
1 parent ca32f2e commit be8fe04

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,9 @@ private Attribute<Boolean> register(Object dependency, AccessTransformersConfigu
166166
return attribute;
167167
}
168168

169-
private static void setAttributes(AttributeContainer attributes, Attribute<Boolean> attribute, boolean value) {
169+
private void setAttributes(AttributeContainer attributes, Attribute<Boolean> attribute, boolean value) {
170170
attributes.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.JAR_TYPE)
171+
.attribute(Category.CATEGORY_ATTRIBUTE, this.getObjects().named(Category.class, Category.LIBRARY))
171172
.attribute(attribute, value);
172173
}
173174

0 commit comments

Comments
 (0)