zhuyifan

升级

......@@ -10,9 +10,9 @@ plugins {
id 'java'
id 'idea'
id 'application'
id 'org.springframework.boot' version '2.3.3.RELEASE'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'com.google.protobuf' version '0.9.3'
id 'org.springframework.boot' version '2.5.12'
id 'io.spring.dependency-management' version '1.1.6'
id 'com.google.protobuf' version '0.9.4'
}
repositories {
......@@ -29,8 +29,8 @@ application {
}
ext {
grpcVersion = '1.39.0'
protobufVersion = '3.17.2'
grpcVersion = '1.62.2'
protobufVersion = '3.25.3'
}
dependencies {
......@@ -55,20 +55,13 @@ dependencies {
testImplementation "io.grpc:grpc-testing:${grpcVersion}"
}
static def isAppleSilicon() {
// 检测 macOS 并且使用的是 Apple Silicon 架构
return System.getProperty('os.name').toLowerCase().contains('mac') && System.getProperty('os.arch').equals('aarch64')
}
def protocPlatform = isAppleSilicon() ? ':osx-x86_64' : '';
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${protobufVersion}${protocPlatform}"
artifact = "com.google.protobuf:protoc:${protobufVersion}"
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}${protocPlatform}"
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
......@@ -80,13 +73,6 @@ protobuf {
}
}
tasks.withType(JavaCompile).configureEach {
it.options.incremental = true
it.options.compilerArgs += ["-Xlint:unchecked", "-Xlint:deprecation"]
it.options.encoding = "UTF-8"
it.options.fork = true
}
sourceSets {
main {
java {
......@@ -98,6 +84,11 @@ sourceSets {
}
}
tasks {
compileJava {
dependsOn generateProto
}
}
test {
useJUnitPlatform()
......
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.jvmargs=-Xmx4096m -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.incremental=true
org.gradle.configureondemand=true
org.gradle.java.home=/usr/lib/jvm/java-11-openjdk-amd64
\ No newline at end of file
org.gradle.configuration-cache=true
\ No newline at end of file
......
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-6.9-bin.zip
networkTimeout=10000
distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-8.11-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
org.gradle.java.home=/usr/lib/jym/java-17-openidk-amd64
......