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

Refactor build logic to remove deprecations #5127

Closed
6 tasks
jdrueckert opened this issue Jul 31, 2023 · 4 comments
Closed
6 tasks

Refactor build logic to remove deprecations #5127

jdrueckert opened this issue Jul 31, 2023 · 4 comments
Labels
Category: Build/CI Requests, Issues and Changes targeting gradle, groovy, Jenkins, etc. Good First Issue Good for learners that are new to Terasology Size: S Small effort likely only affecting a single area and requiring little to no research Status: Needs Investigation Requires to be debugged or checked for feasibility, etc. Topic: Stabilization Requests, Issues and Changes related to improving stablity and reducing flakyness Type: Refactoring Request for or implementation of pure and automatic refactorings, e.g. renaming, to improve clarity

Comments

@jdrueckert
Copy link
Member

jdrueckert commented Jul 31, 2023

Motivation

On the state of #5109 running gradle warns about a bunch of unused variables and deprecations that we should improve on.

Kotlin

> Task :build-logic:compileKotlin
w: build-logic/src/main/kotlin/org/terasology/gradology/module_deps.kt:93:9 Variable 'artifactView' is never used
w: build-logic/src/main/kotlin/org/terasology/gradology/module_deps.kt:99:9 Variable 'resolvedDependencies' is never used
w: build-logic/src/main/kotlin/reflections-manifest.gradle.kts:14:30 'getter for convention: Convention' is deprecated. Deprecated in Java
w: build-logic/src/main/kotlin/reflections-manifest.gradle.kts:14:41 'getPlugin(Class<T!>): T' is deprecated. Deprecated in Java
w: build-logic/src/main/kotlin/reflections-manifest.gradle.kts:14:51 'JavaPluginConvention' is deprecated. Deprecated in Java
> Configure project :facades:PC
w: facades/PC/build.gradle.kts:208:24: Type mismatch: inferred type is Build_gradle.ScriptClasspathRewriter but Transformer<String?, String!> was expected

Gradle

> Configure project :engine
The Project.getConvention() method has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.2.1/userguide/upgrading_version_8.html#deprecated_access_to_conventions
The org.gradle.util.GUtil type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.2.1/userguide/upgrading_version_7.html#org_gradle_util_reports_deprecations
The org.gradle.api.plugins.Convention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.2.1/userguide/upgrading_version_8.html#deprecated_access_to_conventions
        at Terasology_metrics_gradle$1.invoke(terasology-metrics.gradle.kts:12)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
The org.gradle.api.plugins.JavaPluginConvention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.2.1/userguide/upgrading_version_8.html#java_convention_deprecation
        at Terasology_metrics_gradle$1.invoke(terasology-metrics.gradle.kts:12)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
The org.gradle.util.ConfigureUtil type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.2.1/userguide/upgrading_version_8.html#org_gradle_util_reports_deprecations
        at build_6xi54x7e39fcxa1f8evyst58w.run(/home/jdr/Development/Git/Terasology/engine/build.gradle:163)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Build file '/home/jdr/Development/Git/Terasology/engine/build.gradle': line 164
The org.gradle.util.ConfigureUtil type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.2.1/userguide/upgrading_version_8.html#org_gradle_util_reports_deprecations
        at build_6xi54x7e39fcxa1f8evyst58w$_run_closure6.doCall(/home/jdr/Development/Git/Terasology/engine/build.gradle:164)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
        at build_6xi54x7e39fcxa1f8evyst58w.run(/home/jdr/Development/Git/Terasology/engine/build.gradle:163)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Build file '/home/jdr/Development/Git/Terasology/engine/build.gradle': line 167
The org.gradle.util.ConfigureUtil type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.2.1/userguide/upgrading_version_8.html#org_gradle_util_reports_deprecations
        at build_6xi54x7e39fcxa1f8evyst58w$_run_closure6.doCall(/home/jdr/Development/Git/Terasology/engine/build.gradle:167)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
        at build_6xi54x7e39fcxa1f8evyst58w.run(/home/jdr/Development/Git/Terasology/engine/build.gradle:163)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Build file '/home/jdr/Development/Git/Terasology/engine/build.gradle': line 163
The org.gradle.api.plugins.Convention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.2.1/userguide/upgrading_version_8.html#deprecated_access_to_conventions
        at build_6xi54x7e39fcxa1f8evyst58w.run(/home/jdr/Development/Git/Terasology/engine/build.gradle:163)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Build file '/home/jdr/Development/Git/Terasology/engine/build.gradle': line 198
The JavaExecSpec.main property has been deprecated. This is scheduled to be removed in Gradle 9.0. Please use the mainClass property instead. For more information, please refer to https://docs.gradle.org/8.2.1/dsl/org.gradle.process.JavaExecSpec.html#org.gradle.process.JavaExecSpec:main in the Gradle documentation.
        at build_6xi54x7e39fcxa1f8evyst58w$_run_closure9.doCall(/home/jdr/Development/Git/Terasology/engine/build.gradle:198)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
        at build_6xi54x7e39fcxa1f8evyst58w.run(/home/jdr/Development/Git/Terasology/engine/build.gradle:197)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Scanning for version in module.txt for engine
