Skip to content

Commit 60071b4

Browse files
author
Yann Rouillard
committed
fix: stop requiring com.lihaoyi libraries for schema generation
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 :-)
1 parent 0a06ab6 commit 60071b4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

kafka/check-local-schemas.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ run_schema_generator_code() {
116116
# to the existing source code, so we can run our generator code alongside the existing code
117117
# We need that as the generator code import the schema class
118118
sbt_command+="set Compile / unmanagedSourceDirectories += file(\"${generator_source_folder}\");"
119+
# Dynamically add the required dependencies to the build.sbt file
120+
sbt_command+="set libraryDependencies += \"com.lihaoyi\" %% \"upickle\" % \"3.1.3\";"
121+
sbt_command+="set libraryDependencies += \"com.lihaoyi\" %% \"os-lib\" % \"0.9.1\";"
122+
119123
sbt_command+="runMain kp_pre_commit_hooks.generateSchemaFile ${target_schema_file}"
120124

121125
sbt -batch -error "${sbt_command}"

0 commit comments

Comments
 (0)