Skip to content

Commit

Permalink
#776 | Register web spring files available due `ext.?.extension.webmo…
Browse files Browse the repository at this point in the history
…dule.webroot` property
  • Loading branch information
mlytvyn authored Oct 29, 2023
1 parent bb5a1ac commit 9694cbb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## [2023.2.10]

### `Project Import` enhancements
- Register web spring files available due `ext.?.extension.webmodule.webroot` property [#776](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/776)
- Do not register SAP javadocs for custom extensions [#763](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/763)
- Use custom library names for all custom libraries [#764](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/764)
- Ignore non-`[y]` project roots if they will affect project import [#774](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/774)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import java.io.IOException
import java.util.*
import java.util.regex.Pattern
import java.util.zip.ZipFile
import kotlin.io.path.exists

class DefaultSpringConfigurator : SpringConfigurator {

Expand Down Expand Up @@ -129,6 +130,20 @@ class DefaultSpringConfigurator : SpringConfigurator {
LOG.error("", e)
return
}

// specifci case for OCC like extensions, usually, they have web-spring.xml files in the corresponding resources folder
projectProperties.getProperty("ext.${moduleDescriptor.name}.extension.webmodule.webroot")
?.let { if (it.startsWith("/")) it.removePrefix("/") else it }
?.let {
getResourceDir(moduleDescriptor).toPath()
.resolve(it)
.resolve(moduleDescriptor.name)
.resolve("web")
.resolve("spring")
}
?.takeIf { it.exists() }
?.let { addSpringXmlFile(moduleDescriptorMap, moduleDescriptor, it.toFile(), moduleDescriptor.name + "-web-spring.xml") }

projectProperties.stringPropertyNames()
.filter {
it.endsWith(HybrisConstants.APPLICATION_CONTEXT_SPRING_FILES)
Expand Down

0 comments on commit 9694cbb

Please sign in to comment.