Skip to content
Merged
Changes from 2 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
12 changes: 6 additions & 6 deletions modules/codegen/src/smithy4s/codegen/internals/ModelLoader.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,14 @@ private[codegen] object ModelLoader {
}
}

val validatorClassLoader = locally {
val jarUrls = deps.map(_.toURI().toURL()).toArray
new URLClassLoader(jarUrls, currentClassLoader)
}

// Loading the upstream model
val upstreamModel = Model
.assembler()
.assembler(validatorClassLoader)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should make the classes (validators, trait services) visible to the assembler - but notably not making the models visible.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notably this doesn't solve the problems that #1705 and #1707 are attempting to solve, but it's a step in the right direction and doesn't clash with them

// disabling cache to support snapshot-driven experimentation
.putProperty(ModelAssembler.DISABLE_JAR_CACHE, true)
.addClasspathModels(currentClassLoader, discoverModels)
Expand All @@ -95,11 +100,6 @@ private[codegen] object ModelLoader {
case _ => ()
}

val validatorClassLoader = locally {
val jarUrls = deps.map(_.toURI().toURL()).toArray
new URLClassLoader(jarUrls, currentClassLoader)
}

val preTransformationModel =
Model
.assembler(validatorClassLoader)
Expand Down