File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
src/test/groovy/org/gradlex/javamodule/dependencies/test Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 11package org.gradlex.javamodule.dependencies.test
22
3+ import org.gradle.testkit.runner.TaskOutcome
34import org.gradlex.javamodule.dependencies.test.fixture.GradleBuild
45import spock.lang.Specification
56
@@ -115,4 +116,40 @@ class RequiresRuntimeTest extends Specification {
115116 then :
116117 result. output. contains(" error: package org.slf4j does not exist" )
117118 }
119+
120+ def " generates javadoc with runtime only dependencies in module-info" () {
121+ given :
122+ appBuildFile << '''
123+ java.withJavadocJar()
124+ dependencies.constraints {
125+ javaModuleDependencies {
126+ implementation(gav("org.slf4j", "2.0.3"))
127+ implementation(gav("org.slf4j.simple", "2.0.3"))
128+ }
129+ }
130+ // TODO ideally, this should not be necessary
131+ tasks.javadoc {
132+ classpath = sourceSets.main.get().runtimeClasspath
133+ }
134+ '''
135+ appModuleInfoFile << '''
136+ module org.gradlex.test.app {
137+ requires org.slf4j;
138+ requires /*runtime*/ org.slf4j.simple;
139+
140+ exports org.gradlex.test.app;
141+ }
142+ '''
143+ file(" app/src/main/java/org/gradlex/test/app/Main.java" ) << """
144+ package org.gradlex.test.app;
145+
146+ public class Main {}
147+ """
148+
149+ when :
150+ def result = build()
151+
152+ then :
153+ result. task(' :app:javadoc' ). outcome == TaskOutcome . SUCCESS
154+ }
118155}
You can’t perform that action at this time.
0 commit comments