From 4b84b888592d3a44c4f45a69c0b913145573f697 Mon Sep 17 00:00:00 2001 From: iamceph Date: Fri, 18 Mar 2022 10:13:32 +0100 Subject: [PATCH] fix: update default version impl --- gradle-plugin/build.gradle | 7 +++++++ .../springed/rsocket/SpringedRSocketExtension.groovy | 2 +- .../iamceph/springed/rsocket/SpringedRSocketPlugin.groovy | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gradle-plugin/build.gradle b/gradle-plugin/build.gradle index 2aa5550..c8a4d2e 100644 --- a/gradle-plugin/build.gradle +++ b/gradle-plugin/build.gradle @@ -44,4 +44,11 @@ tasks.withType(PublishToMavenRepository) { if (name.contains("Sonatype")) { enabled(false) } +} + +jar { + manifest { + attributes('Implementation-Title': 'Springed RSocket plugin', + 'Implementation-Version': "${project.version}") + } } \ No newline at end of file diff --git a/gradle-plugin/src/main/groovy/com/iamceph/springed/rsocket/SpringedRSocketExtension.groovy b/gradle-plugin/src/main/groovy/com/iamceph/springed/rsocket/SpringedRSocketExtension.groovy index 1f74f6b..de20426 100644 --- a/gradle-plugin/src/main/groovy/com/iamceph/springed/rsocket/SpringedRSocketExtension.groovy +++ b/gradle-plugin/src/main/groovy/com/iamceph/springed/rsocket/SpringedRSocketExtension.groovy @@ -3,6 +3,6 @@ package com.iamceph.springed.rsocket class SpringedRSocketExtension { String rsocketVersion = "1.1.1" String rsocketRpcVersion = "0.3.0" - String springedRsocketVersion = "1.0.1" + String springedRsocketVersion String protobufVersion = "3.19.2" } diff --git a/gradle-plugin/src/main/groovy/com/iamceph/springed/rsocket/SpringedRSocketPlugin.groovy b/gradle-plugin/src/main/groovy/com/iamceph/springed/rsocket/SpringedRSocketPlugin.groovy index 61c2532..ad8a58f 100644 --- a/gradle-plugin/src/main/groovy/com/iamceph/springed/rsocket/SpringedRSocketPlugin.groovy +++ b/gradle-plugin/src/main/groovy/com/iamceph/springed/rsocket/SpringedRSocketPlugin.groovy @@ -8,6 +8,7 @@ class SpringedRSocketPlugin implements Plugin { @Override void apply(Project project) { def extension = project.extensions.create("springedRSocket", SpringedRSocketExtension) + extension.springedRsocketVersion = determineVersion() ?: "1.0.1" project.afterEvaluate { project.getPluginManager().withPlugin("java", plugin -> { @@ -17,4 +18,9 @@ class SpringedRSocketPlugin implements Plugin { }) } } + + private static String determineVersion() { + def pack = SpringedRSocketPlugin.class.getPackage() + return pack != null ? pack.getImplementationVersion() : null + } }