Class ProjectExtsKt

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final static Directory protoDataWorkingDir
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Directory getProtoDataWorkingDir()
      final static Boolean hasJava(Project $self) Tells if this project can deal with Java code.
      final static Boolean hasKotlin(Project $self) Tells if this project can deal with Kotlin code.
      final static Boolean hasCompileTask(Project $self, Language language) Tells if this project has a compile task for the given language.
      final static Boolean hasJavaOrKotlin(Project $self) Verifies if the project can deal with Java or Kotlin code.
      final static JavaCompile javaCompileFor(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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • 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:

        true if java plugin is installed, false otherwise.

      • 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:

        true if 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 just compileJava if 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 just compileKotlin if the source set name is "main". If the task does not fit this described pattern, this method will not find it.