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

Upgrade Gradle to 7.1 #3639

Merged
merged 5 commits into from
Jun 21, 2021
Merged

Upgrade Gradle to 7.1 #3639

merged 5 commits into from
Jun 21, 2021

Conversation

ikhoon
Copy link
Contributor

@ikhoon ikhoon commented Jun 17, 2021

Motivation:

Gradle 7.1 has been released. https://docs.gradle.org/7.1/release-notes.html

Modifications:

  • Add an explicit dependency for implicit dependency between sourcesJar
    and generated sources.
    Many warnings similar to the following messages produced while building
    projects. See https://docs.gradle.org/7.1/userguide/validation_problems.html#implicit_dependency
    Execution optimizations have been disabled for task ':grpc:generateProto' to ensure correctness due to the following reasons:
    - Gradle detected a problem with the following location: '/Users/ikhun/src/armeria/grpc/gen-src/main'. Reason: Task ':grpc:sourcesJar' uses this output of task ':grpc:generateProto' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.
    - Gradle detected a problem with the following location: '/Users/ikhun/src/armeria/grpc/gen-src/main/resources/META-INF/armeria/grpc/armeria-main.dsc'. Reason: Task ':grpc:sourcesJar' uses this output of task ':grpc:generateProto' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.
    
  • Add kotlin flag and dedupe Kotlin configurations
  • Remove jcenter() which has been deprecated
  • Replace mainClassName witth mainClass.set()
  • Upgrade groovy-xml from 2.5.12 -> 3.0.5
  • Specify the default DuplicatesStrategy to EXCLUDE
    • The duplicated files raised error while build projects

Result:

Bump Gradle version from 6.8.3 to 7.1

Motivation:

Gradle 7.1 has been released. https://docs.gradle.org/7.1/release-notes.html

Modifications:

- Add an explicit dependency for implicit dependency between sourcesJar
  and generated sources.
  Many warnings similar to the following messages produced while building
  projects. See https://docs.gradle.org/7.1/userguide/validation_problems.html#implicit_dependency
  ```
  Execution optimizations have been disabled for task ':grpc:generateProto' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: '/Users/ikhun/src/armeria/grpc/gen-src/main'. Reason: Task ':grpc:sourcesJar' uses this output of task ':grpc:generateProto' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: '/Users/ikhun/src/armeria/grpc/gen-src/main/resources/META-INF/armeria/grpc/armeria-main.dsc'. Reason: Task ':grpc:sourcesJar' uses this output of task ':grpc:generateProto' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  ```
- Add `kotlin` flag and dedupe Kotlin configurations
- Remove `jcenter()` which has been deprecated
- Replace `mainClassName` witth `mainClass.set()`
- Upgrade groovy-xml from 2.5.12 -> 3.0.5
- Specify the default `DuplicatesStrategy` to `EXCLUDE`
  - The duplicated files raised error while build projects

Result:

Bump Gradle version from 6.8.3 to 7.1
@ikhoon ikhoon added this to the 1.9.0 milestone Jun 17, 2021
@trustin
Copy link
Member

trustin commented Jun 17, 2021

Specify the default DuplicatesStrategy to EXCLUDE

Wouldn't this conflict with our version properties files?

@ikhoon
Copy link
Contributor Author

ikhoon commented Jun 17, 2021

Specify the default DuplicatesStrategy to EXCLUDE

Wouldn't this conflict with our version properties files?

There are some resource files that conflict. version properties are also included. I thought EXCLUDE strategy(first win) seems to work for us.
But I was not sure it is the right approach for this problem.

@codecov
Copy link

codecov bot commented Jun 18, 2021

Codecov Report

Merging #3639 (d8db904) into master (81dcaa6) will increase coverage by 0.13%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3639      +/-   ##
============================================
+ Coverage     73.82%   73.95%   +0.13%     
- Complexity    14421    14545     +124     
============================================
  Files          1265     1266       +1     
  Lines         54985    55380     +395     
  Branches       7027     7114      +87     
