From 66c9056818553ce13d0df459539311da7b8ded97 Mon Sep 17 00:00:00 2001 From: erlingrj Date: Wed, 3 Apr 2024 19:23:19 +0200 Subject: [PATCH 1/3] docker compose also create bin directory if not present --- .../org/lflang/generator/docker/DockerComposeGenerator.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java b/core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java index 52212d5cf1..6e424a7f0f 100644 --- a/core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java +++ b/core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java @@ -125,7 +125,9 @@ public void createLauncher() { var fileConfig = context.getFileConfig(); var packageRoot = fileConfig.srcPkgPath; var srcGenPath = fileConfig.getSrcGenPath(); - var file = fileConfig.binPath.resolve(fileConfig.name).toFile(); + var binPath = fileConfig.binPath; + FileUtil.createDirectoryIfDoesNotExist(binPath.toFile()); + var file = binPath.resolve(fileConfig.name).toFile(); var script = """ #!/bin/bash @@ -142,7 +144,7 @@ public void createLauncher() { writer.write(script); writer.close(); } catch (IOException e) { - messageReporter.nowhere().warning("Unable to write launcher to: " + file.getAbsolutePath()); + messageReporter.nowhere().warning("Unable to write launcher to: " + file.getAbsolutePath()+ " with error: " + e); } if (!file.setExecutable(true, false)) { From a4d7615f87c8f30f39876d3279d848ebe1341421 Mon Sep 17 00:00:00 2001 From: erlingrj Date: Wed, 3 Apr 2024 19:26:29 +0200 Subject: [PATCH 2/3] Spotless --- .../org/lflang/generator/docker/DockerComposeGenerator.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java b/core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java index 6e424a7f0f..9c859020c0 100644 --- a/core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java +++ b/core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java @@ -144,7 +144,9 @@ public void createLauncher() { writer.write(script); writer.close(); } catch (IOException e) { - messageReporter.nowhere().warning("Unable to write launcher to: " + file.getAbsolutePath()+ " with error: " + e); + messageReporter + .nowhere() + .warning("Unable to write launcher to: " + file.getAbsolutePath() + " with error: " + e); } if (!file.setExecutable(true, false)) { From 8f73296ac17e157c6b15d1c957f91a9689670a43 Mon Sep 17 00:00:00 2001 From: Marten Lohstroh Date: Wed, 3 Apr 2024 14:21:08 -0700 Subject: [PATCH 3/3] Update core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java --- .../org/lflang/generator/docker/DockerComposeGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java b/core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java index 9c859020c0..0b2addacdc 100644 --- a/core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java +++ b/core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java @@ -146,7 +146,7 @@ public void createLauncher() { } catch (IOException e) { messageReporter .nowhere() - .warning("Unable to write launcher to: " + file.getAbsolutePath() + " with error: " + e); + .warning("Unable to write launcher to " + file.getAbsolutePath() + " with error: " + e); } if (!file.setExecutable(true, false)) {