diff --git a/web-views/build.gradle b/web-views/build.gradle index 57c8772..1681d4b 100644 --- a/web-views/build.gradle +++ b/web-views/build.gradle @@ -34,6 +34,13 @@ sourceSets { java { compileClasspath += sourceSets.main.output runtimeClasspath += sourceSets.main.output + srcDirs = [file('sketching/java')] + } + groovy { + srcDirs = [file('sketching/groovy')] + } + resources { + srcDirs = [file('sketching/resources')] } } tools { @@ -80,7 +87,7 @@ dependencies { toolsApi libs.picocli toolsImplementation libs.groovy.console - sketchingApi libs.groovy + sketchingImplementation libs.groovy } java { diff --git a/web-views/sketching/EchoElement.wvc b/web-views/sketching/groovy/sketching/EchoElement.wvc similarity index 100% rename from web-views/sketching/EchoElement.wvc rename to web-views/sketching/groovy/sketching/EchoElement.wvc diff --git a/web-views/sketching/Greeter.groovy b/web-views/sketching/groovy/sketching/Greeter.groovy similarity index 100% rename from web-views/sketching/Greeter.groovy rename to web-views/sketching/groovy/sketching/Greeter.groovy diff --git a/web-views/src/sketching/groovy/groowt/view/web/sketching/Greeters.groovy b/web-views/sketching/groovy/sketching/Greeters.groovy similarity index 89% rename from web-views/src/sketching/groovy/groowt/view/web/sketching/Greeters.groovy rename to web-views/sketching/groovy/sketching/Greeters.groovy index 623b830..3123193 100644 --- a/web-views/src/sketching/groovy/groowt/view/web/sketching/Greeters.groovy +++ b/web-views/sketching/groovy/sketching/Greeters.groovy @@ -1,4 +1,4 @@ -package groowt.view.web.sketching +package sketching import groowt.view.web.BaseWebViewComponent diff --git a/web-views/sketching/HelloTarget.wvc b/web-views/sketching/groovy/sketching/HelloTarget.wvc similarity index 100% rename from web-views/sketching/HelloTarget.wvc rename to web-views/sketching/groovy/sketching/HelloTarget.wvc diff --git a/web-views/sketching/Helper.groovy b/web-views/sketching/groovy/sketching/Helper.groovy similarity index 100% rename from web-views/sketching/Helper.groovy rename to web-views/sketching/groovy/sketching/Helper.groovy diff --git a/web-views/sketching/MemberClassComponentType.wvc b/web-views/sketching/groovy/sketching/MemberClassComponentType.wvc similarity index 100% rename from web-views/sketching/MemberClassComponentType.wvc rename to web-views/sketching/groovy/sketching/MemberClassComponentType.wvc diff --git a/web-views/sketching/PreambleHelloTarget.wvc b/web-views/sketching/groovy/sketching/PreambleHelloTarget.wvc similarity index 100% rename from web-views/sketching/PreambleHelloTarget.wvc rename to web-views/sketching/groovy/sketching/PreambleHelloTarget.wvc diff --git a/web-views/sketching/SimpleGreeter.wvc b/web-views/sketching/groovy/sketching/SimpleGreeter.wvc similarity index 100% rename from web-views/sketching/SimpleGreeter.wvc rename to web-views/sketching/groovy/sketching/SimpleGreeter.wvc diff --git a/web-views/sketching/TwoGreeters.wvc b/web-views/sketching/groovy/sketching/TwoGreeters.wvc similarity index 100% rename from web-views/sketching/TwoGreeters.wvc rename to web-views/sketching/groovy/sketching/TwoGreeters.wvc diff --git a/web-views/sketching/UseGreeter.wvc b/web-views/sketching/groovy/sketching/UseGreeter.wvc similarity index 100% rename from web-views/sketching/UseGreeter.wvc rename to web-views/sketching/groovy/sketching/UseGreeter.wvc diff --git a/web-views/sketching/UseHelper.wvc b/web-views/sketching/groovy/sketching/UseHelper.wvc similarity index 100% rename from web-views/sketching/UseHelper.wvc rename to web-views/sketching/groovy/sketching/UseHelper.wvc diff --git a/web-views/todo.md b/web-views/todo.md index 9b476fa..eaa8938 100644 --- a/web-views/todo.md +++ b/web-views/todo.md @@ -10,9 +10,6 @@ for differentiating between closures/scriplets that take an `out` (left-shiftable) param and ones that don't take any. - This could also make differentiating lazy/eager closures/scriptlets easier. - [ ] Check that the lexer/parser can handle `-` dashes in component names/types, so that we can support `data-`, etc. -- [X] Think more about how to compile templates and components alongside each other. Perhaps we just need to bite - the bullet and use a custom Groovy `CompilationUnit` or `CompilerConfiguration` or whatnot to identify `.wvc` files. - - Update 5/17/24: This should be solved with the `DelegatingWvcParserPlugin` which just examines the file extension. - [ ] Get rid of automatically generated script `main` and `run` methods; replace with a custom `main` method which forwards the args to a helper class and then runs the template with the variables similar to the current `runTemplate` helper tool. @@ -21,9 +18,15 @@ - [ ] Create smoke screen test cases for the compiler. - [ ] Separate the api, runtime, and compiler elements. The api/runtime can depend on the compiler. If users really want to meddle with the compiler for some reason, they can depend on it directly. -- [ ] Get rid of sketching source set. - [ ] Fix inner class bug. +### Done +- [X] Get rid of sketching source set. + - Update 5/20/24: Done, but moved to `sketching/(java | groovy)/sketching` src set dirs. +- [X] Think more about how to compile templates and components alongside each other. Perhaps we just need to bite + the bullet and use a custom Groovy `CompilationUnit` or `CompilerConfiguration` or whatnot to identify `.wvc` files. + - Update 5/17/24: This should be solved with the `DelegatingWvcParserPlugin` which just examines the file extension. + ## Syntax ideas - Perhaps we could have a lambda- or closure-like factory at the beginning of a component for creating it. This could bypass the resolve mechanism and just instantiate the component directly via constructor (with some protocol).