Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle deprecation warning for Configuration.fileCollection(Spec) #109

Open
tiwoc opened this issue Sep 5, 2024 · 0 comments
Open

Gradle deprecation warning for Configuration.fileCollection(Spec) #109

tiwoc opened this issue Sep 5, 2024 · 0 comments

Comments

@tiwoc
Copy link

tiwoc commented Sep 5, 2024

What is the problem?

Building a project that includes SKIE logs the following warning:

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.10/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

When run with --warning-mode all --stacktrace, Gradle shows the following:

The Configuration.fileCollection(Spec) method has been deprecated. This is scheduled to be removed in Gradle 9.0. Use Configuration.getIncoming().artifactView(Action) with a componentFilter instead. Consult the upgrading guide for further information: https://docs.gradle.org/8.10/userguide/upgrading_version_8.html#deprecate_filtered_configuration_file_and_filecollection_methods
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.fileCollectionInternal(DefaultConfiguration.java:606)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.fileCollection(DefaultConfiguration.java:596)
        at co.touchlab.skie.plugin.switflink.SwiftUnpackingConfigurator$configureCustomSwiftUnpacking$$inlined$registerSkieTargetBasedTask$1.invoke(BaseSkieTask.kt:41)
        at co.touchlab.skie.plugin.switflink.SwiftUnpackingConfigurator$configureCustomSwiftUnpacking$$inlined$registerSkieTargetBasedTask$1.invoke(BaseSkieTask.kt:36)
        at co.touchlab.skie.plugin.util.BaseSkieTaskKt$sam$i$org_gradle_api_Action$0.execute(BaseSkieTask.kt)
        at org.gradle.api.internal.DefaultMutationGuard$1.execute(DefaultMutationGuard.java:45)
        at org.gradle.api.internal.DefaultMutationGuard$1.execute(DefaultMutationGuard.java:45)
        at org.gradle.internal.code.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:124)
        at org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction$1.run(DefaultCollectionCallbackActionDecorator.java:110)
[…]

I believe that this can be traced back to this line:

val linkerKlibs = target.linkerConfiguration.fileCollection { true }.filter { it.isKlib }

When does the problem occur?

When running any Gradle task, for example ./gradlew tasks

How do we reproduce the issue?

I believe that this will occur no matter how the project is configured, as long as SKIE is included. If you have trouble reproducing, let me know and I'll make a minimal example.

What versions of SKIE, Kotlin, and Gradle do you use?

  • SKIE 0.9.0-RC.3 (but it's also present with 0.8.4)
  • Kotlin 2.0.10
  • Gradle 8.10

What is your SKIE Gradle configuration?

skie {
    build {
        // Make generated framework work on other machines and other Xcode versions
        // See https://skie.touchlab.co/configuration/swift-compiler
        produceDistributableFramework()
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant