Skip to content

Commit

Permalink
Add test to reproduce #506.
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg committed Mar 5, 2020
1 parent 38ccce1 commit efa0174
Showing 1 changed file with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright 2016 DiffPlug
*
* 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.diffplug.gradle.spotless;

import java.io.IOException;

import org.assertj.core.api.Assertions;
import org.gradle.testkit.runner.GradleRunner;
import org.junit.Test;

/** Reproduces https://github.com/diffplug/spotless/issues/506 */
public class MultiProjectAfterEvaluate extends GradleIntegrationTest {
@Test
public void failureDoesntTriggerAll() throws IOException {
setFile("settings.gradle").toLines("include 'sub'");
setFile("build.gradle").toLines("buildscript { repositories { mavenCentral() }}");
setFile("sub/build.gradle")
.toLines(
"plugins {",
" id 'com.diffplug.gradle.spotless'",
" id 'java'",
"}",
"spotless { java { googleJavaFormat() } }");
String output = gradleRunner6().withArguments("spotlessApply", "--warning-mode", "all").build().getOutput().replace("\r\n", "\n");
Assertions.assertThat(output).contains("Using method Project#afterEvaluate(Action) when the project is already evaluated has been deprecated.");
}

private final GradleRunner gradleRunner6() throws IOException {
return gradleRunner().withGradleVersion("6.0");
}
}

0 comments on commit efa0174

Please sign in to comment.