Skip to content

Commit

Permalink
fix: add sources to export (#1348)
Browse files Browse the repository at this point in the history
* Allow Jars with no Main and add sources to export

* fix: restore run without main fail

Co-authored-by: Max Rydahl Andersen <max.andersen@gmail.com>
  • Loading branch information
andreaTP and maxandersen authored Apr 30, 2022
1 parent 5c8094c commit 018acde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/dev/jbang/cli/Export.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static RunContext getRunContext(ExportMixin exportMixin) {
ctx.setAdditionalDependencies(exportMixin.dependencyInfoMixin.getDependencies());
ctx.setAdditionalRepositories(exportMixin.dependencyInfoMixin.getRepositories());
ctx.setAdditionalClasspaths(exportMixin.dependencyInfoMixin.getClasspaths());
// ctx.setAdditionalSources(exportMixin.sources);
ctx.setAdditionalSources(exportMixin.sources);
ctx.setJavaVersion(exportMixin.javaVersion);
ctx.setNativeImage(exportMixin.nativeImage);
return ctx;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/dev/jbang/cli/ExportMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;

import dev.jbang.catalog.CatalogUtil;
import dev.jbang.source.RunContext;
Expand All @@ -30,6 +31,8 @@ public class ExportMixin {
}, description = "Force export, i.e. overwrite exported file if already exists")
boolean force;

@CommandLine.Option(names = { "-s", "--sources" }, description = "Add additional sources.")
List<String> sources;
@CommandLine.Parameters(paramLabel = "scriptOrFile", index = "0", description = "A file or URL to a Java code file", arity = "1")
String scriptOrFile;

Expand Down

0 comments on commit 018acde

Please sign in to comment.