Version for engine loaded as 5.4.0-SNAPSHOT for group org.terasology.engine
Build file '/home/jdr/Development/Git/Terasology/engine/build.gradle': line 254
The WriteProperties.outputFile property has been deprecated. This is scheduled to be removed in Gradle 9.0. Please use the destinationFile property instead. For more information, please refer to https://docs.gradle.org/8.2.1/dsl/org.gradle.api.tasks.WriteProperties.html#org.gradle.api.tasks.WriteProperties:outputFile in the Gradle documentation.
        at build_6xi54x7e39fcxa1f8evyst58w$_run_closure11.doCall(/home/jdr/Development/Git/Terasology/engine/build.gradle:254)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
> Configure project :subsystems
Build file '/home/jdr/Development/Git/Terasology/subsystems/build.gradle': line 9
The Project.getConvention() method has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.2.1/userguide/upgrading_version_8.html#deprecated_access_to_conventions
        at build_xp7xm5uqb3cpd710ey50nyi1$_run_closure1.doCall(/home/jdr/Development/Git/Terasology/subsystems/build.gradle:9)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
        at build_xp7xm5uqb3cpd710ey50nyi1.run(/home/jdr/Development/Git/Terasology/subsystems/build.gradle:4)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Build file '/home/jdr/Development/Git/Terasology/subsystems/build.gradle': line 9
The org.gradle.api.plugins.Convention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.2.1/userguide/upgrading_version_8.html#deprecated_access_to_conventions
        at build_xp7xm5uqb3cpd710ey50nyi1$_run_closure1.doCall(/home/jdr/Development/Git/Terasology/subsystems/build.gradle:9)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
        at build_xp7xm5uqb3cpd710ey50nyi1.run(/home/jdr/Development/Git/Terasology/subsystems/build.gradle:4)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Build file '/home/jdr/Development/Git/Terasology/subsystems/build.gradle': line 9
The org.gradle.api.plugins.JavaPluginConvention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.2.1/userguide/upgrading_version_8.html#java_convention_deprecation
        at build_xp7xm5uqb3cpd710ey50nyi1$_run_closure1.doCall(/home/jdr/Development/Git/Terasology/subsystems/build.gradle:9)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
        at build_xp7xm5uqb3cpd710ey50nyi1.run(/home/jdr/Development/Git/Terasology/subsystems/build.gradle:4)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)

How to Reproduce

Run ./gradlew wrapper --warning-mode all

Additional Remarks

This should also be checked and fixed in other repos:

@jdrueckert jdrueckert added Status: Needs Investigation Requires to be debugged or checked for feasibility, etc. Category: Build/CI Requests, Issues and Changes targeting gradle, groovy, Jenkins, etc. Good First Issue Good for learners that are new to Terasology Topic: Stabilization Requests, Issues and Changes related to improving stablity and reducing flakyness Size: S Small effort likely only affecting a single area and requiring little to no research Type: Refactoring Request for or implementation of pure and automatic refactorings, e.g. renaming, to improve clarity labels Jul 31, 2023
@jdrueckert jdrueckert added this to the 2023 Revive - Milestone 2 milestone Jul 31, 2023
@jdrueckert jdrueckert linked a pull request Aug 21, 2023 that will close this issue
@soloturn
Copy link
Contributor

should we close this, the remaining warning is:

w: file:///run/media/rt/4tb-home/1tb-no-space/src/Terasology/build-logic/src/main/kotlin/org/terasology/gradology/module_deps.kt:93:9 Variable 'artifactView' is never used

and people did not want to have this field removed?

@jdrueckert
Copy link
Member Author

should we close this, the remaining warning is:

w: file:///run/media/rt/4tb-home/1tb-no-space/src/Terasology/build-logic/src/main/kotlin/org/terasology/gradology/module_deps.kt:93:9 Variable 'artifactView' is never used

and people did not want to have this field removed?

Do you recall why "people did not want to have this field removed"? (or who spoke out against it?)

I don't think we should remove

    val artifactView = resolvable.artifactView {
        lenient(true)
    }

entirely, but I don't see why we shouldn't do something like

    resolvable.artifactView {
        lenient(true)
    }

@BenjaminAmos
Copy link
Contributor

Do you recall why "people did not want to have this field removed"? (or who spoke out against it?)

That may have been me. I objected to the complete removal of lenient(true) block in #5140 (comment) just in-case we were relying on it. I have no objections to removing the val artifactView = part, as you suggested.

@jdrueckert
Copy link
Member Author

All warnings fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Build/CI Requests, Issues and Changes targeting gradle, groovy, Jenkins, etc. Good First Issue Good for learners that are new to Terasology Size: S Small effort likely only affecting a single area and requiring little to no research Status: Needs Investigation Requires to be debugged or checked for feasibility, etc. Topic: Stabilization Requests, Issues and Changes related to improving stablity and reducing flakyness Type: Refactoring Request for or implementation of pure and automatic refactorings, e.g. renaming, to improve clarity
Projects
Status: Done
Status: No status
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants