Skip to content

Commit

Permalink
fix: Theme asset collection and ComponentTracker path check (#20390) (#…
Browse files Browse the repository at this point in the history
…20414)

Fix collection of theme assets
in windows. Fix componentTracker
patch check in windows.

Co-authored-by: caalador <[email protected]>
  • Loading branch information
vaadin-bot and caalador authored Nov 6, 2024
1 parent c806209 commit 7e6faba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,12 @@ public File findSourceFile(AbstractConfiguration configuration) {
}

File src = configuration.getJavaSourceFolder();
if (ext.equals(".kt") && src.getPath().endsWith("/java")) {
src = new File(src.getPath().substring(0,
src.getPath().lastIndexOf("/java")) + "/kotlin");

// Windows path is with '\' and not '/'. normalize path for check.
String path = src.getPath().replaceAll("\\\\", "/");
if (ext.equals(".kt") && path.endsWith("/java")) {
src = new File(path.substring(0, path.lastIndexOf("/java"))
+ "/kotlin");
}
File javaFile = new File(src,
cls.replace(".", File.separator) + ext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ function copyStaticAssets(themeName, themeProperties, projectStaticAssetsOutputF
Object.keys(assets).forEach((module) => {
const copyRules = assets[module];
Object.keys(copyRules).forEach((copyRule) => {
const nodeSources = resolve('node_modules/', module, copyRule);
// Glob doesn't work with windows path separator so replacing it here.
const nodeSources = resolve('node_modules/', module, copyRule).replace(/\\/g,'/');
const files = globSync(nodeSources, { nodir: true });
const targetFolder = resolve(projectStaticAssetsOutputFolder, 'themes', themeName, copyRules[copyRule]);

Expand Down

0 comments on commit 7e6faba

Please sign in to comment.