Move model interfaces code from Java to Kotlin

This commit is contained in:
Lucas Smaira
2018-07-30 12:18:04 +01:00
committed by Sergey Igushkin
parent 52990c9eb1
commit 49292cd26c
21 changed files with 130 additions and 359 deletions
@@ -12,26 +12,12 @@ import java.io.Serializable
* Implementation of the [AllOpen] interface. * Implementation of the [AllOpen] interface.
*/ */
data class AllOpenImpl( data class AllOpenImpl(
private val myName: String, override val name: String,
private val myAnnotations: List<String>, override val annotations: List<String>,
private val myPresets: List<String> override val presets: List<String>
) : AllOpen, Serializable { ) : AllOpen, Serializable {
override fun getModelVersion(): Long { override val modelVersion = serialVersionUID
return serialVersionUID
}
override fun getName(): String {
return myName
}
override fun getAnnotations(): List<String> {
return myAnnotations
}
override fun getPresets(): List<String> {
return myPresets
}
companion object { companion object {
private const val serialVersionUID = 1L private const val serialVersionUID = 1L
@@ -8,7 +8,7 @@ repositories {
} }
dependencies { dependencies {
compile "org.jetbrains:annotations:13.0" compile project(':kotlin-stdlib')
} }
artifacts { artifacts {
@@ -3,17 +3,13 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
package org.jetbrains.kotlin.gradle.model; package org.jetbrains.kotlin.gradle.model
import org.jetbrains.annotations.NotNull;
import java.util.List;
/** /**
* Entry point for Kotlin All Open models. * Entry point for Kotlin All Open models.
* Represents the description of annotations interpreted by 'kotlin-allopen' plugin. * Represents the description of annotations interpreted by 'kotlin-allopen' plugin.
*/ */
public interface AllOpen { interface AllOpen {
/** /**
* Return a number representing the version of this API. * Return a number representing the version of this API.
@@ -21,29 +17,26 @@ public interface AllOpen {
* *
* @return the version of this model. * @return the version of this model.
*/ */
long getModelVersion(); val modelVersion: Long
/** /**
* Returns the module (Gradle project) name. * Returns the module (Gradle project) name.
* *
* @return the module name. * @return the module name.
*/ */
@NotNull val name: String
String getName();
/** /**
* Return the list of annotations. * Return the list of annotations.
* *
* @return the list of annotations. * @return the list of annotations.
*/ */
@NotNull val annotations: List<String>
List<String> getAnnotations();
/** /**
* Return the list of presets. * Return the list of presets.
* *
* @return the list of presets. * @return the list of presets.
*/ */
@NotNull val presets: List<String>
List<String> getPresets(); }
}
@@ -3,40 +3,34 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
package org.jetbrains.kotlin.gradle.model; package org.jetbrains.kotlin.gradle.model
import org.jetbrains.annotations.NotNull; import java.io.File
import java.io.File;
import java.util.List;
/** /**
* Represents the compiler arguments for a given Kotlin source set. * Represents the compiler arguments for a given Kotlin source set.
* @see SourceSet * @see SourceSet
*/ */
public interface CompilerArguments { interface CompilerArguments {
/** /**
* Return current arguments for the given source set. * Return current arguments for the given source set.
* *
* @return current arguments for the given source set. * @return current arguments for the given source set.
*/ */
@NotNull val currentArguments: List<String>
List<String> getCurrentArguments();
/** /**
* Return default arguments for the given source set. * Return default arguments for the given source set.
* *
* @return default arguments for the given source set. * @return default arguments for the given source set.
*/ */
@NotNull val defaultArguments: List<String>
List<String> getDefaultArguments();
/** /**
* Return the classpath the given source set is compiled against. * Return the classpath the given source set is compiled against.
* *
* @return the classpath the given source set is compiled against. * @return the classpath the given source set is compiled against.
*/ */
@NotNull val compileClasspath: List<File>
List<File> getCompileClasspath(); }
}
@@ -3,21 +3,18 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
package org.jetbrains.kotlin.gradle.model; package org.jetbrains.kotlin.gradle.model
import org.jetbrains.annotations.Nullable;
/** /**
* Wraps all experimental features information for a given Kotlin project. * Wraps all experimental features information for a given Kotlin project.
* @see KotlinProject * @see KotlinProject
*/ */
public interface ExperimentalFeatures { interface ExperimentalFeatures {
/** /**
* Return coroutines string. * Return coroutines string.
* *
* @return coroutines. * @return coroutines.
*/ */
@Nullable val coroutines: String?
String getCoroutines(); }
}
@@ -3,17 +3,13 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
package org.jetbrains.kotlin.gradle.model; package org.jetbrains.kotlin.gradle.model
import org.jetbrains.annotations.NotNull;
import java.util.Collection;
/** /**
* Entry point for annotation processor model. * Entry point for annotation processor model.
* Plugin 'kotlin-kapt' can produce this model. * Plugin 'kotlin-kapt' can produce this model.
*/ */
public interface Kapt { interface Kapt {
/** /**
* Return a number representing the version of this API. * Return a number representing the version of this API.
@@ -21,21 +17,19 @@ public interface Kapt {
* *
* @return the version of this model. * @return the version of this model.
*/ */
long getModelVersion(); val modelVersion: Long
/** /**
* Returns the module (Gradle project) name. * Returns the module (Gradle project) name.
* *
* @return the module name. * @return the module name.
*/ */
@NotNull val name: String
String getName();
/** /**
* Return all kapt source sets. * Return all kapt source sets.
* *
* @return all kapt source sets. * @return all kapt source sets.
*/ */
@NotNull val kaptSourceSets: Collection<KaptSourceSet>
Collection<KaptSourceSet> getKaptSourceSets(); }
}
@@ -3,22 +3,20 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
package org.jetbrains.kotlin.gradle.model; package org.jetbrains.kotlin.gradle.model
import org.jetbrains.annotations.NotNull; import java.io.File
import java.io.File;
/** /**
* Represents a source set for a given kapt model. * Represents a source set for a given kapt model.
* @see Kapt * @see Kapt
*/ */
public interface KaptSourceSet { interface KaptSourceSet {
/** /**
* Possible source set types. * Possible source set types.
*/ */
enum KaptSourceSetType { enum class KaptSourceSetType {
PRODUCTION, PRODUCTION,
TEST TEST
} }
@@ -28,38 +26,33 @@ public interface KaptSourceSet {
* *
* @return the source set name. * @return the source set name.
*/ */
@NotNull val name: String
String getName();
/** /**
* Return the type of the source set. * Return the type of the source set.
* *
* @return the type of the source set. * @return the type of the source set.
*/ */
@NotNull val type: KaptSourceSetType
KaptSourceSetType getType();
/** /**
* Return generated sources directory. * Return generated sources directory.
* *
* @return generated sources directory. * @return generated sources directory.
*/ */
@NotNull val generatedSourcesDirectory: File
File getGeneratedSourcesDirectory();
/** /**
* Return Kotlin generated sources directory. * Return Kotlin generated sources directory.
* *
* @return Kotlin generated sources directory. * @return Kotlin generated sources directory.
*/ */
@NotNull val generatedKotlinSourcesDirectory: File
File getGeneratedKotlinSourcesDirectory();
/** /**
* Return Kotlin generated classes directory. * Return Kotlin generated classes directory.
* *
* @return Kotlin generated classes directory. * @return Kotlin generated classes directory.
*/ */
@NotNull val generatedClassesDirectory: File
File getGeneratedClassesDirectory(); }
}
@@ -3,16 +3,13 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
package org.jetbrains.kotlin.gradle.model; package org.jetbrains.kotlin.gradle.model
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/** /**
* Entry point for Kotlin Android Extensions models. * Entry point for Kotlin Android Extensions models.
* Represents the description of Android only features. Provided by 'kotlin-android-extensions' plugin. * Represents the description of Android only features. Provided by 'kotlin-android-extensions' plugin.
*/ */
public interface KotlinAndroidExtension { interface KotlinAndroidExtension {
/** /**
* Return a number representing the version of this API. * Return a number representing the version of this API.
@@ -20,28 +17,26 @@ public interface KotlinAndroidExtension {
* *
* @return the version of this model. * @return the version of this model.
*/ */
long getModelVersion(); val modelVersion: Long
/** /**
* Returns the module (Gradle project) name. * Returns the module (Gradle project) name.
* *
* @return the module name. * @return the module name.
*/ */
@NotNull val name: String
String getName();
/** /**
* Indicate the use of experimental features. * Indicate the use of experimental features.
* *
* @return if experimental features are used. * @return if experimental features are used.
*/ */
boolean isExperimental(); val isExperimental: Boolean
/** /**
* Return the default cache implementation. * Return the default cache implementation.
* *
* @return the default cache implementation. * @return the default cache implementation.
*/ */
@Nullable val defaultCacheImplementation: String?
String getDefaultCacheImplementation(); }
}
@@ -3,30 +3,26 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
package org.jetbrains.kotlin.gradle.model; package org.jetbrains.kotlin.gradle.model
import org.jetbrains.annotations.NotNull;
import java.util.Collection;
/** /**
* Entry point for the model of Kotlin Projects. * Entry point for the model of Kotlin Projects.
* Plugins 'kotlin', 'kotlin-platform-jvm', 'kotlin2js', 'kotlin-platform-js' and 'kotlin-platform-common' can produce this model. * Plugins 'kotlin', 'kotlin-platform-jvm', 'kotlin2js', 'kotlin-platform-js' and 'kotlin-platform-common' can produce this model.
*/ */
public interface KotlinProject { interface KotlinProject {
/** /**
* Possible Kotlin project types. * Possible Kotlin project types.
*/ */
enum ProjectType { enum class ProjectType {
/** Indicator of platform plugin id 'kotlin-platform-jvm' or 'kotlin'. */ /** Indicator of platform plugin id 'kotlin-platform-jvm' or 'kotlin'. */
PLATFORM_JVM, PLATFORM_JVM,
/** Indicator of platform plugin id 'kotlin-platform-js' or 'kotlin2js'. */ /** Indicator of platform plugin id 'kotlin-platform-js' or 'kotlin2js'. */
PLATFORM_JS, PLATFORM_JS,
/** Indicator of platform plugin id 'kotlin-platform-common'. */ /** Indicator of platform plugin id 'kotlin-platform-common'. */
PLATFORM_COMMON PLATFORM_COMMON
} }
@@ -36,53 +32,47 @@ public interface KotlinProject {
* *
* @return the version of this model. * @return the version of this model.
*/ */
long getModelVersion(); val modelVersion: Long
/** /**
* Returns the module (Gradle project) name. * Returns the module (Gradle project) name.
* *
* @return the module name. * @return the module name.
*/ */
@NotNull val name: String
String getName();
/** /**
* Return the Kotlin version. * Return the Kotlin version.
* *
* @return the Kotlin version. * @return the Kotlin version.
*/ */
@NotNull val kotlinVersion: String
String getKotlinVersion();
/** /**
* Return the type of the platform plugin applied. * Return the type of the platform plugin applied.
* *
* @return the type of the platform plugin applied. Possible values are defined in the enum. * @return the type of the platform plugin applied. Possible values are defined in the enum.
*/ */
@NotNull val projectType: ProjectType
ProjectType getProjectType();
/** /**
* Return all source sets used by Kotlin. * Return all source sets used by Kotlin.
* *
* @return all source sets. * @return all source sets.
*/ */
@NotNull val sourceSets: Collection<SourceSet>
Collection<SourceSet> getSourceSets();
/** /**
* Return all modules (Gradle projects) registered as 'expectedBy' dependency. * Return all modules (Gradle projects) registered as 'expectedBy' dependency.
* *
* @return expectedBy dependencies. * @return expectedBy dependencies.
*/ */
@NotNull val expectedByDependencies: Collection<String>
Collection<String> getExpectedByDependencies();
/** /**
* Return an object containing a descriptor of the experimental features. * Return an object containing a descriptor of the experimental features.
* *
* @return experimental features. * @return experimental features.
*/ */
@NotNull val experimentalFeatures: ExperimentalFeatures
ExperimentalFeatures getExperimentalFeatures(); }
}
@@ -3,17 +3,13 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
package org.jetbrains.kotlin.gradle.model; package org.jetbrains.kotlin.gradle.model
import org.jetbrains.annotations.NotNull;
import java.util.List;
/** /**
* Entry point for Kotlin No Arg models. * Entry point for Kotlin No Arg models.
* Represents the description of annotations interpreted by 'kotlin-noarg' plugin. * Represents the description of annotations interpreted by 'kotlin-noarg' plugin.
*/ */
public interface NoArg { interface NoArg {
/** /**
* Return a number representing the version of this API. * Return a number representing the version of this API.
@@ -21,31 +17,28 @@ public interface NoArg {
* *
* @return the version of this model. * @return the version of this model.
*/ */
long getModelVersion(); val modelVersion: Long
/** /**
* Returns the module (Gradle project) name. * Returns the module (Gradle project) name.
* *
* @return the module name. * @return the module name.
*/ */
@NotNull val name: String
String getName();
/** /**
* Return the list of annotations. * Return the list of annotations.
* *
* @return the list of annotations. * @return the list of annotations.
*/ */
@NotNull val annotations: List<String>
List<String> getAnnotations();
/** /**
* Return the list of presets. * Return the list of presets.
* *
* @return the list of presets. * @return the list of presets.
*/ */
@NotNull val presets: List<String>
List<String> getPresets();
/** /**
* Return if should invoke initializers. * Return if should invoke initializers.
@@ -53,5 +46,5 @@ public interface NoArg {
* *
* @return if initializers should be invoked. * @return if initializers should be invoked.
*/ */
boolean isInvokeInitializers(); val isInvokeInitializers: Boolean
} }
@@ -3,17 +3,13 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
package org.jetbrains.kotlin.gradle.model; package org.jetbrains.kotlin.gradle.model
import org.jetbrains.annotations.NotNull;
import java.util.List;
/** /**
* Entry point for Kotlin Sam With Receiver models. * Entry point for Kotlin Sam With Receiver models.
* Represents the description of annotations interpreted by 'kotlin-sam-with-receiver' plugin. * Represents the description of annotations interpreted by 'kotlin-sam-with-receiver' plugin.
*/ */
public interface SamWithReceiver { interface SamWithReceiver {
/** /**
* Return a number representing the version of this API. * Return a number representing the version of this API.
@@ -21,29 +17,26 @@ public interface SamWithReceiver {
* *
* @return the version of this model. * @return the version of this model.
*/ */
long getModelVersion(); val modelVersion: Long
/** /**
* Returns the module (Gradle project) name. * Returns the module (Gradle project) name.
* *
* @return the module name. * @return the module name.
*/ */
@NotNull val name: String
String getName();
/** /**
* Return the list of annotations. * Return the list of annotations.
* *
* @return the list of annotations. * @return the list of annotations.
*/ */
@NotNull val annotations: List<String>
List<String> getAnnotations();
/** /**
* Return the list of presets. * Return the list of presets.
* *
* @return the list of presets. * @return the list of presets.
*/ */
@NotNull val presets: List<String>
List<String> getPresets(); }
}
@@ -3,23 +3,20 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
package org.jetbrains.kotlin.gradle.model; package org.jetbrains.kotlin.gradle.model
import org.jetbrains.annotations.NotNull; import java.io.File
import java.io.File;
import java.util.Collection;
/** /**
* Represents a source set for a given Kotlin Gradle project. * Represents a source set for a given Kotlin Gradle project.
* @see KotlinProject * @see KotlinProject
*/ */
public interface SourceSet { interface SourceSet {
/** /**
* Possible source set types. * Possible source set types.
*/ */
enum SourceSetType { enum class SourceSetType {
PRODUCTION, PRODUCTION,
TEST TEST
} }
@@ -29,62 +26,54 @@ public interface SourceSet {
* *
* @return the source set name. * @return the source set name.
*/ */
@NotNull val name: String
String getName();
/** /**
* Return the type of the source set. * Return the type of the source set.
* *
* @return the type of the source set. * @return the type of the source set.
*/ */
@NotNull val type: SourceSetType
SourceSetType getType();
/** /**
* Return the names of all friend source sets. * Return the names of all friend source sets.
* *
* @return friend source sets. * @return friend source sets.
*/ */
@NotNull val friendSourceSets: Collection<String>
Collection<String> getFriendSourceSets();
/** /**
* Return all Kotlin sources directories. * Return all Kotlin sources directories.
* *
* @return all Kotlin sources directories. * @return all Kotlin sources directories.
*/ */
@NotNull val sourceDirectories: Collection<File>
Collection<File> getSourceDirectories();
/** /**
* Return all Kotlin resources directories. * Return all Kotlin resources directories.
* *
* @return all Kotlin resources directories. * @return all Kotlin resources directories.
*/ */
@NotNull val resourcesDirectories: Collection<File>
Collection<File> getResourcesDirectories();
/** /**
* Return the classes output directory. * Return the classes output directory.
* *
* @return the classes output directory. * @return the classes output directory.
*/ */
@NotNull val classesOutputDirectory: File
File getClassesOutputDirectory();
/** /**
* Return the resources output directory. * Return the resources output directory.
* *
* @return the resources output directory. * @return the resources output directory.
*/ */
@NotNull val resourcesOutputDirectory: File
File getResourcesOutputDirectory();
/** /**
* Return an object containing all compiler arguments for this source set. * Return an object containing all compiler arguments for this source set.
* *
* @return compiler arguments for this source set. * @return compiler arguments for this source set.
*/ */
@NotNull val compilerArguments: CompilerArguments
CompilerArguments getCompilerArguments(); }
}
@@ -13,23 +13,11 @@ import java.io.Serializable
* Implementation of the [CompilerArguments] interface. * Implementation of the [CompilerArguments] interface.
*/ */
data class CompilerArgumentsImpl( data class CompilerArgumentsImpl(
private val myCurrentArguments: List<String>, override val currentArguments: List<String>,
private val myDefaultArguments: List<String>, override val defaultArguments: List<String>,
private val myCompilerClasspath: List<File> override val compileClasspath: List<File>
) : CompilerArguments, Serializable { ) : CompilerArguments, Serializable {
override fun getCurrentArguments(): List<String> {
return myCurrentArguments
}
override fun getDefaultArguments(): List<String> {
return myDefaultArguments
}
override fun getCompileClasspath(): List<File> {
return myCompilerClasspath
}
companion object { companion object {
private const val serialVersionUID = 1L private const val serialVersionUID = 1L
} }
@@ -12,13 +12,9 @@ import java.io.Serializable
* Implementation of the [ExperimentalFeatures] interface. * Implementation of the [ExperimentalFeatures] interface.
*/ */
data class ExperimentalFeaturesImpl( data class ExperimentalFeaturesImpl(
private val myCoroutines: String? override val coroutines: String?
) : ExperimentalFeatures, Serializable { ) : ExperimentalFeatures, Serializable {
override fun getCoroutines(): String? {
return myCoroutines
}
companion object { companion object {
private const val serialVersionUID = 1L private const val serialVersionUID = 1L
} }
@@ -13,21 +13,11 @@ import java.io.Serializable
* Implementation of the [Kapt] interface. * Implementation of the [Kapt] interface.
*/ */
data class KaptImpl( data class KaptImpl(
private val myName: String, override val name: String,
private val kaptSourceSets: Collection<KaptSourceSet> override val kaptSourceSets: Collection<KaptSourceSet>
) : Kapt, Serializable { ) : Kapt, Serializable {
override fun getModelVersion(): Long { override val modelVersion = serialVersionUID
return serialVersionUID
}
override fun getName(): String {
return myName
}
override fun getKaptSourceSets(): Collection<KaptSourceSet> {
return kaptSourceSets
}
companion object { companion object {
private const val serialVersionUID = 1L private const val serialVersionUID = 1L
@@ -13,30 +13,14 @@ import java.io.Serializable
* Implementation of the [KaptSourceSet] interface. * Implementation of the [KaptSourceSet] interface.
*/ */
data class KaptSourceSetImpl( data class KaptSourceSetImpl(
private val myName: String, override val name: String,
private val myType: KaptSourceSet.KaptSourceSetType, override val type: KaptSourceSet.KaptSourceSetType,
private val myGeneratedSourcesDirectory: File, override val generatedSourcesDirectory: File,
private val myGeneratedKotlinSourcesDirectory: File, override val generatedKotlinSourcesDirectory: File,
private val myGeneratedClassesDirectory: File override val generatedClassesDirectory: File
) : KaptSourceSet, Serializable { ) : KaptSourceSet, Serializable {
override fun getName(): String { companion object {
return myName private const val serialVersionUID = 1L
}
override fun getType(): KaptSourceSet.KaptSourceSetType {
return myType
}
override fun getGeneratedSourcesDirectory(): File {
return myGeneratedSourcesDirectory
}
override fun getGeneratedKotlinSourcesDirectory(): File {
return myGeneratedKotlinSourcesDirectory
}
override fun getGeneratedClassesDirectory(): File {
return myGeneratedClassesDirectory
} }
} }
@@ -12,26 +12,12 @@ import java.io.Serializable
* Implementation of the [KotlinAndroidExtension] interface. * Implementation of the [KotlinAndroidExtension] interface.
*/ */
data class KotlinAndroidExtensionImpl( data class KotlinAndroidExtensionImpl(
private val myName: String, override val name: String,
private val myIsExperimental: Boolean, override val isExperimental: Boolean,
private val myDefaultCacheImplementation: String? override val defaultCacheImplementation: String?
) : KotlinAndroidExtension, Serializable { ) : KotlinAndroidExtension, Serializable {
override fun getModelVersion(): Long { override val modelVersion = serialVersionUID
return serialVersionUID
}
override fun getName(): String {
return myName
}
override fun isExperimental(): Boolean {
return myIsExperimental
}
override fun getDefaultCacheImplementation(): String? {
return myDefaultCacheImplementation
}
companion object { companion object {
private const val serialVersionUID = 1L private const val serialVersionUID = 1L
@@ -14,41 +14,15 @@ import java.io.Serializable
* Implementation of the [KotlinProject] interface. * Implementation of the [KotlinProject] interface.
*/ */
data class KotlinProjectImpl( data class KotlinProjectImpl(
private val myName: String, override val name: String,
private val myKotlinVersion: String, override val kotlinVersion: String,
private val myProjectType: KotlinProject.ProjectType, override val projectType: KotlinProject.ProjectType,
private val mySourceSets: Collection<SourceSet>, override val sourceSets: Collection<SourceSet>,
private val myExpectedByDependencies: Collection<String>, override val expectedByDependencies: Collection<String>,
private val myExperimentalFeatures: ExperimentalFeatures override val experimentalFeatures: ExperimentalFeatures
) : KotlinProject, Serializable { ) : KotlinProject, Serializable {
override fun getModelVersion(): Long { override val modelVersion = serialVersionUID
return serialVersionUID
}
override fun getName(): String {
return myName
}
override fun getKotlinVersion(): String {
return myKotlinVersion
}
override fun getProjectType(): KotlinProject.ProjectType {
return myProjectType
}
override fun getSourceSets(): Collection<SourceSet> {
return mySourceSets
}
override fun getExpectedByDependencies(): Collection<String> {
return myExpectedByDependencies
}
override fun getExperimentalFeatures(): ExperimentalFeatures {
return myExperimentalFeatures
}
companion object { companion object {
private const val serialVersionUID = 1L private const val serialVersionUID = 1L
@@ -14,48 +14,16 @@ import java.io.Serializable
* Implementation of the [SourceSet] interface. * Implementation of the [SourceSet] interface.
*/ */
data class SourceSetImpl( data class SourceSetImpl(
private val myName: String, override val name: String,
private val myType: SourceSet.SourceSetType, override val type: SourceSet.SourceSetType,
private val myFriendSourceSets: Collection<String>, override val friendSourceSets: Collection<String>,
private val mySourceDirectories: Collection<File>, override val sourceDirectories: Collection<File>,
private val myResourcesDirectories: Collection<File>, override val resourcesDirectories: Collection<File>,
private val myClassesOutputDirectory: File, override val classesOutputDirectory: File,
private val myResourcesOutputDirectory: File, override val resourcesOutputDirectory: File,
private val myCompilerArguments: CompilerArguments override val compilerArguments: CompilerArguments
) : SourceSet, Serializable { ) : SourceSet, Serializable {
override fun getName(): String {
return myName
}
override fun getType(): SourceSet.SourceSetType {
return myType
}
override fun getFriendSourceSets(): Collection<String> {
return myFriendSourceSets
}
override fun getSourceDirectories(): Collection<File> {
return mySourceDirectories
}
override fun getResourcesDirectories(): Collection<File> {
return myResourcesDirectories
}
override fun getClassesOutputDirectory(): File {
return myClassesOutputDirectory
}
override fun getResourcesOutputDirectory(): File {
return myResourcesOutputDirectory
}
override fun getCompilerArguments(): CompilerArguments {
return myCompilerArguments
}
companion object { companion object {
private const val serialVersionUID = 1L private const val serialVersionUID = 1L
} }
@@ -12,31 +12,13 @@ import java.io.Serializable
* Implementation of the [NoArg] interface. * Implementation of the [NoArg] interface.
*/ */
data class NoArgImpl( data class NoArgImpl(
private val myName: String, override val name: String,
private val myAnnotations: List<String>, override val annotations: List<String>,
private val myPresets: List<String>, override val presets: List<String>,
private val myInvokeInitializers: Boolean override val isInvokeInitializers: Boolean
) : NoArg, Serializable { ) : NoArg, Serializable {
override fun getModelVersion(): Long { override val modelVersion = serialVersionUID
return serialVersionUID
}
override fun getName(): String {
return myName
}
override fun getAnnotations(): List<String> {
return myAnnotations
}
override fun getPresets(): List<String> {
return myPresets
}
override fun isInvokeInitializers(): Boolean {
return myInvokeInitializers
}
companion object { companion object {
private const val serialVersionUID = 1L private const val serialVersionUID = 1L
@@ -12,26 +12,12 @@ import java.io.Serializable
* Implementation of the [SamWithReceiver] interface. * Implementation of the [SamWithReceiver] interface.
*/ */
data class SamWithReceiverImpl( data class SamWithReceiverImpl(
private val myName: String, override val name: String,
private val myAnnotations: List<String>, override val annotations: List<String>,
private val myPresets: List<String> override val presets: List<String>
) : SamWithReceiver, Serializable { ) : SamWithReceiver, Serializable {
override fun getModelVersion(): Long { override val modelVersion = serialVersionUID
return serialVersionUID
}
override fun getName(): String {
return myName
}
override fun getAnnotations(): List<String> {
return myAnnotations
}
override fun getPresets(): List<String> {
return myPresets
}
companion object { companion object {
private const val serialVersionUID = 1L private const val serialVersionUID = 1L