Skip to content

External Java command line tool "launcher" feature #23

@sormuras

Description

@sormuras

As a follow-up from #10 I'd like to discuss what's the best (read: pro) way to implement an external Java command line tool launcher. A requirement for such a feature is that it resolves tool's dependencies and executes the tool in its own VM with custom main parameters.

What I'd like to write in a "build.pro" file is something like this pseudo-code:

ExternalTool junit = ExternalTool.builder().withName("junit").withDependencies(list(
  "org.junit.platform:junit-platform-console-standalone:1.0.0-SNAPSHOT"
)).build()
int code = junit.start("--selectTag", "fast")
if (code == 0) code = junit.start("--selectTag", "slow")
// ... handle failures/erros/etc

Or with google-java-format as another example:

ExternalTool format= ExternalTool.builder().withName("format").withDependencies(list(
  "com.google.googlejavaformat:google-java-format:1.3"
)).build()
format.start(Pro.allJavaSourceFilesAsFlatStringArray())

On the disk, I imagine following runtime directories/files:

deps/
  external-tool/
    junit/ (name either generated or given by user)
      junit.platform.console.standalone.jar
   format/
      google.java.format.jar
      guava.jar
      errorprone.jar

Can I (re-)use the existing "runner" plugin to achive this goal?

Note: there's no dependency of project's modules to the external tools.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions