Skip to content

Commit

Permalink
Gradle 8.5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
kingster committed Jan 12, 2024
1 parent 448115d commit 246080f
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 9 deletions.
4 changes: 2 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ dependencies {
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ public final void start() throws Exception {
setStarting();
doStart();
setStarted();
AbstractService self = this;
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
// Use stderr here since the logger may have been reset by its JVM shutdown hook.
System.err.println("*** shutting down since JVM is shutting down");
self.stop();
System.err.println("*** server shut down");
}));
} catch (Throwable e) {
setFailed(e);
throw e;
Expand Down
31 changes: 27 additions & 4 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ repositories {
def jexpressVersion = '1.39-SNAPSHOT'
def grpcVersion = '1.38.0'
def protobufVersion = '3.12.0'
def protocVersion = protobufVersion
def protocVersion = protobufVersion+":osx-x86_64"

dependencies {
implementation "com.flipkart.grpc-jexpress:core:${jexpressVersion}"
implementation "com.flipkart.grpc-jexpress:runtime:${jexpressVersion}"
implementation "com.flipkart.grpc-jexpress:guice:${jexpressVersion}"
// implementation "com.flipkart.grpc-jexpress:core:${jexpressVersion}"
// implementation "com.flipkart.grpc-jexpress:runtime:${jexpressVersion}"
// implementation "com.flipkart.grpc-jexpress:guice:${jexpressVersion}"

implementation project(':core')
implementation project(':runtime')
implementation project(':guice')


implementation "io.grpc:grpc-netty-shaded:${grpcVersion}"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
Expand Down Expand Up @@ -74,6 +80,15 @@ task helloWorldServer(type: CreateStartScripts) {
classpath = startScripts.classpath
}

task runHelloWorldServer(type: JavaExec) {
group = "Execution"
description = "run hello-world-server"
classpath = sourceSets.main.runtimeClasspath
mainClass = 'com.flipkart.gjex.examples.helloworld.HelloWorldApplication'
args "server", "./src/main/resources/hello_world_config.yml"
jvmArgs '--add-opens=java.base/java.lang=ALL-UNNAMED'
}


task helloWorldClient(type: CreateStartScripts) {
mainClassName = 'com.flipkart.gjex.examples.helloworld.client.HelloWorldClient'
Expand All @@ -82,6 +97,14 @@ task helloWorldClient(type: CreateStartScripts) {
classpath = startScripts.classpath
}

task runHelloWorldClient(type: JavaExec) {
group = "Execution"
description = "run hello-world-client"
classpath = sourceSets.main.runtimeClasspath
mainClass = 'com.flipkart.gjex.examples.helloworld.client.HelloWorldClient'
jvmArgs '--add-opens=java.base/java.lang=ALL-UNNAMED'
}

applicationDistribution.into('bin') {
from(helloWorldServer)
from(helloWorldClient)
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion guice/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ dependencies {
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
Expand Down
2 changes: 1 addition & 1 deletion runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies {
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
Expand Down

0 comments on commit 246080f

Please sign in to comment.