Kapt3: Set correct compiler options when the annotation processing classpath is empty (KT-15146). Disable annotation processing in Javac task a bit earlier

This commit is contained in:
Yan Zhulanow
2016-12-19 19:35:16 +03:00
committed by Yan Zhulanow
parent f8edf51c1b
commit 568523b065
5 changed files with 81 additions and 11 deletions
@@ -39,7 +39,7 @@ class Kapt3IT : BaseGradleIT() {
private fun CompiledProject.assertKaptSuccessful() {
KAPT_SUCCESSFUL_REGEX.findAll(this.output).single()
KAPT_SUCCESSFUL_REGEX.findAll(this.output).count() > 0
}
@Test
@@ -151,7 +151,7 @@ class Kapt3IT : BaseGradleIT() {
val project = Project("android-dagger", GRADLE_VERSION, directoryPrefix = "kapt2")
val options = androidBuildOptions()
project.build("compileReleaseSources", options = options) {
project.build("compileReleaseSources", ":app:compileDebugUnitTestJavaWithJavac", options = options) {
assertSuccessful()
assertKaptSuccessful()
assertFileExists("app/build/generated/source/kapt/release/com/example/dagger/kotlin/DaggerApplicationComponent.java")
@@ -0,0 +1,19 @@
/*
* Copyright 2010-2016 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 com.myapp
class SimpleClass