Skip to content

Commit

Permalink
Google Java Format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Aug 5, 2023
1 parent 22cf749 commit a140bd1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
package com.edgechain;

import com.edgechain.lib.flyfly.commands.jbang.JbangCommand;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
import picocli.CommandLine;

import java.net.URL;
import java.nio.file.Paths;

@SpringBootApplication
@EnableScheduling
public class EdgeChainApplication {
public class EdgeChainApplication {

private static final Logger logger = LoggerFactory.getLogger(EdgeChainApplication.class);

Expand Down Expand Up @@ -59,5 +55,4 @@ private static String getJarFileName(Class<?> clazz) {
}
throw new RuntimeException("Invalid jar file");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ public void run(String... args) throws Exception {

public String getBootLoaderClass() {
Map<String, Object> annotatedBeans =
context.getBeansWithAnnotation(SpringBootApplication.class);
context.getBeansWithAnnotation(SpringBootApplication.class);
return annotatedBeans.isEmpty()
? null
: annotatedBeans.values().toArray()[0].getClass().getName();
? null
: annotatedBeans.values().toArray()[0].getClass().getName();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
package com.edgechain.lib.flyfly;

import com.edgechain.lib.flyfly.commands.format.FormatCommand;
import com.edgechain.lib.flyfly.commands.jbang.JbangCommand;
import com.edgechain.lib.flyfly.commands.run.RunCommand;
import org.springframework.stereotype.Component;
import picocli.CommandLine;
import picocli.CommandLine.Command;

@Component
@Command(
name = "edgechain",
subcommands = {
// RunCommand.class,
// FormatCommand.class,
// RunCommand.class,
// FormatCommand.class,
JbangCommand.class,
// CommandLine.HelpCommand.class
// CommandLine.HelpCommand.class
})
public class FlyflyCommand {}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
import picocli.CommandLine.Parameters;

@Component
@Command(
name = "jbang",
description =
"Activate jbang through the jar placed in resources.")
@Command(name = "jbang", description = "Activate jbang through the jar placed in resources.")
public class JbangCommand implements Runnable {

@Parameters(description = "Java file to be executed with jbang;")
Expand Down Expand Up @@ -53,14 +50,14 @@ private void runJbang(File jarFile, String javaFile, String classPathJar) {
try {
// Step One: Execute the initial command to get the classpath
ProcessBuilder pb =
new ProcessBuilder(
"java",
"-cp",
jarFile.getAbsolutePath(),
"dev.jbang.Main",
"--cp",
classPathJar,
javaFile);
new ProcessBuilder(
"java",
"-cp",
jarFile.getAbsolutePath(),
"dev.jbang.Main",
"--cp",
classPathJar,
javaFile);
pb.redirectErrorStream(true);
Process process = pb.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
@Command(
name = "run",
description =
"Run a JAR or Gradle Spring Boot Application. Ignore if your application is executed.", hidden = true)
"Run a JAR or Gradle Spring Boot Application. Ignore if your application is executed.",
hidden = true)
public class RunCommand implements Runnable {

private final Logger log = LoggerFactory.getLogger(this.getClass());
Expand Down

0 comments on commit a140bd1

Please sign in to comment.