-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
69 changed files
with
1,128 additions
and
733 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
* | ||
!dev | ||
!build | ||
!packages | ||
!VERSION | ||
!README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 10 additions & 11 deletions
21
djobi-cli/src/main/java/io/datatok/djobi/cli/CommandFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,28 @@ | ||
package io.datatok.djobi.cli; | ||
|
||
import com.google.inject.Inject; | ||
import com.google.inject.Injector; | ||
import io.datatok.djobi.cli.commands.DjobiCommand; | ||
import org.fusesource.jansi.AnsiConsole; | ||
import com.google.inject.Singleton; | ||
import io.datatok.djobi.cli.utils.CLIUtils; | ||
import picocli.CommandLine; | ||
|
||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@Singleton | ||
public class CommandFactory implements CommandLine.IFactory { | ||
|
||
@Inject | ||
private Injector injector; | ||
|
||
public CommandFactory() { | ||
AnsiConsole.systemInstall(); | ||
} | ||
|
||
public void run(final String[] args) { | ||
CommandLine.run(DjobiCommand.class, this, args); | ||
} | ||
@Inject | ||
private CLIUtils cliUtils; | ||
|
||
@Override | ||
public <K> K create(Class<K> cls) throws Exception { | ||
if (cls.equals(Map.class) || cls.equals(List.class)) { | ||
return CommandLine.defaultFactory().create(cls); | ||
} | ||
return injector.getInstance(cls); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
djobi-cli/src/main/java/io/datatok/djobi/cli/CommandKernel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.datatok.djobi.cli; | ||
|
||
import com.google.inject.Inject; | ||
import com.google.inject.Provider; | ||
import com.google.inject.Singleton; | ||
import io.datatok.djobi.cli.commands.RootCommand; | ||
import picocli.CommandLine; | ||
|
||
@Singleton | ||
public class CommandKernel { | ||
|
||
@Inject | ||
private CommandFactory commandFactory; | ||
|
||
@Inject | ||
private Provider<RootCommand> rootCommandProvider; | ||
|
||
public CommandLine getRootCommand() { | ||
return new CommandLine(rootCommandProvider.get(), commandFactory); | ||
} | ||
|
||
public void run(String... args) { | ||
getRootCommand().execute(args); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.