-
Notifications
You must be signed in to change notification settings - Fork 7
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
Replace deprecated Gradle/ScalarDB features #74
Conversation
application { | ||
mainClassName = 'sample.client.Client' | ||
mainClass = 'sample.client.Client' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix suppress the following warning message:
The org.gradle.api.plugins.ApplicationPluginConvention 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.5/userguide/upgrading_version_8.html#application_convention_deprecation
archivesBaseName = "sample-order-service" | ||
base { | ||
archivesName = "sample-order-service" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix suppress the following warning message:
The org.gradle.api.plugins.BasePluginConvention 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.5/userguide/upgrading_version_8.html#base_convention_deprecation
sourceCompatibility = 1.8 | ||
targetCompatibility = 1.8 | ||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(8) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix suppress the following warning message:
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.5/userguide/upgrading_version_8.html#java_convention_deprecation
id 'com.google.protobuf' version '0.9.1' | ||
id 'com.google.protobuf' version '0.9.4' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To suppress the following warning message, com.google.protobuf
must be upgraded.
The Provider.forUseAtConfigurationTime method has been deprecated. This is scheduled to be removed in Gradle 9.0. Simply remove the call. Consult the upgrading guide for further information: https://docs.gradle.org/8.5/userguide/upgrading_version_7.html#for_use_at_configuration_time_deprecation
@@ -20,16 +20,40 @@ protobuf { | |||
generateProtoTasks { | |||
all()*.plugins { grpc {} } | |||
} | |||
generatedFilesBaseDir = "$projectDir/src" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generatedFilesBaseDir
is deprecated in com.google.protobuf
v0.9.2- (ref. google/protobuf-gradle-plugin#636).
// Task copyGeneratedProtoToSrc copies the generated .java files into src directory | ||
task copyGeneratedProtoToSrc(type: Copy) { | ||
description 'Copies generated Protocol Buffer classes to src/main/java/sample/rpc' | ||
dependsOn generateProto | ||
from "$buildDir/generated/source/proto/main/java/sample/rpc" | ||
into "$projectDir/src/main/java/sample/rpc" | ||
duplicatesStrategy = DuplicatesStrategy.INCLUDE | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since generatedFilesBaseDir
is deprecated, we need to implement a similar functionality using copy.
// Task deleteBuildMainJava deletes the generated .java files in build directory | ||
task deleteBuildMainJava(type: Delete) { | ||
dependsOn copyGeneratedProtoToSrc | ||
delete fileTree(dir: "$buildDir/generated/source/proto/main/java/sample/rpc") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before running the compileJava task, the files under src/main/java must be deleted, otherwise we will get duplicate class errors like:
xxx/scalardb-samples/microservice-transaction-sample/rpc/build/generated/source/proto/main/java/sample/rpc/CommitRequest.java:9: エラー: クラスsample.rpc.CommitRequestが重複しています
public final class CommitRequest extends
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This task seems to delete only the generated protobuf files in the build directory, but the current task name might look to delete more. How about adding GeneratedProtobuf
or something to the task name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@komamitsu Thanks for reviewing! I applied your suggestion in 8427a0d. PTAL!
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because there is kotlin { jvmToolchain(8) }
, this setting seems to be unnecessary.
I've confirmed that no warnings appear when executing
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the updates!
Overall looks good to me, but I left minor comments.
Please take a look when you have time! 🙇♂️
...ervice-transaction-sample/customer-service/src/main/java/sample/customer/model/Customer.java
Outdated
Show resolved
Hide resolved
microservice-transaction-sample/order-service/src/main/java/sample/order/model/Item.java
Outdated
Show resolved
Hide resolved
microservice-transaction-sample/order-service/src/main/java/sample/order/model/Order.java
Outdated
Show resolved
Hide resolved
microservice-transaction-sample/order-service/src/main/java/sample/order/model/Statement.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
Description
This PR replaces deprecated Gradle/ScalarDB features to suppress warning messages.
The sample applications of ScalarDB use some deprecated Gradle features and
put
API of ScalarDB. Due to these reasons, multiple warning messages are displayed when the sample application is executed, which is annoying to users.So this PR replaces all deprecated Gradle features and replaces
put
API of ScalarDB withupdate
/insert
.Related issues and/or PRs
N/A
Changes made
put
API of ScalarDB withupdate
/insert
.Checklist
Additional notes (optional)
N/A