|
1 | 1 | /*
|
2 |
| - * Copyright 2012-2019 the original author or authors. |
| 2 | + * Copyright 2012-2020 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -81,7 +81,7 @@ void before() throws IOException {
|
81 | 81 | }
|
82 | 82 |
|
83 | 83 | void after() {
|
84 |
| - GradleBuild.this.script = null; |
| 84 | + this.script = null; |
85 | 85 | FileSystemUtils.deleteRecursively(this.projectDir);
|
86 | 86 | }
|
87 | 87 |
|
@@ -113,8 +113,8 @@ public GradleBuild expectDeprecationWarningsWithAtLeastVersion(String gradleVers
|
113 | 113 | public BuildResult build(String... arguments) {
|
114 | 114 | try {
|
115 | 115 | BuildResult result = prepareRunner(arguments).build();
|
116 |
| - if (this.gradleVersion != null && this.expectDeprecationWarnings != null |
117 |
| - && this.expectDeprecationWarnings.compareTo(GradleVersion.version(this.gradleVersion)) > 0) { |
| 116 | + if (this.expectDeprecationWarnings == null || (this.gradleVersion != null |
| 117 | + && this.expectDeprecationWarnings.compareTo(GradleVersion.version(this.gradleVersion)) > 0)) { |
118 | 118 | assertThat(result.getOutput()).doesNotContain("Deprecated").doesNotContain("deprecated");
|
119 | 119 | }
|
120 | 120 | return result;
|
@@ -149,13 +149,16 @@ public GradleRunner prepareRunner(String... arguments) throws IOException {
|
149 | 149 | if (this.gradleVersion != null) {
|
150 | 150 | gradleRunner.withGradleVersion(this.gradleVersion);
|
151 | 151 | }
|
152 |
| - else if (this.dsl == Dsl.KOTLIN) { |
153 |
| - gradleRunner.withGradleVersion("4.10.3"); |
| 152 | + else { |
| 153 | + File settingsFile = new File(this.projectDir, "settings" + this.dsl.getExtension()); |
| 154 | + FileCopyUtils.copy("enableFeaturePreview(\"STABLE_PUBLISHING\")", new FileWriter(settingsFile)); |
154 | 155 | }
|
155 | 156 | List<String> allArguments = new ArrayList<>();
|
156 | 157 | allArguments.add("-PbootVersion=" + getBootVersion());
|
157 | 158 | allArguments.add("--stacktrace");
|
158 | 159 | allArguments.addAll(Arrays.asList(arguments));
|
| 160 | + allArguments.add("--warning-mode"); |
| 161 | + allArguments.add("all"); |
159 | 162 | return gradleRunner.withArguments(allArguments);
|
160 | 163 | }
|
161 | 164 |
|
|
0 commit comments