Introduce tooling model for annotation based projects

Introduce Gradle models for plugins 'kotlin-allopen', 'kotlin-noarg' and
'kotlin-sam-with-receiver'. Corresponding model builders are registered
in each one of those plugin main classes.
This commit is contained in:
Lucas Smaira
2018-06-05 17:46:35 +01:00
committed by Sergey Igushkin
parent 5671dbb929
commit 5a423e8dcd
25 changed files with 631 additions and 5 deletions
@@ -0,0 +1,49 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.gradle.model;
import org.jetbrains.annotations.NotNull;
import java.util.List;
/**
* Entry point for Kotlin All Open models.
* Represents the description of annotations interpreted by 'kotlin-allopen' plugin.
*/
public interface AllOpen {
/**
* Return a number representing the version of this API.
* Always increasing if changed.
*
* @return the version of this model.
*/
long getModelVersion();
/**
* Returns the module (Gradle project) name.
*
* @return the module name.
*/
@NotNull
String getName();
/**
* Return the list of annotations.
*
* @return the list of annotations.
*/
@NotNull
List<String> getAnnotations();
/**
* Return the list of presets.
*
* @return the list of presets.
*/
@NotNull
List<String> getPresets();
}
@@ -0,0 +1,57 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.gradle.model;
import org.jetbrains.annotations.NotNull;
import java.util.List;
/**
* Entry point for Kotlin No Arg models.
* Represents the description of annotations interpreted by 'kotlin-noarg' plugin.
*/
public interface NoArg {
/**
* Return a number representing the version of this API.
* Always increasing if changed.
*
* @return the version of this model.
*/
long getModelVersion();
/**
* Returns the module (Gradle project) name.
*
* @return the module name.
*/
@NotNull
String getName();
/**
* Return the list of annotations.
*
* @return the list of annotations.
*/
@NotNull
List<String> getAnnotations();
/**
* Return the list of presets.
*
* @return the list of presets.
*/
@NotNull
List<String> getPresets();
/**
* Return if should invoke initializers.
* Only makes sense for type NO_ARG.
*
* @return if initializers should be invoked.
*/
boolean isInvokeInitializers();
}
@@ -0,0 +1,49 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.gradle.model;
import org.jetbrains.annotations.NotNull;
import java.util.List;
/**
* Entry point for Kotlin Sam With Receiver models.
* Represents the description of annotations interpreted by 'kotlin-sam-with-receiver' plugin.
*/
public interface SamWithReceiver {
/**
* Return a number representing the version of this API.
* Always increasing if changed.
*
* @return the version of this model.
*/
long getModelVersion();
/**
* Returns the module (Gradle project) name.
*
* @return the module name.
*/
@NotNull
String getName();
/**
* Return the list of annotations.
*
* @return the list of annotations.
*/
@NotNull
List<String> getAnnotations();
/**
* Return the list of presets.
*
* @return the list of presets.
*/
@NotNull
List<String> getPresets();
}