Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 8 additions & 107 deletions gradle-plugin/lint-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
errorLine2=" ~~~">
<location
file="src/main/kotlin/com/google/devtools/ksp/gradle/AndroidPluginIntegration.kt"
line="82"
line="84"
column="58"/>
</issue>

Expand All @@ -19,7 +19,7 @@
errorLine2=" ~~~">
<location
file="src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt"
line="201"
line="223"
column="59"/>
</issue>

Expand All @@ -30,7 +30,7 @@
errorLine2=" ~~~">
<location
file="src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt"
line="323"
line="345"
column="68"/>
</issue>

Expand All @@ -52,7 +52,7 @@
errorLine2=" ~~~">
<location
file="src/main/kotlin/com/google/devtools/ksp/gradle/KspSubplugin.kt"
line="350"
line="361"
column="63"/>
</issue>

Expand All @@ -63,51 +63,29 @@
errorLine2=" ~~~">
<location
file="src/main/kotlin/com/google/devtools/ksp/gradle/KspSubplugin.kt"
line="390"
line="408"
column="51"/>
</issue>

<issue
id="EagerGradleConfiguration"
message="Avoid using method get"
errorLine1=" val kotlinCompileTask = kotlinCompileProvider.get() as KotlinCompile"
errorLine2=" ~~~">
<location
file="src/main/kotlin/com/google/devtools/ksp/gradle/KspSubplugin.kt"
line="477"
column="75"/>
</issue>

<issue
id="EagerGradleConfiguration"
message="Avoid using method get"
errorLine1=" val kotlinCompileTask = kotlinCompileProvider.get() as KotlinNativeCompile"
errorLine2=" ~~~">
<location
file="src/main/kotlin/com/google/devtools/ksp/gradle/KspSubplugin.kt"
line="554"
line="570"
column="75"/>
</issue>

<issue
id="FilePropertyDetector"
message="`Property&lt;File>` is discouraged. Use `RegularFileProperty` or `DirectoryProperty`."
errorLine1=" abstract val destination: Property&lt;File>"
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/kotlin/com/google/devtools/ksp/gradle/KotlinFactories.kt"
line="202"
column="18"/>
</issue>

<issue
id="FilePropertyDetector"
message="`Property&lt;File>` is discouraged. Use `RegularFileProperty` or `DirectoryProperty`."
errorLine1=" abstract val jdkHome: Property&lt;File>"
errorLine2=" ~~~~~~~">
<location
file="src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt"
line="374"
line="397"
column="18"/>
</issue>

Expand All @@ -118,85 +96,8 @@
errorLine2=" ~~~~~~~~~~~~~~">
<location
file="src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt"
line="381"
column="18"/>
</issue>

<issue
id="FilePropertyDetector"
message="`Property&lt;File>` is discouraged. Use `RegularFileProperty` or `DirectoryProperty`."
errorLine1=" abstract val outputBaseDir: Property&lt;File>"
errorLine2=" ~~~~~~~~~~~~~">
<location
file="src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt"
line="384"
line="404"
column="18"/>
</issue>

<issue
id="FilePropertyDetector"
message="`Property&lt;File>` is discouraged. Use `RegularFileProperty` or `DirectoryProperty`."
errorLine1=" abstract val kotlinOutputDir: Property&lt;File>"
errorLine2=" ~~~~~~~~~~~~~~~">
<location
file="src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt"
line="390"
column="18"/>
</issue>

<issue
id="FilePropertyDetector"
message="`Property&lt;File>` is discouraged. Use `RegularFileProperty` or `DirectoryProperty`."
errorLine1=" abstract val javaOutputDir: Property&lt;File>"
errorLine2=" ~~~~~~~~~~~~~">
<location
file="src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt"
line="393"
column="18"/>
</issue>

<issue
id="FilePropertyDetector"
message="`Property&lt;File>` is discouraged. Use `RegularFileProperty` or `DirectoryProperty`."
errorLine1=" abstract val classOutputDir: Property&lt;File>"
errorLine2=" ~~~~~~~~~~~~~~">
<location
file="src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt"
line="396"
column="18"/>
</issue>

<issue
id="FilePropertyDetector"
message="`Property&lt;File>` is discouraged. Use `RegularFileProperty` or `DirectoryProperty`."
errorLine1=" abstract val resourceOutputDir: Property&lt;File>"
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt"
line="399"
column="18"/>
</issue>

<issue
id="GradleProjectIsolation"
message="Use providers.gradleProperty instead of findProperty"
errorLine1=" project.findProperty(&quot;kotlin.native.enableKlibsCrossCompilation&quot;) == &quot;true&quot;"
errorLine2=" ~~~~~~~~~~~~">
<location
file="src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt"
line="326"
column="37"/>
</issue>

<issue
id="WithTypeWithoutConfigureEach"
message="Avoid passing a closure to withType, use withType().configureEach instead"
errorLine1=" project.plugins.withType(KotlinBaseApiPlugin::class.java) {"
errorLine2=" ~~~~~~~~">
<location
file="src/main/kotlin/com/google/devtools/ksp/gradle/KspConfigurations.kt"
line="99"
column="25"/>
</issue>

</issues>
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ import com.android.build.gradle.BaseExtension
import com.android.build.gradle.api.SourceKind
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.file.Directory
import org.gradle.api.file.FileCollection
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.TaskProvider
import org.jetbrains.kotlin.gradle.internal.KaptTask
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmAndroidCompilation
import org.jetbrains.kotlin.util.capitalizeDecapitalize.capitalizeAsciiOnly
import java.io.File
import java.util.concurrent.Callable

/**
Expand Down Expand Up @@ -114,9 +115,9 @@ object AndroidPluginIntegration {
project: Project,
kotlinCompilation: KotlinJvmAndroidCompilation,
kspTaskProvider: TaskProvider<*>,
javaOutputDir: File,
kotlinOutputDir: File,
classOutputDir: File,
javaOutputDir: Provider<Directory>,
kotlinOutputDir: Provider<Directory>,
classOutputDir: Provider<Directory>,
resourcesOutputDir: FileCollection,
) {
val kspJavaOutput = project.fileTree(javaOutputDir).builtBy(kspTaskProvider)
Expand All @@ -135,9 +136,9 @@ object AndroidPluginIntegration {
project: Project,
kotlinCompilation: KotlinJvmAndroidCompilation,
kspTaskProvider: TaskProvider<*>,
javaOutputDir: File,
kotlinOutputDir: File,
classOutputDir: File,
javaOutputDir: Provider<Directory>,
kotlinOutputDir: Provider<Directory>,
classOutputDir: Provider<Directory>,
resourcesOutputDir: FileCollection
) {
// Order is important here as we update task with AGP generated sources and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ package com.google.devtools.ksp.gradle
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.file.FileCollection
import org.gradle.api.model.ObjectFactory
import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.Property
import org.gradle.api.provider.ProviderFactory
import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.IgnoreEmptyDirectories
Expand Down Expand Up @@ -199,7 +199,7 @@ abstract class KspTaskJvm @Inject constructor(
),
KspTask {
@get:OutputDirectory
abstract val destination: Property<File>
abstract val destination: DirectoryProperty
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change, intended?

I did a similar change in #2678 for migrating usages to DirectoryProperty.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I sent a PR for catching these API changes in #2679.


@get:PathSensitive(PathSensitivity.NONE)
@get:Incremental
Expand Down Expand Up @@ -241,7 +241,8 @@ abstract class KspTaskJvm @Inject constructor(
@get:IgnoreEmptyDirectories
@get:PathSensitive(PathSensitivity.RELATIVE)
override val javaSources: FileCollection = super.javaSources.filter {
!destination.get().isParentOf(it)
// TODO: This is eager realization of destination directory
!destination.get().asFile.isParentOf(it)
}
}

Expand Down
Loading
Loading