Skip to content

Commit 874a725

Browse files
committed
Stabilize 5.0, fix defaults for a few things
1 parent 308704f commit 874a725

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ abstract class AccessTransformersExtensionImpl implements AccessTransformersExte
4848

4949
protected abstract @Inject ObjectFactory getObjects();
5050

51-
protected abstract @Inject ProjectLayout getLayout();
52-
5351
protected abstract @Inject ProviderFactory getProviders();
5452

5553
@Inject
@@ -61,6 +59,8 @@ public AccessTransformersExtensionImpl(AccessTransformersPlugin plugin, Project
6159
}
6260

6361
private void apply(Configuration configuration) {
62+
LOGGER.debug("Configuration '{}' is queued for resolution! Scanning for AccessTransformer requests.", configuration.getName());
63+
6464
var hierarchy = configuration.getHierarchy();
6565

6666
// AccessTransformers can be configured for constraints to not pollute the dependency tree.
@@ -172,6 +172,7 @@ private void apply(Configuration configuration) {
172172
}
173173

174174
private void applyToProject(Configuration configuration, String path, Iterable<Attribute<Boolean>> attributes) {
175+
LOGGER.info("Applying AccessTransformers attributes for project dependency: {}", path);
175176
configuration.getResolutionStrategy().dependencySubstitution(s -> {
176177
var component = s.project(path);
177178
var substitute = s.substitute(component);
@@ -185,6 +186,7 @@ private void applyToProject(Configuration configuration, String path, Iterable<A
185186
}
186187

187188
private void applyToDependency(Configuration configuration, Dependency dependency, String moduleSelector, Iterable<Attribute<Boolean>> attributes) {
189+
LOGGER.info("Applying AccessTransformers attributes for dependency: {}", dependency);
188190
configuration.getResolutionStrategy().dependencySubstitution(s -> {
189191
var component = s.module(moduleSelector);
190192
var substitute = s.substitute(component);
@@ -207,6 +209,7 @@ private void applyToDependency(Configuration configuration, Dependency dependenc
207209
}
208210

209211
private void applyToConstraint(Configuration configuration, ModuleIdentifier module, String moduleSelector, Iterable<Attribute<Boolean>> attributes) {
212+
LOGGER.info("Applying AccessTransformers attributes for dependency constraint: {}", module);
210213
configuration.getResolutionStrategy().dependencySubstitution(s -> {
211214
var component = s.module(moduleSelector);
212215
var substitute = s.substitute(component);

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ public interface Parameters extends TransformParameters {
118118
/// Returns an action that sets the default values for the parameters of the artifact access transformer.
119119
///
120120
/// @param project The project using AccessTransformers
121+
/// @return A configuring action to use in [org.gradle.api.artifacts.dsl.DependencyHandler#registerTransform(Class, Action)]
121122
/// @apiNote Using this in [org.gradle.api.artifacts.dsl.DependencyHandler#registerTransform(Class, Action)]
122123
/// after the project has evaluated **will not** populate some crucial defaults, as the project is inaccessible
123124
/// after configuration. If you use this, make sure you do before the project has finished evaluation so that
@@ -130,6 +131,7 @@ static Action<? super Parameters> defaults(Project project) {
130131
///
131132
/// @param project The project using AccessTransformers
132133
/// @param action An action to run after the defaults are set
134+
/// @return A configuring action to use in [org.gradle.api.artifacts.dsl.DependencyHandler#registerTransform(Class, Action)]
133135
/// @apiNote Using this in [org.gradle.api.artifacts.dsl.DependencyHandler#registerTransform(Class, Action)]
134136
/// after the project has evaluated **will not** populate some crucial defaults, as the project is inaccessible
135137
/// after configuration. If you use this, make sure you do before the project has finished evaluation so that
@@ -216,7 +218,7 @@ public void transform(TransformOutputs outputs) {
216218
} else {
217219
LOGGER.info("Access transformer started. Input jar: {}", inJar.getAbsolutePath());
218220
var result = this.getExecOperations().javaexec(exec -> {
219-
var logLevel = parameters.getLogLevel().get();
221+
var logLevel = parameters.getLogLevel().getOrElse(LogLevel.INFO);
220222
var stream = Util.toLog(s -> LOGGER.log(logLevel, s));
221223
exec.setStandardOutput(stream);
222224
exec.setErrorOutput(stream);

0 commit comments

Comments
 (0)