kapt: Add inherited annotations test
This commit is contained in:
+2
@@ -1,6 +1,8 @@
|
||||
package example
|
||||
|
||||
import java.lang.annotation.ElementType
|
||||
import java.lang.annotation.Inherited
|
||||
import java.lang.annotation.Target
|
||||
|
||||
@Inherited
|
||||
annotation public class ExampleAnnotation
|
||||
+10
@@ -98,4 +98,14 @@ class KotlinGradleIT: BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testKaptInheritedAnnotations() {
|
||||
Project("kaptInheritedAnnotations", "1.12").build("build") {
|
||||
assertSuccessful()
|
||||
assertFileExists("build/generated/source/kapt/main/TestClassGenerated.java")
|
||||
assertFileExists("build/generated/source/kapt/main/AncestorClassGenerated.java")
|
||||
assertFileExists("build/classes/main/example/TestClassGenerated.class")
|
||||
assertFileExists("build/classes/main/example/AncestorClassGenerated.class")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
url 'file://' + pathToKotlinPlugin
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:0.1-SNAPSHOT"
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: "java"
|
||||
apply plugin: "kotlin"
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url 'file://' + pathToKotlinPlugin
|
||||
}
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:0.1-SNAPSHOT"
|
||||
compile "org.jetbrains.kotlin:annotation-processor-example:0.1-SNAPSHOT"
|
||||
kapt "org.jetbrains.kotlin:annotation-processor-example:0.1-SNAPSHOT"
|
||||
}
|
||||
|
||||
task show << {
|
||||
buildscript.configurations.classpath.each { println it }
|
||||
}
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
gradleVersion="1.12"
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package example
|
||||
|
||||
@example.ExampleAnnotation
|
||||
public open class TestClass
|
||||
|
||||
public class AncestorClass : TestClass()
|
||||
Reference in New Issue
Block a user