Skip to content

Commit fa4adcf

Browse files
authored
Remove separation of kotlin directories in dackka (#4166)
1 parent ab87571 commit fa4adcf

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

buildSrc/src/main/java/com/google/firebase/gradle/plugins/DackkaGenerationTask.kt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ import org.json.JSONObject
2828
*
2929
* @property dackkaJarFile a [File] of the Dackka fat jar
3030
* @property dependencies a list of all dependent jars (the classpath)
31-
* @property kotlinSources a list of kotlin source roots
32-
* @property javaSources a list of java source roots
31+
* @property sources a list of source roots
3332
* @property suppressedFiles a list of files to exclude from documentation
3433
* @property outputDirectory where to store the generated files
3534
*/
@@ -43,11 +42,7 @@ abstract class GenerateDocumentationTaskExtension : DefaultTask() {
4342

4443
@get:InputFiles
4544
@get:PathSensitive(PathSensitivity.RELATIVE)
46-
abstract val kotlinSources: ListProperty<File>
47-
48-
@get:InputFiles
49-
@get:PathSensitive(PathSensitivity.RELATIVE)
50-
abstract val javaSources: ListProperty<File>
45+
abstract val sources: ListProperty<File>
5146

5247
@get:InputFiles
5348
@get:PathSensitive(PathSensitivity.RELATIVE)
@@ -106,7 +101,7 @@ abstract class GenerateDocumentationTask @Inject constructor(
106101
"scopeId" to "androidx",
107102
"sourceSetName" to "main"
108103
),
109-
"sourceRoots" to kotlinSources.get().map { it.path } + javaSources.get().map { it.path },
104+
"sourceRoots" to sources.get().map { it.path },
110105
"classpath" to dependencies.get().map { it.path },
111106
"documentedVisibilities" to listOf("PUBLIC", "PROTECTED"),
112107
"skipEmptyPackages" to "true",

buildSrc/src/main/java/com/google/firebase/gradle/plugins/DackkaPlugin.kt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,32 +183,28 @@ abstract class DackkaPlugin : Plugin<Project> {
183183

184184
val classpath = compileConfiguration.getJars() + project.javadocConfig.getJars() + project.files(bootClasspath)
185185

186-
val sourcesForJava = sourceSets.flatMap {
187-
// TODO(b/246984444): Investigate why kotlinDirectories includes javaDirectories
186+
val sourceDirectories = sourceSets.flatMap {
188187
it.javaDirectories.map { it.absoluteFile }
189188
}
190189

191190
docStubs.configure {
192191
classPath = classpath
193-
sources.set(project.provider { sourcesForJava })
192+
sources.set(project.provider { sourceDirectories })
194193
}
195194

196195
docsTask.configure {
197196
if (!isKotlin) dependsOn(docStubs)
198197

199-
val sourcesForKotlin = emptyList<File>() + projectSpecificSources(project)
200198
val packageLists = fetchPackageLists(project)
201199

202200
val excludedFiles = projectSpecificSuppressedFiles(project)
203-
val fixedJavaSources = if (!isKotlin) listOf(project.docStubs) else sourcesForJava
201+
val fixedSourceDirectories = if (!isKotlin) listOf(project.docStubs) else sourceDirectories
204202

205-
javaSources.set(fixedJavaSources)
203+
sources.set(fixedSourceDirectories + projectSpecificSources(project))
206204
suppressedFiles.set(excludedFiles)
207205
packageListFiles.set(packageLists)
208206

209-
kotlinSources.set(sourcesForKotlin)
210207
dependencies.set(classpath)
211-
212208
outputDirectory.set(targetDirectory)
213209

214210
applyCommonConfigurations()

0 commit comments

Comments
 (0)