Skip to content

Commit

Permalink
java class compiler doesn't find error
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Schuehly committed Aug 31, 2023
1 parent 041730f commit b03a5e9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,16 @@ class ViewComponentParser(
val resourceDirPath = getResourceDirPath(rootDir, packagePath)
val resourceHtmlFile = getResourceFile(resourceDirPath)
resourceHtmlFile.writeAll(parsedHtml)

try {
val clazz = Class.forName("de.tschuehly.spring.viewcomponent.jte.JteViewComponentCompiler")
val compiler = (clazz.getConstructor().newInstance() as ViewComponentCompiler)

val classDir = getClassDirPath(rootDir)
compiler.compile(
rootDir = resourceDirPath.toAbsolutePath(),
names = srcFile.name,
classDirectory = listOf(
classDir.toAbsolutePath().toString()
Path.of("jte-classes").toAbsolutePath().toString()
// classDir.toAbsolutePath().toString()
)
)
} catch (e: ClassNotFoundException) {
Expand Down
2 changes: 1 addition & 1 deletion examples/jte-example/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-devtools")

implementation("gg.jte:jte:3.0.0")
implementation("gg.jte:jte:3.0.2")
implementation("org.jetbrains.kotlin:kotlin-reflect")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class JteViewComponentCompiler() : ViewComponentCompiler {
)


config.classPath = classDirectory
config.classPath = null
val compiler = TemplateCompiler(
/* config = */ config,
/* codeResolver = */ DirectoryCodeResolver(rootDir),
Expand Down

0 comments on commit b03a5e9

Please sign in to comment.