============================================
+ Hits          40591    40956     +365     
+ Misses        10812    10806       -6     
- Partials       3582     3618      +36     
Impacted Files Coverage Δ
...rp/armeria/spring/actuate/WebOperationService.java 63.05% <ø> (ø)
.../armeria/internal/common/HttpObjectAggregator.java 60.00% <0.00%> (-33.34%) ⬇️
...p/armeria/client/encoding/HttpDecodedResponse.java 58.33% <0.00%> (-9.02%) ⬇️
...rmeria/internal/client/TruncatingHttpResponse.java 78.57% <0.00%> (-7.15%) ⬇️
...p/armeria/common/stream/FilteredStreamMessage.java 74.64% <0.00%> (-3.67%) ⬇️
...ia/common/stream/OneElementFixedStreamMessage.java 85.00% <0.00%> (-3.58%) ⬇️
...al/server/annotation/AnnotatedServiceTypeUtil.java 82.60% <0.00%> (-2.40%) ⬇️
...linecorp/armeria/common/StringMultimapBuilder.java 39.90% <0.00%> (-2.02%) ⬇️
...p/armeria/common/stream/DeferredStreamMessage.java 83.33% <0.00%> (-1.88%) ⬇️
...ia/common/stream/TwoElementFixedStreamMessage.java 83.82% <0.00%> (-1.67%) ⬇️
... and 51 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 81dcaa6...d8db904. Read the comment docs.

@ikhoon
Copy link
Contributor Author

ikhoon commented Jun 18, 2021

But.. can we just disable this warning at all? Our project is not that large so this optimization warning doesn't really matter to us at the moment.

Unfortunately, it seems like there is no such option only for disabling this implicit dependency warning.

@ikhoon
Copy link
Contributor Author

ikhoon commented Jun 18, 2021

Opened a PR for gradle-scalafmt to clean up the warning messages. alenkacz/gradle-scalafmt#43

gradle/scripts/lib/java-rpc-thrift.gradle Outdated Show resolved Hide resolved
@@ -0,0 +1,35 @@
configure(projectsWithFlags('kotlin')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

build.gradle Outdated Show resolved Hide resolved
Copy link
Member

@trustin trustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ikhoon added a commit to ikhoon/gradle-scripts that referenced this pull request Jun 21, 2021
@trustin trustin merged commit 8ac9d9b into line:master Jun 21, 2021
heowc pushed a commit to heowc/armeria that referenced this pull request Jun 24, 2021
Motivation:

Gradle 7.1 has been released. https://docs.gradle.org/7.1/release-notes.html

Modifications:

- Add an explicit dependency for implicit dependency between sourcesJar
  and generated sources.
  Many warnings similar to the following messages produced while building
  projects. See https://docs.gradle.org/7.1/userguide/validation_problems.html#implicit_dependency
  ```
  Execution optimizations have been disabled for task ':grpc:generateProto' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: '/Users/ikhun/src/armeria/grpc/gen-src/main'. Reason: Task ':grpc:sourcesJar' uses this output of task ':grpc:generateProto' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: '/Users/ikhun/src/armeria/grpc/gen-src/main/resources/META-INF/armeria/grpc/armeria-main.dsc'. Reason: Task ':grpc:sourcesJar' uses this output of task ':grpc:generateProto' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  ```
- Add `kotlin` flag and dedupe Kotlin configurations
- Remove `jcenter()` which has been deprecated
- Replace `mainClassName` witth `mainClass.set()`
- Upgrade groovy-xml from 2.5.12 -> 3.0.5
- Specify the default `DuplicatesStrategy` to `EXCLUDE`
  - The duplicated files raised error while build projects

Result:

Bump Gradle version from 6.8.3 to 7.1
@ikhoon ikhoon deleted the gradle-7.1 branch August 31, 2021 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants