Class KspExtension
-
- All Implemented Interfaces:
public abstract class KspExtension
-
-
Field Summary
Fields Modifier and Type Field Description private final Property<Boolean>useKsp2private final ConfigurableFileCollectionexcludedSourcesprivate final Map<String, String>argumentsprivate BooleanblockOtherCompilerPluginsprivate BooleanallowSourcesFromOtherPluginsprivate BooleanallWarningsAsErrors
-
Constructor Summary
Constructors Constructor Description KspExtension(Project project)
-
Method Summary
Modifier and Type Method Description abstract Property<Boolean>getUseKsp2()Enables or disables KSP 2, defaults to the ksp.useKSP2gradle property ortrueif that's not set.abstract ConfigurableFileCollectiongetExcludedSources()Sources that should be excluded from processing by Kotlin Symbol Processors. Map<String, String>getArguments()BooleangetBlockOtherCompilerPlugins()UnitsetBlockOtherCompilerPlugins(@Deprecated(message = "No-op. KSP no longer reads this property") Boolean blockOtherCompilerPlugins)BooleangetAllowSourcesFromOtherPlugins()UnitsetAllowSourcesFromOtherPlugins(@Deprecated(message = "This feature is broken in recent versions of Gradle and is no longer supported in KSP2.") Boolean allowSourcesFromOtherPlugins)BooleangetAllWarningsAsErrors()Treat all warnings as errors. UnitsetAllWarningsAsErrors(Boolean allWarningsAsErrors)Treat all warnings as errors. Unitarg(String k, String v)Add a key/value pair to pass an argument to the processors. Unitarg(String k, Provider<String> v)Add a key/value pair to pass an argument to the processors. Unitarg(CommandLineArgumentProvider arg)Add an argument in a form of "key=value" to pass to the processors. UnitexcludeProcessor(String fullyQualifiedName)Exclude calling the processor provider with given class with fullyQualifiedName. -
-
Method Detail
-
getUseKsp2
abstract Property<Boolean> getUseKsp2()
Enables or disables KSP 2, defaults to the
ksp.useKSP2gradle property ortrueif that's not set.This API is temporary and will be removed once KSP1 is removed.
-
getExcludedSources
abstract ConfigurableFileCollection getExcludedSources()
Sources that should be excluded from processing by Kotlin Symbol Processors.
If you have a task that generates sources, you can call
ksp.excludedSources.from(task)for those sources to be added to the file collection.
-
getArguments
Map<String, String> getArguments()
-
getBlockOtherCompilerPlugins
Boolean getBlockOtherCompilerPlugins()
-
setBlockOtherCompilerPlugins
Unit setBlockOtherCompilerPlugins(@Deprecated(message = "No-op. KSP no longer reads this property") Boolean blockOtherCompilerPlugins)
-
getAllowSourcesFromOtherPlugins
Boolean getAllowSourcesFromOtherPlugins()
-
setAllowSourcesFromOtherPlugins
Unit setAllowSourcesFromOtherPlugins(@Deprecated(message = "This feature is broken in recent versions of Gradle and is no longer supported in KSP2.") Boolean allowSourcesFromOtherPlugins)
-
getAllWarningsAsErrors
Boolean getAllWarningsAsErrors()
Treat all warnings as errors.
-
setAllWarningsAsErrors
Unit setAllWarningsAsErrors(Boolean allWarningsAsErrors)
Treat all warnings as errors.
-
arg
Unit arg(String k, Provider<String> v)
Add a key/value pair to pass an argument to the processors.
-
arg
Unit arg(CommandLineArgumentProvider arg)
Add an argument in a form of "key=value" to pass to the processors.
-
excludeProcessor
Unit excludeProcessor(String fullyQualifiedName)
Exclude calling the processor provider with given class with fullyQualifiedName. By default, all
com.google.devtools.ksp.processing.SymbolProcessorProvideron the processor classpath are called.Note, the excluded providers will still be loaded, but not called.
-
-
-
-