@@ -11,7 +11,7 @@ import org.gradle.api.Action
1111import org.gradle.api.NamedDomainObjectContainer
1212import org.gradle.api.Project
1313import org.gradle.api.artifacts.Configuration
14- import org.gradle.api.artifacts.DependencySet
14+ import org.gradle.api.file.FileCollection
1515import org.gradle.api.model.ObjectFactory
1616import org.gradle.api.provider.ListProperty
1717import org.gradle.api.provider.MapProperty
@@ -100,7 +100,7 @@ interface CommonKodexTaskProperties {
100100
101101 /* * The classpath of this task. */
102102 @get:Classpath
103- val classpath: Property <Configuration >
103+ val classpath: Property <FileCollection >
104104
105105 @get:Nested
106106 val exportAsHtml: Property <ExportAsHtmlDsl >
@@ -121,7 +121,24 @@ interface CommonKodexTaskProperties {
121121 * ```
122122 */
123123 @get:Internal
124- val dependencies: Property <DependencySetPluginDsl >
124+ val dependencies: DependencySetPluginDsl
125+ get() = object : DependencySetPluginDsl {
126+ /* *
127+ * Gets the set of declared dependencies directly contained in this configuration
128+ * (ignoring super configurations).
129+ *
130+ * This method does not resolve the configuration. Therefore, the return value does not include
131+ * transitive dependencies.
132+ *
133+ * @return the set of dependencies
134+ * @see #extendsFrom(Configuration...)
135+ */
136+ override fun Project.plugin (dependencyNotation : Any ) {
137+ (classpath.get() as Configuration ).dependencies.add(
138+ dependencies.create(dependencyNotation),
139+ )
140+ }
141+ }
125142
126143 /* *
127144 * DSL to add plugin dependencies to the current task. If you want to include a processor from an external library,
@@ -135,7 +152,7 @@ interface CommonKodexTaskProperties {
135152 * }
136153 * ```
137154 */
138- fun dependencies (action : Action <DependencySetPluginDsl >): Unit = action.execute(dependencies.get() )
155+ fun dependencies (action : Action <DependencySetPluginDsl >): Unit = action.execute(dependencies)
139156
140157 /* * like "2.3", uses languageVersion or latest stable if not supplied. */
141158 @get:Input
@@ -201,7 +218,7 @@ interface DependencySetPluginDsl {
201218 *
202219 * @param dependencyNotation Dependency notation
203220 */
204- fun plugin (dependencyNotation : Any )
221+ fun Project. plugin (dependencyNotation : Any )
205222}
206223
207224fun CommonKodexTaskProperties.applyPropertiesFrom (other : CommonKodexTaskProperties ) {
@@ -251,29 +268,6 @@ fun CommonKodexTaskProperties.applyConventions(project: Project, factory: Object
251268 exportAsHtmlInstance.dir.convention(target.map { File (it, " htmlExports" ) })
252269 exportAsHtmlInstance.outputReadOnly.convention(true )
253270 exportAsHtml.set(exportAsHtmlInstance)
254-
255- dependencies.set(
256- object : DependencySetPluginDsl {
257- /* *
258- * Gets the set of declared dependencies directly contained in this configuration
259- * (ignoring super configurations).
260- * <p>
261- * This method does not resolve the configuration. Therefore, the return value does not include
262- * transitive dependencies.
263- *
264- * @return the set of dependencies
265- * @see #extendsFrom(Configuration...)
266- */
267- val dependencies: DependencySet
268- get() = classpath.get().dependencies
269-
270- override fun plugin (dependencyNotation : Any ) {
271- dependencies.add(
272- project.dependencies.create(dependencyNotation),
273- )
274- }
275- },
276- )
277271}
278272
279273internal fun Project.maybeCreateRuntimeConfiguration (): Configuration =
0 commit comments