Skip to content

Commit

Permalink
Add TYPESCRIPT_SDK_LOCAL_BUILD and rename E2E_LOCAL_BUILD to JAVA_SDK…
Browse files Browse the repository at this point in the history
…_LOCAL_BUILD.
  • Loading branch information
slinkydeveloper committed May 25, 2023
1 parent b982144 commit ec32cc4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ This will populate your local image registry with the various function container
### How to test Java SDK changes

In order to test local changes to the `sdk-java`, you need to check it out under `../sdk-java`.
When building the `e2e` project you have to set the environment variable `E2E_LOCAL_BUILD=true` to include `sdk-java` as a composite build and substitute the `dev.restate.sdk:sdk-java` dependency with it.
When building the `e2e` project you have to set the environment variable `JAVA_SDK_LOCAL_BUILD=true`
to include `sdk-java` as a composite build and substitute the `dev.restate.sdk:sdk-java` dependency with it.
The build will fail if Gradle cannot find the `sdk-java` project.

### How to test Typescript SDK changes
Expand All @@ -54,6 +55,8 @@ gradle :services:node-services:installLocalTypescriptSdk

This will build the Typescript SDK, pack it with `npm pack`, and copy it over to the node-services directory and install it.

You can include `gradle :services:node-services:installLocalTypescriptSdk` in the build process by setting `TYPESCRIPT_SDK_LOCAL_BUILD=true`.

### How to test Restate runtime changes

You can manually build a docker image in the restate project using `just docker`. Then set the environment variable `RESTATE_RUNTIME_CONTAINER` with the tag of the newly created image (printed at the end of the docker build log).
5 changes: 5 additions & 0 deletions services/node-services/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ tasks.register("generateProto") {

tasks.register<Copy>("prepareDockerBuild") {
dependsOn("generateProto")

if (!System.getenv("TYPESCRIPT_SDK_LOCAL_BUILD").isNullOrEmpty()) {
dependsOn("installLocalTypescriptSdk")
}

from(".") {
include("src/**")
into("src")
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ dependencyResolutionManagement {
}

// Include composite build for easier local testing
if (!System.getenv("E2E_LOCAL_BUILD").isNullOrEmpty()) {
if (!System.getenv("JAVA_SDK_LOCAL_BUILD").isNullOrEmpty()) {
includeBuild("../sdk-java") {
dependencySubstitution {
substitute(module("dev.restate.sdk:sdk-core")).using(project(":sdk-core"))
Expand Down

0 comments on commit ec32cc4

Please sign in to comment.