File tree Expand file tree Collapse file tree
src/com/dengzii/plugin/template/model
test/com/dengzii/plugin/template/model Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<idea-plugin >
22 <id >com.dengzii.plugin.template</id >
33 <name >Generate Module From Template</name >
4- <version >1.6.6 </version >
4+ <version >1.6.8 </version >
55 <vendor email =" dengzii@foxmail.com" url =" https://github.com/dengzii" >dengzi</vendor >
66
77 <description ><![CDATA[
@@ -43,8 +43,8 @@ Any question please <a href='https://github.com/dengzii/GenerateModuleFromTempla
4343 ]]> </description >
4444
4545 <change-notes ><![CDATA[
46- <b>Version 1.6.6 (2024/02/21)</b><br>
47- 1. Fix: file tree node resolve order incorrect .<br>
46+ <b>Version 1.6.8 (2024/02/21)</b><br>
47+ 1. Fix: file tree node creation problem .<br>
4848 <b>Version 1.6.5 (2023/12/11)</b><br>
4949 1. Update: File template support match by file path.<br>
5050 2. Fix: ApacheVelocity template lang not work.<br>
Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ open class FileTreeNode() {
5353 @Transient
5454 var context: VelocityContext ? = null
5555
56+ var resolvedFileTemplates: MutableMap <String , String >? = null
57+
5658 // flag whether the node is resolved, if true, represents the node info has been resolved via the velocity engine or placeholders.
5759 @Transient
5860 var resolved: Boolean = false
@@ -224,9 +226,9 @@ open class FileTreeNode() {
224226 }
225227
226228 fun getPlaceholderInherit (): MutableMap <String , String >? {
227- return parent?.getPlaceholderInherit()?. apply {
228- putAll(placeholders.orEmpty ())
229- } ? : placeholders ? : mutableMapOf ()
229+ val r = parent?.getPlaceholderInherit() ? : mutableMapOf ()
230+ r. putAll(placeholders ? : mapOf ())
231+ return r
230232 }
231233
232234 /* *
@@ -266,7 +268,7 @@ open class FileTreeNode() {
266268 resolveTreeFileName()
267269 resolveFileTemplate()
268270 traversal({ it, _ ->
269- it.resolved = true
271+ it.resolve()
270272 })
271273 }
272274
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ class FileTreeNodeTest : TestCase() {
8989
9090 fun testAppcacheVelocity () {
9191 val r = """
92- !{StringUtils.removeAndHump(!{ FEATURE_NAME.replaceAll("[^\w]", "_")} )}Module.kt
92+ !{StringUtils.removeAndHump(FEATURE_NAME.replaceAll("[^\w]", "_"))}Module.kt
9393 """ .replace(" !" , " \$ " )
9494
9595 val dsl = FileTreeDsl {
You can’t perform that action at this time.
0 commit comments