2424import java .io .File ;
2525import java .util .Arrays ;
2626import java .util .function .Function ;
27+ import java .util .function .UnaryOperator ;
2728
2829/// Represents a container of dependencies that will be access transformed.
2930///
@@ -83,7 +84,7 @@ default Dependency dep(Object dependencyNotation, Action<? super Dependency> act
8384 /// @param dependencyNotation The dependency (notation)
8485 /// @return The dependency to be transformed
8586 default Dependency dep (Object dependencyNotation ) {
86- return this .dep (dependencyNotation , Closures .empty (this ));
87+ return this .dep (dependencyNotation , Closures .< Dependency > unaryOperator (this , UnaryOperator . identity () ));
8788 }
8889
8990 /// Queues the given dependency to be transformed by AccessTransformers.
@@ -92,30 +93,28 @@ default Dependency dep(Object dependencyNotation) {
9293 /// @param closure A configuring closure for the dependency
9394 /// @return The dependency to be transformed
9495 @ SuppressWarnings ("rawtypes" ) // public-facing closure
95- default Dependency dep (
96+ Provider <?> dep (
9697 Provider <?> dependencyNotation ,
9798 @ DelegatesTo (Dependency .class )
9899 @ ClosureParams (value = SimpleType .class , options = "org.gradle.api.artifacts.Dependency" )
99100 Closure closure
100- ) {
101- return this .dep (dependencyNotation .get (), closure );
102- }
101+ );
103102
104103 /// Queues the given dependency to be transformed by AccessTransformers.
105104 ///
106105 /// @param dependencyNotation The dependency (notation)
107106 /// @param action A configuring action for the dependency
108107 /// @return The dependency to be transformed
109- default Dependency dep (Provider <?> dependencyNotation , Action <? super Dependency > action ) {
108+ default Provider <?> dep (Provider <?> dependencyNotation , Action <? super Dependency > action ) {
110109 return this .dep (dependencyNotation , Closures .action (this , action ));
111110 }
112111
113112 /// Queues the given dependency to be transformed by AccessTransformers.
114113 ///
115114 /// @param dependencyNotation The dependency (notation)
116115 /// @return The dependency to be transformed
117- default Dependency dep (Provider <?> dependencyNotation ) {
118- return this .dep (dependencyNotation , Closures .empty (this ));
116+ default Provider <?> dep (Provider <?> dependencyNotation ) {
117+ return this .dep (dependencyNotation , Closures .< Dependency > unaryOperator (this , UnaryOperator . identity () ));
119118 }
120119
121120 /// Queues the given dependency to be transformed by AccessTransformers.
@@ -124,7 +123,7 @@ default Dependency dep(Provider<?> dependencyNotation) {
124123 /// @param closure A configuring closure for the dependency
125124 /// @return The dependency to be transformed
126125 @ SuppressWarnings ("rawtypes" ) // public-facing closure
127- default Dependency dep (
126+ default Provider <?> dep (
128127 ProviderConvertible <?> dependencyNotation ,
129128 @ DelegatesTo (Dependency .class )
130129 @ ClosureParams (value = SimpleType .class , options = "org.gradle.api.artifacts.Dependency" )
@@ -138,16 +137,16 @@ default Dependency dep(
138137 /// @param dependencyNotation The dependency (notation)
139138 /// @param action A configuring action for the dependency
140139 /// @return The dependency to be transformed
141- default Dependency dep (ProviderConvertible <?> dependencyNotation , Action <? super Dependency > action ) {
140+ default Provider <?> dep (ProviderConvertible <?> dependencyNotation , Action <? super Dependency > action ) {
142141 return this .dep (dependencyNotation , Closures .action (this , action ));
143142 }
144143
145144 /// Queues the given dependency to be transformed by AccessTransformers.
146145 ///
147146 /// @param dependencyNotation The dependency (notation)
148147 /// @return The dependency to be transformed
149- default Dependency dep (ProviderConvertible <?> dependencyNotation ) {
150- return this .dep (dependencyNotation , Closures .empty (this ));
148+ default Provider <?> dep (ProviderConvertible <?> dependencyNotation ) {
149+ return this .dep (dependencyNotation , Closures .< Dependency > unaryOperator (this , UnaryOperator . identity () ));
151150 }
152151
153152 /// When initially registering an AccessTransformers container, the consumer must define key information regarding
@@ -203,7 +202,7 @@ default void setClasspath(
203202 ///
204203 /// @param dependencyNotation The dependency (notation) to use
205204 default void setClasspath (Object dependencyNotation ) {
206- this .setClasspath (dependencyNotation , Closures .empty (this ));
205+ this .setClasspath (dependencyNotation , Closures .< Dependency > unaryOperator (this , UnaryOperator . identity () ));
207206 }
208207
209208 /// Sets the dependency to use as the classpath for AccessTransformers.
@@ -235,7 +234,7 @@ default void setClasspath(
235234 ///
236235 /// @param dependencyNotation The dependency (notation) to use
237236 default void setClasspath (Provider <?> dependencyNotation ) {
238- this .setClasspath (dependencyNotation , Closures .empty (this ));
237+ this .setClasspath (dependencyNotation , Closures .< Dependency > unaryOperator (this , UnaryOperator . identity () ));
239238 }
240239
241240 /// Sets the dependency to use as the classpath for AccessTransformers.
@@ -267,7 +266,7 @@ default void setClasspath(
267266 ///
268267 /// @param dependencyNotation The dependency (notation) to use
269268 default void setClasspath (ProviderConvertible <?> dependencyNotation ) {
270- this .setClasspath (dependencyNotation , Closures .empty (this ));
269+ this .setClasspath (dependencyNotation , Closures .< Dependency > unaryOperator (this , UnaryOperator . identity () ));
271270 }
272271
273272 /// Sets the main class to invoke when running AccessTransformers.
0 commit comments