Skip to content
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

Add correct transformers to gradle build configurations #56

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions java/hello-world-lambda/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer
import com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer
import com.google.protobuf.gradle.id

plugins {
Expand Down Expand Up @@ -58,6 +61,12 @@ protobuf {
}
}

// Configure shadowJar plugin to properly merge SPI files and Log4j plugin configurations
tasks.withType<ShadowJar> {
transform(Log4j2PluginsCacheFileTransformer::class.java)
transform(ServiceFileTransformer::class.java)
}

// Configure test platform
tasks.withType<Test> {
useJUnitPlatform()
Expand Down
4 changes: 3 additions & 1 deletion kotlin/hello-world-lambda-cdk/lambda/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer
import com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer
import com.google.protobuf.gradle.id

val restateVersion = "0.6.0"
Expand Down Expand Up @@ -80,9 +81,10 @@ protobuf {
}
}

// Configure shadowJar plugin to properly transform Log4j plugin configurations - needed for AWS Lambda logger
// Configure shadowJar plugin to properly merge SPI files and Log4j plugin configurations
tasks.withType<ShadowJar> {
transform(Log4j2PluginsCacheFileTransformer::class.java)
transform(ServiceFileTransformer::class.java)
}

// Configure test platform
Expand Down
10 changes: 9 additions & 1 deletion kotlin/hello-world-lambda/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer
import com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer
import com.google.protobuf.gradle.id
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.9.10"
Expand Down Expand Up @@ -76,6 +78,12 @@ protobuf {
}
}

// Configure shadowJar plugin to properly merge SPI files and Log4j plugin configurations
tasks.withType<ShadowJar> {
transform(Log4j2PluginsCacheFileTransformer::class.java)
transform(ServiceFileTransformer::class.java)
}

// Configure test platform
tasks.withType<Test> {
useJUnitPlatform()
Expand Down
Loading