diff --git a/libraries/examples/annotation-processor-example/src/main/kotlin/example/ExampleAnnotation.kt b/libraries/examples/annotation-processor-example/src/main/kotlin/example/ExampleAnnotation.kt index a88da9823f6..0da7a817597 100644 --- a/libraries/examples/annotation-processor-example/src/main/kotlin/example/ExampleAnnotation.kt +++ b/libraries/examples/annotation-processor-example/src/main/kotlin/example/ExampleAnnotation.kt @@ -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 \ No newline at end of file diff --git a/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt b/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt index ae73ce254b4..037f19fe7db 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt @@ -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") + } + } + } \ No newline at end of file diff --git a/libraries/tools/kotlin-gradle-plugin/src/test/resources/testProject/kaptInheritedAnnotations/build.gradle b/libraries/tools/kotlin-gradle-plugin/src/test/resources/testProject/kaptInheritedAnnotations/build.gradle new file mode 100644 index 00000000000..78b978e9dd7 --- /dev/null +++ b/libraries/tools/kotlin-gradle-plugin/src/test/resources/testProject/kaptInheritedAnnotations/build.gradle @@ -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" +} \ No newline at end of file diff --git a/libraries/tools/kotlin-gradle-plugin/src/test/resources/testProject/kaptInheritedAnnotations/src/main/java/test.kt b/libraries/tools/kotlin-gradle-plugin/src/test/resources/testProject/kaptInheritedAnnotations/src/main/java/test.kt new file mode 100644 index 00000000000..7eff7b126c0 --- /dev/null +++ b/libraries/tools/kotlin-gradle-plugin/src/test/resources/testProject/kaptInheritedAnnotations/src/main/java/test.kt @@ -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() \ No newline at end of file