You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/02/11 10:44:14 UTC

[GitHub] [lucene-solr] mocobeta commented on issue #1242: LUCENE-9201: Port documentation-lint task to Gradle build

mocobeta commented on issue #1242: LUCENE-9201: Port documentation-lint task to Gradle build
URL: https://github.com/apache/lucene-solr/pull/1242#issuecomment-584574521
 
 
   Thanks @uschindler for your comments. I rewrote the task to use sourceSets instead of relying the assumption the target projects (for linting) have "src/java".
   However there is another problem, the Java source directory isn't available from SourceSet as far as I know. Actual source directory path is required when executing the ECJ.
   ```groovy
       // excerpt from the custom ECJ lint task
       project.plugins.withId('java', {
         project.sourceSets.each { sourceSet ->
           project.javaexec {
             classpath {
               project.rootProject.configurations.ecj.asPath
             }
             main = "org.eclipse.jdt.internal.compiler.batch.Main"
             args += [
               // Unfortunately, 'testCompileClasspath' is not available from sourceSet, so without the second term test classes cannot be compiled.
               "-classpath", sourceSet.compileClasspath.toList().join(':') + project.configurations.testCompileClasspath.findAll().join(":"),
               "-d", dstDir,
               "-encoding", "UTF-8",
               "-source", "11", // How this can be obtained from sourceSet or project?
               "-target", "11",
               "-nowarn",
               "-enableJavadoc",
               "-properties", "${project.rootProject.rootDir}/lucene/tools/javadoc/ecj.javadocs.prefs",
               "src/java" // ... or "src/test". How this can be obtained from sourceSet or project?
             ]
           }
         }
       })
   ```
   
   SourceSet has a property `allJava` that contains all Java source file, this is no help here.
   https://docs.gradle.org/current/dsl/org.gradle.api.tasks.SourceSet.html#org.gradle.api.tasks.SourceSet
   I might misses something, or another hack is required to identify the actual source directory path?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org