Class ProjectExtsKt
-
- All Implemented Interfaces:
public final class ProjectExtsKt
-
-
Field Summary
Fields Modifier and Type Field Description private final static DirectoryprotoDataWorkingDir
-
Method Summary
Modifier and Type Method Description final DirectorygetProtoDataWorkingDir()final static BooleanhasJava(Project $self)Tells if this project can deal with Java code. final static BooleanhasKotlin(Project $self)Tells if this project can deal with Kotlin code. final static BooleanhasCompileTask(Project $self, Language language)Tells if this project has a compile task for the given language. final static BooleanhasJavaOrKotlin(Project $self)Verifies if the project can deal with Java or Kotlin code. final static JavaCompilejavaCompileFor(Project $self, SourceSet sourceSet)Attempts to obtain the Java compilation Gradle task for the given source set. final static KotlinCompilationTask<?>kotlinCompileFor(Project $self, SourceSet sourceSet)Attempts to obtain the Kotlin compilation Gradle task for the given source set. -
-
Method Detail
-
getProtoDataWorkingDir
final Directory getProtoDataWorkingDir()
-
hasJava
@Deprecated(message = "Please use `io.spine.tools.gradle.project.hasJava()` instead.", replaceWith = @ReplaceWith(imports = {"io.spine.tools.gradle.project.hasJava"}, expression = "hasJava()")) final static Boolean hasJava(Project $self)
Tells if this project can deal with Java code.
- Returns:
trueifjavaplugin is installed,falseotherwise.
-
hasKotlin
@Deprecated(message = "Please use `io.spine.tools.gradle.project.hasKotlin()` instead.", replaceWith = @ReplaceWith(imports = {"io.spine.tools.gradle.project.hasKotlin"}, expression = "hasJava()")) final static Boolean hasKotlin(Project $self)
Tells if this project can deal with Kotlin code.
- Returns:
trueif any of the tasks starts with"compile"and ends with"Kotlin".
-
hasCompileTask
@Deprecated(message = "Please use `io.spine.tools.gradle.project.hasCompileTask(Language)` instead.", replaceWith = @ReplaceWith(imports = {"io.spine.tools.gradle.project.hasCompileTask"}, expression = "hasCompileTask(language)")) final static Boolean hasCompileTask(Project $self, Language language)
Tells if this project has a compile task for the given language.
-
hasJavaOrKotlin
@Deprecated(message = "Please use `io.spine.tools.gradle.project.hasJavaOrKotlin()` instead.", replaceWith = @ReplaceWith(imports = {"io.spine.tools.gradle.project.hasJavaOrKotlin"}, expression = "hasJavaOrKotlin()")) final static Boolean hasJavaOrKotlin(Project $self)
Verifies if the project can deal with Java or Kotlin code.
The current Protobuf support of Kotlin is based on Java codegen. Therefore, it is likely that Java would be enabled in the project for Kotlin proto code to be generated. Though, it may change someday, and Kotlin support for Protobuf would be self-sufficient. This method assumes such a case when it checks the presence of Kotlin compilation tasks.
-
javaCompileFor
@Deprecated(message = "Please use `io.spine.tools.gradle.project.javaCompileFor()` instead.", replaceWith = @ReplaceWith(imports = {"io.spine.tools.gradle.project.findJavaCompileFor"}, expression = "javaCompileFor(sourceSet)")) final static JavaCompile javaCompileFor(Project $self, SourceSet sourceSet)
Attempts to obtain the Java compilation Gradle task for the given source set.
Typically, the task is named by a pattern:
compile<SourceSet name>Java, or justcompileJavaif the source set name is"main". If the task does not fit this described pattern, this method will not find it.
-
kotlinCompileFor
@Deprecated(message = "Please use `io.spine.tools.gradle.project.kotlinCompileFor()` instead.", replaceWith = @ReplaceWith(imports = {"io.spine.tools.gradle.project.findKotlinCompileFor"}, expression = "kotlinCompileFor(sourceSet)")) final static KotlinCompilationTask<?> kotlinCompileFor(Project $self, SourceSet sourceSet)
Attempts to obtain the Kotlin compilation Gradle task for the given source set.
Typically, the task is named by a pattern:
compile<SourceSet name>Kotlin, or justcompileKotlinif the source set name is"main". If the task does not fit this described pattern, this method will not find it.
-
-
-
-