vert-x3 / vertx-docgen

Documentation generation
Apache License 2.0
23 stars 11 forks source link

DocGenerator fails to create JSDocGenerator #35

Open chefhoobajoob opened 5 years ago

chefhoobajoob commented 5 years ago

With the following dependency configuration in my gradle 5.3.1 build script:

def vertxVersion = "3.6.3"
dependencies {
    // snip
    compileOnly "io.vertx:vertx-lang-js-gen:$vertxVersion"
    compileOnly "io.vertx:vertx-codetrans:$vertxVersion"
    compileOnly "io.vertx:vertx-docgen:0.9.2"
    annotationProcessor "io.vertx:vertx-docgen:0.9.2"
    annotationProcessor "io.vertx:vertx-lang-js-gen:$vertxVersion"
    annotationProcessor "io.vertx:vertx-rx-java2-gen:$vertxVersion"
    annotationProcessor "io.vertx:vertx-codegen:$vertxVersion"
    // snip
}

...and the following docgen task:

task generateJsAsciiDocs(type: JavaCompile) {
    group = 'documentation'
    source = sourceSets.main.java
    options.annotationProcessorPath = configurations.annotationProcessor
    classpath = configurations.compile + configurations.compileOnly
    destinationDir = project.file("$buildDir/docs/asciidoc/vertx/js-manual")
    options.compilerArgs = [
            "-proc:only",
            "-processor", "io.vertx.docgen.DocGenProcessor",
            "-Adocgen.output=$buildDir/docs/asciidoc/vertx/js-manual"
    ]
}

I get the following build failure when running the js doc generation task:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':generateJsAsciiDocs'.
> java.util.ServiceConfigurationError: io.vertx.docgen.DocGenerator: Provider io.vertx.lang.js.JSDocGenerator could not be instantiated

I've tried various combinations of using compile, compileOnly, and annotationProcessor configurations for the different vertx dependencies, but I can't find any that work.

I have a pretty nearly identical dependency/task configuration for using the codegen libraries in this same project, and those all work without error, but I can't find a way around this docgen problem.

chefhoobajoob commented 5 years ago

Any ideas? Is this a bug or a build script problem?

chefhoobajoob commented 5 years ago

@vietj @cescoffier : any ideas what I should even look for? Still seeing this after updating to use the gradle java-library plugin.

vietj commented 5 years ago

@chefhoobajoob no idea so far