-
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
Changes from 3 commits
bb44f06
d686570
17c6dfa
789b3c2
8427a0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,15 @@ dependencies { | |
} | ||
|
||
application { | ||
mainClassName = 'sample.client.Client' | ||
mainClass = 'sample.client.Client' | ||
} | ||
|
||
archivesBaseName = "sample-order-service" | ||
base { | ||
archivesName = "sample-order-service" | ||
} | ||
Comment on lines
-16
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fix suppress the following warning message:
|
||
|
||
sourceCompatibility = 1.8 | ||
targetCompatibility = 1.8 | ||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(8) | ||
} | ||
} | ||
Comment on lines
-18
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fix suppress the following warning message:
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
plugins { | ||
id 'java' | ||
id 'java-library-distribution' | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. To suppress the following warning message,
|
||
} | ||
|
||
dependencies { | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
|
||
archivesBaseName = "sample-rpc" | ||
base { | ||
archivesName = "sample-rpc" | ||
} | ||
|
||
// 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 | ||
} | ||
Comment on lines
+29
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since |
||
|
||
// 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 commentThe 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:
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @komamitsu Thanks for reviewing! I applied your suggestion in 8427a0d. PTAL! |
||
|
||
// The processResources task needs to depend on the generateProto task because it uses the output | ||
// of the the generateProto task | ||
processResources { | ||
dependsOn generateProto | ||
} | ||
|
||
sourceCompatibility = 1.8 | ||
targetCompatibility = 1.8 | ||
// Task deleteBuildMainJava needs to depend on deleteBuildMainJava to avoid duplicate class error | ||
tasks.named("compileJava").configure { | ||
dependsOn deleteBuildMainJava | ||
} | ||
|
||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(8) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
kotlin("jvm") version "1.8.21" | ||
kotlin("jvm") version "2.0.21" | ||
application | ||
} | ||
|
||
|
@@ -21,13 +21,8 @@ tasks.test { | |
useJUnitPlatform() | ||
} | ||
|
||
tasks.withType<KotlinCompile> { | ||
kotlinOptions.jvmTarget = "1.8" | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
Comment on lines
-28
to
-30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because there is |
||
kotlin { | ||
jvmToolchain(8) | ||
} | ||
|
||
application { | ||
|
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: