Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ting-yuan committed Sep 24, 2022
1 parent d760c6a commit c3bdc43
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 32 deletions.
3 changes: 1 addition & 2 deletions gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ val writeTestPropsTask = tasks.register<WriteProperties>("prepareTestConfigurati
property("mavenRepoDir", File(rootProject.buildDir, "repos/test").absolutePath)
property("kspProjectRootDir", rootProject.projectDir.absolutePath)
property("processorClasspath", project.tasks["compileTestKotlin"].outputs.files.asPath)
property("kspCompilerRunner",
project.properties.getOrDefault("ksp.compiler.runner", "inherited") as String)
property("kspCompilerRunner", project.properties.getOrDefault("ksp.compiler.runner", "inherited") as String)
}

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

package com.google.devtools.ksp.gradle

import java.io.File
import javax.inject.Inject
import org.gradle.api.Task
import org.gradle.api.model.ObjectFactory
import org.gradle.api.provider.Property
Expand All @@ -47,6 +45,8 @@ import org.jetbrains.kotlin.gradle.tasks.GradleCompileTaskProvider
import org.jetbrains.kotlin.gradle.utils.newInstance
import org.jetbrains.kotlin.gradle.utils.propertyWithNewInstance
import org.jetbrains.kotlin.konan.target.KonanTarget
import java.io.File
import javax.inject.Inject

internal inline fun <reified T : Any?> ObjectFactory.property() = property(T::class.java)
internal inline fun <reified T : Any?> ObjectFactory.property(initialValue: T) = property<T>().value(initialValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,24 @@ import org.gradle.api.Task
import org.gradle.api.UnknownTaskException
import org.gradle.api.artifacts.Configuration
import org.gradle.api.attributes.Attribute
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.file.FileCollection
import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.MapProperty
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.Classpath
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.LocalState
import org.gradle.api.tasks.Nested
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.language.jvm.tasks.ProcessResources
import org.gradle.process.CommandLineArgumentProvider
import org.gradle.tooling.provider.model.ToolingModelBuilderRegistry
import org.jetbrains.kotlin.config.ApiVersion
import org.jetbrains.kotlin.gradle.plugin.FilesSubpluginOption
Expand All @@ -44,20 +58,6 @@ import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompileTool
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.File
import javax.inject.Inject
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.file.FileCollection
import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.MapProperty
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Classpath
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.LocalState
import org.gradle.api.tasks.Nested
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.OutputDirectory
import org.gradle.process.CommandLineArgumentProvider

class KspGradleSubplugin @Inject internal constructor(private val registry: ToolingModelBuilderRegistry) :
KotlinCompilerPluginSupportPlugin {
Expand Down Expand Up @@ -323,4 +323,3 @@ interface KspTask : Task {
@get:Input
var isKspIncremental: Boolean
}

Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ import com.google.devtools.ksp.gradle.KspGradleSubplugin.Companion.KSP_ARTIFACT_
import com.google.devtools.ksp.gradle.KspGradleSubplugin.Companion.getKspCachesDir
import com.google.devtools.ksp.gradle.KspTask
import com.google.devtools.ksp.gradle.tasks.KspTaskCreator
import java.io.File
import java.nio.file.Paths
import java.util.concurrent.Callable
import javax.inject.Inject
import kotlin.reflect.KProperty1
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.Configuration
Expand Down Expand Up @@ -95,6 +90,11 @@ import org.jetbrains.kotlin.incremental.isJavaFile
import org.jetbrains.kotlin.incremental.isKotlinFile
import org.jetbrains.kotlin.utils.addToStdlib.ifNotEmpty
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
import java.io.File
import java.nio.file.Paths
import java.util.concurrent.Callable
import javax.inject.Inject
import kotlin.reflect.KProperty1

@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "EXPOSED_PARAMETER_TYPE")
internal class Configurator : AbstractKotlinCompileConfig<AbstractKotlinCompile<*>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ import com.google.devtools.ksp.gradle.createKotlinJvmCompilerRunner
import com.google.devtools.ksp.gradle.createKotlinMetadataCompilerRunner
import com.google.devtools.ksp.gradle.createKotlinNativeCompilerRunner
import com.google.devtools.ksp.gradle.tasks.KspTaskCreator
import java.io.File
import java.nio.file.Paths
import javax.inject.Inject
import kotlin.reflect.KProperty1
import org.gradle.api.DefaultTask
import org.gradle.api.Project
import org.gradle.api.Task
Expand Down Expand Up @@ -83,7 +79,6 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.AbstractKotlinNativeCompilation
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinCommonCompilation
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmAndroidCompilation
import org.jetbrains.kotlin.gradle.plugin.mpp.enabledOnCurrentHost
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.KotlinCompilationData
import org.jetbrains.kotlin.gradle.plugin.pluginConfigurationName
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompileTool
Expand All @@ -102,6 +97,10 @@ import org.jetbrains.kotlin.library.impl.isKotlinLibrary
import org.jetbrains.kotlin.utils.JsLibraryUtils
import org.jetbrains.kotlin.utils.addToStdlib.ifNotEmpty
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
import java.io.File
import java.nio.file.Paths
import javax.inject.Inject
import kotlin.reflect.KProperty1

object StandaloneTasks : KspTaskCreator {
override fun createKspTask(
Expand Down Expand Up @@ -594,7 +593,7 @@ abstract class KspTaskJs @Inject constructor(
commonSources,
)

private fun isJsLib(file: File) : Boolean =
private fun isJsLib(file: File): Boolean =
file.exists() && when (backend.get()) {
JS_BACKEND.JS_IR -> isKotlinLibrary(file)
JS_BACKEND.JS_LEGACY -> JsLibraryUtils.isKotlinJavascriptLibrary(file)
Expand Down
3 changes: 1 addition & 2 deletions integration-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ tasks.named<Test>("test") {
systemProperty("kspVersion", version)
systemProperty("agpVersion", agpBaseVersion)
systemProperty("testRepo", File(rootProject.buildDir, "repos/test").absolutePath)
systemProperty("kspCompilerRunner",
project.properties.getOrDefault("ksp.compiler.runner", "inherited") as String)
systemProperty("kspCompilerRunner", project.properties.getOrDefault("ksp.compiler.runner", "inherited") as String)
dependsOn(":api:publishAllPublicationsToTestRepository")
dependsOn(":gradle-plugin:publishAllPublicationsToTestRepository")
dependsOn(":symbol-processing:publishAllPublicationsToTestRepository")
Expand Down

0 comments on commit c3bdc43

Please sign in to comment.