diff --git a/inngest-core/build.gradle.kts b/inngest-core/build.gradle.kts index a0efb163..27f74ef5 100644 --- a/inngest-core/build.gradle.kts +++ b/inngest-core/build.gradle.kts @@ -1,4 +1,5 @@ description = "Inngest SDK" +version = "0.0.1-SNAPSHOT" plugins { id("org.jetbrains.kotlin.jvm") version "1.9.10" } @@ -17,6 +18,17 @@ dependencies { testImplementation(kotlin("test")) } +tasks.jar { + manifest { + attributes( + mapOf( + "Implementation-Title" to project.name, + "Implementation-Version" to project.version, + ), + ) + } +} + tasks.named("test") { // Use JUnit Platform for unit tests. useJUnitPlatform() diff --git a/inngest-core/src/main/kotlin/com/inngest/Comm.kt b/inngest-core/src/main/kotlin/com/inngest/Comm.kt index e230e599..971d5dc6 100644 --- a/inngest-core/src/main/kotlin/com/inngest/Comm.kt +++ b/inngest-core/src/main/kotlin/com/inngest/Comm.kt @@ -50,7 +50,7 @@ class CommHandler(val functions: HashMap) { return mapOf( "Content-Type" to "application/json", // TODO - Get this from the build - "x-inngest-sdk" to "inngest-kt:v0.0.1", + "x-inngest-sdk" to "inngest-kt:${Version.getVersion()}", // TODO - Pull this from options "x-inngest-framework" to "ktor", ) @@ -123,7 +123,7 @@ class CommHandler(val functions: HashMap) { framework = "ktor", sdk = "kotlin", url = "http://localhost:8080/api/inngest", - v = "0.0.1", + v = Version.getVersion(), functions = getFunctionConfigs(), ) val jsonRequestBody = Klaxon().toJsonString(requestPayload) @@ -163,7 +163,7 @@ class CommHandler(val functions: HashMap) { framework = "ktor", sdk = "kotlin", url = "http://localhost:8080/api/inngest", - v = "0.0.1", + v = Version.getVersion(), functions = getFunctionConfigs(), ) return Klaxon().toJsonString(requestPayload) diff --git a/inngest-core/src/main/kotlin/com/inngest/Version.kt b/inngest-core/src/main/kotlin/com/inngest/Version.kt new file mode 100644 index 00000000..8b24c50f --- /dev/null +++ b/inngest-core/src/main/kotlin/com/inngest/Version.kt @@ -0,0 +1,9 @@ +package com.inngest + +class Version() { + companion object { + private val version: String = Version::class.java.getPackage().implementationVersion + + fun getVersion(): String = version + } +} diff --git a/inngest-spring-boot-demo/build.gradle.kts b/inngest-spring-boot-demo/build.gradle.kts index af6e4c08..722494e5 100644 --- a/inngest-spring-boot-demo/build.gradle.kts +++ b/inngest-spring-boot-demo/build.gradle.kts @@ -33,4 +33,3 @@ dependencyManagement { tasks.withType { useJUnitPlatform() } -