Skip to content

Commit

Permalink
Use Main.java for JBang projects
Browse files Browse the repository at this point in the history
  • Loading branch information
ebullient committed Jun 2, 2021
1 parent cc94f11 commit 1cebd40
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ Path valdiateJBangSourcePackage(Path project, String name) {
Assertions.assertTrue(packagePath.toFile().isDirectory(),
"Package directory should be a directory: " + packagePath.toAbsolutePath().toString());

return packagePath.resolve("GreetingResource.java");
return packagePath.resolve("main.java");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ language:
base:
data:
command:
class-name: GreetingCommand
class-name: main
name: Greeting
dependencies:
- io.quarkus:quarkus-picocli
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ language:
base:
data:
resource:
class-name: GreetingResource
class-name: main
path: "/hello-resteasy"
response: "Hello RESTEasy"
dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void createRESTEasy() throws Exception {

assertThat(projectDir.resolve("jbang")).exists();

assertThat(projectDir.resolve("src/GreetingResource.java"))
assertThat(projectDir.resolve("src/main.java"))
.exists()
.satisfies(checkContains("//usr/bin/env jbang \"$0\" \"$@\" ; exit $?"))
.satisfies(checkContains("//DEPS io.quarkus:quarkus-resteasy"));
Expand All @@ -45,7 +45,7 @@ public void createRESTEasyWithNoJBangWrapper() throws Exception {

assertThat(projectDir.resolve("jbang")).doesNotExist();

assertThat(projectDir.resolve("src/GreetingResource.java"))
assertThat(projectDir.resolve("src/main.java"))
.exists()
.satisfies(checkContains("//usr/bin/env jbang \"$0\" \"$@\" ; exit $?"))
.satisfies(checkContains("//DEPS io.quarkus:quarkus-resteasy"));
Expand All @@ -65,7 +65,7 @@ public void createRESTEasyWithExtensions() throws Exception {

assertThat(projectDir.resolve("jbang")).exists();

assertThat(projectDir.resolve("src/GreetingResource.java"))
assertThat(projectDir.resolve("src/main.java"))
.exists()
.satisfies(checkContains("//usr/bin/env jbang \"$0\" \"$@\" ; exit $?"))
.satisfies(checkContains("//DEPS io.quarkus:quarkus-resteasy"))
Expand Down

0 comments on commit 1cebd40

Please sign in to comment.