forax / pro

A Java build tool that works seamlessly with modules
GNU General Public License v3.0
103 stars 15 forks source link

Runner produces no output and hangs #17

Closed sormuras closed 7 years ago

sormuras commented 7 years ago

When running this build.pro file:

import static com.github.forax.pro.Pro.*;

set("pro.loglevel", "verbose")
set("pro.exitOnError", true)

set("resolver.dependencies", list(
  "junit.platform.console.standalone=org.junit.platform:junit-platform-console-standalone:1.0.0-M4"
))

set("packager.moduleMetadata", list(
  "application.api@1.0-SNAPSHOT",
  "integration@1.0-SNAPSHOT/integration.ConsoleLauncherIntegration"
))

run("resolver", "modulefixer", "compiler", "packager", "runner")

/exit

I get the following output that hangs in the "[runner]" command. With Ctrl+C I can get the focus back, but two spawned Java processes are still alive:

[pro] registered plugins compiler, convention, linker, modulefixer, packager, resolver, runner, uberpackager
[compiler] javac --release 9
      -d target\main\exploded
      --module-source-path src\main\java
      --module-path deps
src\main\java\application.api\foo\bar\api\ApplicationMain.java src\main\java\application.api\foo\bar\api\ApplicationPlugin.java src\main\java\application.api\foo\bar\api\ApplicationVersion.java src\main\java\application.api\foo\bar\internal\Reverse.java src\mai
n\java\application.api\module-info.java src\main\java\integration\integration\ConsoleLauncherIntegration.java src\main\java\integration\integration\IntegrationTests.java src\main\java\integration\integration\LegacyTest.java src\main\java\integration\integration
\Uppercase.java src\main\java\integration\module-info.java
[compiler] javac --release 9
      -d target\test\exploded
      --module-source-path target\test\merged
      --module-path deps;target\main\exploded
target\test\merged\application.api\foo\bar\api\ApplicationMain.java target\test\merged\application.api\foo\bar\api\ApplicationPlugin.java target\test\merged\application.api\foo\bar\api\ApplicationPluginTests.java target\test\merged\application.api\foo\bar\api\A
pplicationVersion.java target\test\merged\application.api\foo\bar\api\ApplicationVersionTests.java target\test\merged\application.api\foo\bar\internal\Reverse.java target\test\merged\application.api\foo\bar\internal\ReverseTests.java target\test\merged\applicat
ion.api\module-info.java
[packager] jar --file target\main\artifact\application.api-1.0-SNAPSHOT.jar
    --module-version 1.0-SNAPSHOT
    -C target\main\exploded\application.api
[packager] jar --file target\main\artifact\integration-1.0-SNAPSHOT.jar
    --module-version 1.0-SNAPSHOT
    --main-class integration.ConsoleLauncherIntegration
    -C target\main\exploded\integration
[packager] jar --file target\test\artifact\test-application.api-1.0-SNAPSHOT.jar
    --module-version 1.0-SNAPSHOT
    -C target\test\exploded\application.api
[runner] java --module-path target\main\artifact;deps;target\main\exploded
     --module integration/integration.ConsoleLauncherIntegration

// pro stalls here ... press ctrl+c to exit

Looking at one of the spawned Java processes, it seems that it executes the main method of integration/integration.ConsoleLauncherIntegration shortly and then... nothing.

Am I using the "runner" plugin correctly?

forax commented 7 years ago

Ok, something is wrong between the runner and jshell.

sormuras commented 7 years ago

It works -- now I only need to supply the correct command line options.

👍

sormuras commented 7 years ago

https://travis-ci.org/sormuras/application-junit5-jdk9-demo/builds/222582321

sormuras commented 7 years ago

https://travis-ci.org/sormuras/application-junit5-jdk9-demo/builds/222585679

Now with "real" output -- but still some "working directory" issues.

How do I pass "raw arguments" to Runner's Java command?

set("runner.java.rawArguments", list("--scan-classpath", "...", ...))
forax commented 7 years ago

Oups, i've forgotten to declare the main arguments in the RunnerConf. https://github.com/forax/pro/commit/bf34120e7903ca5bb69822031f986dfacb0e00b0 should fix that.

set("runner.mainArguments", list(...))

sormuras commented 7 years ago

Going to test it now... 👍