Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Build): Run Kaoto in Windows #1661

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ public void run() {

CatalogDefinition catalogDefinition = catalogGenerator.generate();
File indexFile = catalogDefinitionFolder.toPath().resolve(catalogDefinition.getFileName()).toFile();
File relateIndexFile = outputFolder.toPath().relativize(indexFile.toPath()).toFile();
String relateIndexFile = outputFolder.toPath().relativize(indexFile.toPath()).toString().replace(File.separator, "/");

catalogDefinition.setFileName(relateIndexFile.toString());

catalogDefinition.setFileName(relateIndexFile);

library.addDefinition(catalogDefinition);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ void testGeneratorCalledWithCorrectParameters() {
File expectedFolder = new File(tempDir, "camel-main/4.8.0");
verify(builder, times(1)).withOutputDirectory(expectedFolder);

String expectedFile = Path.of("camel-main", "4.8.0", "index.json").toString();
/* This path will be used to relatively load the subsequent files, it always needs to use `/` */
String expectedFile = "camel-main/4.8.0/index.json";
assertEquals(catalogDefinition.getFileName(), expectedFile);
}
}
Expand Down Expand Up @@ -126,7 +127,8 @@ void testCatalogLibraryOutput() {
assertEquals(catalogLibraryEntry.version(), "4.8.0");
assertEquals(catalogLibraryEntry.runtime(), "Main");

String expectedFile = Path.of("camel-main", "4.8.0", "index.json").toString();
/* This path will be used to relatively load the subsequent files, it always needs to use `/` */
String expectedFile = "camel-main/4.8.0/index.json";
assertEquals(catalogLibraryEntry.fileName(), expectedFile);
}
}
Expand Down
7 changes: 4 additions & 3 deletions packages/ui/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check
import react from '@vitejs/plugin-react';
import { dirname, relative } from 'node:path';
import { defineConfig } from 'vite';
import { defineConfig, normalizePath } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import packageJson from './package.json';
import { getCamelCatalogFiles } from './scripts/get-camel-catalog-files';
Expand All @@ -19,11 +19,12 @@ export default defineConfig(async () => {
react(),
viteStaticCopy({
targets: camelCatalogFiles.map((file) => {
const normalizedFile = normalizePath(file);
const relativePath = relative(basePath, file);
const dest = './camel-catalog/' + dirname(relativePath);
const dest = normalizePath('./camel-catalog/' + dirname(relativePath));

return {
src: file,
src: normalizedFile,
dest,
transform: (content, filename) => {
return JSON.stringify(JSON.parse(content));
Expand Down
Loading