Skip to content

Commit

Permalink
fix: stop requiring com.lihaoyi libraries for schema generation
Browse files Browse the repository at this point in the history
Instead of requiring the project to load the com.lihaoyi.upickle
and com.lihaoyi.os-lib libraries in the project, we now dynamically
add them to the dependencies when running the schema generation command.

It still not bulletproof as it could lead to version conflict with
existing libraries but it will good enough for now :-)
  • Loading branch information
Yann Rouillard committed Feb 5, 2024
1 parent 0a06ab6 commit 60071b4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kafka/check-local-schemas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ run_schema_generator_code() {
# to the existing source code, so we can run our generator code alongside the existing code
# We need that as the generator code import the schema class
sbt_command+="set Compile / unmanagedSourceDirectories += file(\"${generator_source_folder}\");"
# Dynamically add the required dependencies to the build.sbt file
sbt_command+="set libraryDependencies += \"com.lihaoyi\" %% \"upickle\" % \"3.1.3\";"
sbt_command+="set libraryDependencies += \"com.lihaoyi\" %% \"os-lib\" % \"0.9.1\";"

sbt_command+="runMain kp_pre_commit_hooks.generateSchemaFile ${target_schema_file}"

sbt -batch -error "${sbt_command}"
Expand Down

0 comments on commit 60071b4

Please sign in to comment.