kotlin-gradle-android plugin initial implementaion
This commit is contained in:
@@ -1 +0,0 @@
|
||||
local-repo
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<root>
|
||||
<item name='com.google.common.base.Joiner com.google.common.base.Joiner on(java.lang.String)'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
</root>
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<root>
|
||||
<item name='com.google.common.io.Files java.io.File createTempDir()'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
</root>
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
<root>
|
||||
<item name='org.gradle.api.Plugin void apply(T)'>
|
||||
<annotation name='jet.runtime.typeinfo.KotlinSignature'>
|
||||
<val name="value" val=""fun apply(p0 : T) : Unit""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.gradle.api.Project org.gradle.api.plugins.PluginContainer getPlugins()'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.gradle.api.Project org.gradle.api.plugins.Convention getConvention()'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.gradle.api.Project org.gradle.api.initialization.dsl.ScriptHandler getBuildscript()'>
|
||||
<annotation name='jet.runtime.typeinfo.KotlinSignature'>
|
||||
<val name="value" val=""fun getBuildscript() : ScriptHandler""/>
|
||||
</annotation>
|
||||
</item>
|
||||
</root>
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<root>
|
||||
<item name='org.gradle.api.artifacts.Configuration org.gradle.api.artifacts.ResolvedConfiguration getResolvedConfiguration()'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
</root>
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<root>
|
||||
<item name='org.gradle.api.Project org.gradle.api.artifacts.dsl.DependencyHandler getDependencies()'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
</root>
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<root>
|
||||
<item name='org.gradle.api.file.FileCollection org.gradle.api.file.FileCollection filter(org.gradle.api.specs.Spec<? super java.io.File>)'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
</root>
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
<root>
|
||||
<item name='org.gradle.api.initialization.dsl.ScriptHandler org.gradle.api.artifacts.ConfigurationContainer getConfigurations()'>
|
||||
<annotation name='jet.runtime.typeinfo.KotlinSignature'>
|
||||
<val name="value" val=""fun getConfigurations() : ConfigurationContainer""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.gradle.api.initialization.dsl.ScriptHandler org.gradle.api.artifacts.dsl.DependencyHandler getDependencies()'>
|
||||
<annotation name='jet.runtime.typeinfo.KotlinSignature'>
|
||||
<val name="value" val=""fun getDependencies() : DependencyHandler""/>
|
||||
</annotation>
|
||||
</item>
|
||||
</root>
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
<root>
|
||||
<item name='org.gradle.api.internal.HasConvention org.gradle.api.plugins.Convention getConvention()'>
|
||||
<annotation name='jet.runtime.typeinfo.KotlinSignature'>
|
||||
<val name="value" val=""fun getConvention() : Convention""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.gradle.api.internal.AbstractTask org.gradle.api.logging.Logger getLogger()'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.gradle.api.internal.AbstractTask org.gradle.api.Project getProject()'>
|
||||
<annotation name='jet.runtime.typeinfo.KotlinSignature'>
|
||||
<val name="value" val=""fun getProject() : Project""/>
|
||||
</annotation>
|
||||
</item>
|
||||
</root>
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<root>
|
||||
<item name='org.gradle.api.internal.project.ProjectInternal org.gradle.api.internal.tasks.TaskContainerInternal getTasks()'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
</root>
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<root>
|
||||
<item name='org.gradle.api.logging.Logging org.gradle.api.logging.Logger getLogger(java.lang.Class)'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
</root>
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
<root>
|
||||
<item name='org.gradle.api.plugins.Convention java.util.Map<java.lang.String,java.lang.Object> getPlugins()'>
|
||||
<annotation name='jet.runtime.typeinfo.KotlinSignature'>
|
||||
<val name="value" val=""fun getPlugins() : MutableMap<String, Any>""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.gradle.api.plugins.Convention org.gradle.api.internal.DynamicObject getExtensionsAsDynamicObject()'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
<annotation name='jet.runtime.typeinfo.KotlinSignature'>
|
||||
<val name="value" val=""fun getExtensionsAsDynamicObject() : DynamicObject""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.gradle.api.plugins.PluginContainer org.gradle.api.Plugin apply(java.lang.String)'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.gradle.api.plugins.PluginContainer T apply(java.lang.Class<T>)'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.gradle.api.plugins.Convention T getPlugin(java.lang.Class<T>)'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
</root>
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
<root>
|
||||
<item name='org.gradle.api.tasks.SourceTask org.gradle.api.file.FileTree getSource()'>
|
||||
<annotation name='jet.runtime.typeinfo.KotlinSignature'>
|
||||
<val name="value" val=""fun getSource() : FileTree""/>
|
||||
</annotation>
|
||||
</item>
|
||||
</root>
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<root>
|
||||
<item name='org.gradle.api.tasks.compile.AbstractCompile org.gradle.api.file.FileCollection getClasspath()'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
</root>
|
||||
@@ -1,129 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<properties>
|
||||
<maven.version>3.0.4</maven.version>
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-project</artifactId>
|
||||
<version>0.1-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>kotlin-gradle-android-plugin</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.android.tools.build</groupId>
|
||||
<artifactId>gradle</artifactId>
|
||||
<version>0.4.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-gradle-plugin-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-jdk-annotations</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>gradle-api</artifactId>
|
||||
<version>1.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
||||
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
|
||||
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<version>${project.version}</version>
|
||||
<configuration>
|
||||
<annotationPaths>
|
||||
<annotationPath>${basedir}/kotlinAnnotation</annotationPath>
|
||||
</annotationPaths>
|
||||
</configuration>
|
||||
|
||||
<executions>
|
||||
<execution>
|
||||
<id>compile</id>
|
||||
<phase>compile</phase>
|
||||
<goals> <goal>compile</goal> </goals>
|
||||
</execution>
|
||||
|
||||
<execution>
|
||||
<id>test-compile</id>
|
||||
<phase>test-compile</phase>
|
||||
<goals> <goal>test-compile</goal> </goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!-- Invoker plugin maintains local maven repository in local-repo for gradle integration tests -->
|
||||
<artifactId>maven-invoker-plugin</artifactId>
|
||||
<version>1.8</version>
|
||||
<configuration>
|
||||
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
|
||||
<localRepositoryPath>local-repo</localRepositoryPath>
|
||||
<postBuildHookScript>verify</postBuildHookScript> <!-- no extension required -->
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>create_local</id>
|
||||
<phase>pre-integration-test</phase>
|
||||
<goals>
|
||||
<goal>install</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>integration-test</goal>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jetbrains-utils</id>
|
||||
<url>http://repository.jetbrains.com/utils</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
</project>
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package org.jetbrains.kotlin.gradle.plugin
|
||||
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.artifacts.dsl.DependencyHandler
|
||||
import org.gradle.api.artifacts.ConfigurationContainer
|
||||
import org.gradle.api.artifacts.Dependency
|
||||
import org.gradle.api.specs.Spec
|
||||
import java.io.File
|
||||
import java.net.URL
|
||||
import org.gradle.api.logging.Logging
|
||||
import java.util.Properties
|
||||
import java.io.FileNotFoundException
|
||||
|
||||
open class KotlinAndroidPlugin: Plugin<Project> {
|
||||
|
||||
val log = Logging.getLogger(getClass())!!
|
||||
|
||||
public override fun apply(project: Project) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
open class KSpec<T: Any?>(val predicate: (T) -> Boolean): Spec<T> {
|
||||
public override fun isSatisfiedBy(p0: T?): Boolean {
|
||||
return p0 != null && predicate(p0)
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
project.version=${project.version}
|
||||
@@ -89,6 +89,9 @@
|
||||
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
|
||||
<localRepositoryPath>local-repo</localRepositoryPath>
|
||||
<postBuildHookScript>verify</postBuildHookScript> <!-- no extension required -->
|
||||
<extraArtifacts>
|
||||
<extraArtifact>org.jetbrains.kotlin:kotlin-gradle-plugin-core:${project.version}</extraArtifact>
|
||||
</extraArtifacts>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
+16
-2
@@ -12,7 +12,7 @@ import org.gradle.api.logging.Logging
|
||||
import java.util.Properties
|
||||
import java.io.FileNotFoundException
|
||||
|
||||
open class KotlinPluginWrapper: Plugin<Project> {
|
||||
open abstract class KotlinBasePluginWrapper: Plugin<Project> {
|
||||
|
||||
val log = Logging.getLogger(getClass())!!
|
||||
|
||||
@@ -45,7 +45,7 @@ open class KotlinPluginWrapper: Plugin<Project> {
|
||||
log.debug("Load plugin in parent-last URL classloader")
|
||||
val kotlinPluginClassloader = ParentLastURLClassLoader(kotlinPluginDependencies, getClass().getClassLoader())
|
||||
log.debug("Class loader created")
|
||||
val cls = Class.forName("org.jetbrains.kotlin.gradle.plugin.KotlinPlugin", true, kotlinPluginClassloader)
|
||||
val cls = Class.forName(getPluginClassName(), true, kotlinPluginClassloader)
|
||||
log.debug("Plugin class loaded")
|
||||
val pluginInstance = cls.newInstance()
|
||||
log.debug("Plugin class instantiated")
|
||||
@@ -55,6 +55,20 @@ open class KotlinPluginWrapper: Plugin<Project> {
|
||||
applyMethod.invoke(pluginInstance, project);
|
||||
log.debug("'apply' method invoked successfully")
|
||||
}
|
||||
|
||||
public abstract fun getPluginClassName():String
|
||||
}
|
||||
|
||||
open class KotlinPluginWrapper: KotlinBasePluginWrapper() {
|
||||
public override fun getPluginClassName():String {
|
||||
return "org.jetbrains.kotlin.gradle.plugin.KotlinPlugin"
|
||||
}
|
||||
}
|
||||
|
||||
open class KotlinAndriodPluginWrapper: KotlinBasePluginWrapper() {
|
||||
public override fun getPluginClassName():String {
|
||||
return "org.jetbrains.kotlin.gradle.plugin.KotlinAndroidPlugin"
|
||||
}
|
||||
}
|
||||
|
||||
open class KSpec<T: Any?>(val predicate: (T) -> Boolean): Spec<T> {
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
implementation-class=org.jetbrains.kotlin.gradle.plugin.KotlinAndroidPlugin
|
||||
implementation-class=org.jetbrains.kotlin.gradle.plugin.KotlinAndriodPluginWrapper
|
||||
+2
-2
@@ -6,12 +6,12 @@ buildscript {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-android-plugin:0.1-SNAPSHOT'
|
||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:0.1-SNAPSHOT'
|
||||
classpath 'com.android.tools.build:gradle:0.4'
|
||||
}
|
||||
}
|
||||
apply plugin: 'android'
|
||||
apply plugin: 'kotlin'
|
||||
apply plugin: 'kotlin-android'
|
||||
|
||||
dependencies {
|
||||
compile files('libs/android-support-v4.jar')
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.jetbrains.kotlin.gradle.test.androidalfa;
|
||||
package AndroidAlfaProject.AndroidAlfa.src.main.java.org.jetbrains.kotlin.gradle.test.androidalfa;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Reference in New Issue
Block a user