|
1 | 1 | import java.nio.file.Files |
2 | 2 | import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask |
| 3 | +import org.elasticsearch.gradle.test.SystemPropertyCommandLineArgumentProvider; |
3 | 4 | import org.gradle.api.tasks.Input; |
4 | 5 | import org.gradle.process.CommandLineArgumentProvider; |
5 | 6 |
|
@@ -52,14 +53,6 @@ configurations { |
52 | 53 | } |
53 | 54 | } |
54 | 55 |
|
55 | | -// In this section you declare the dependencies for your production and test code |
56 | | -dependencies { |
57 | | - implementation 'com.youcruit.com.cybozu.labs:langdetect:1.1.2-20151117' |
58 | | - implementation 'net.arnx:jsonic:1.3.10' |
59 | | - // the yaml tests require a log4j2 dependency, otherwise a dependency is thrown on startup |
60 | | - runtimeOnly 'org.apache.logging.log4j:log4j-core:2.11.1' |
61 | | -} |
62 | | - |
63 | 56 | // ignore javadoc warnings for now |
64 | 57 | tasks.withType(Javadoc) { |
65 | 58 | options.addStringOption('Xdoclint:none', '-quiet') |
@@ -89,7 +82,6 @@ githubRelease.doFirst { |
89 | 82 | } |
90 | 83 | } |
91 | 84 |
|
92 | | - |
93 | 85 | // setup yaml rest tests |
94 | 86 | testClusters { |
95 | 87 | yamlRestTest |
@@ -139,38 +131,12 @@ tasks.register('yamlRestTest', StandaloneRestIntegTestTask) { testTask -> |
139 | 131 | check.dependsOn 'yamlRestTest' |
140 | 132 |
|
141 | 133 | dependencies { |
142 | | - yamlRestTestImplementation "org.elasticsearch.test:framework:$elasticsearchVersion" |
| 134 | + implementation 'com.youcruit.com.cybozu.labs:langdetect:1.1.2-20151117' |
| 135 | + implementation 'net.arnx:jsonic:1.3.10' |
| 136 | + // the yaml tests require a log4j2 dependency, otherwise a dependency is thrown on startup |
| 137 | + runtimeOnly 'org.apache.logging.log4j:log4j-core:2.11.1' |
| 138 | + testImplementation "org.elasticsearch.test:framework:$elasticsearchVersion" |
143 | 139 | restTestSpecs "org.elasticsearch:rest-api-spec:$elasticsearchVersion" |
144 | 140 | } |
145 | 141 |
|
146 | | -// This will be available in 7.15 in build tools and not manually declared. |
147 | | -public class SystemPropertyCommandLineArgumentProvider implements CommandLineArgumentProvider { |
148 | | - private final Map<String, Object> systemProperties = new LinkedHashMap<>(); |
149 | | - |
150 | | - public void systemProperty(String key, Supplier<String> value) { |
151 | | - systemProperties.put(key, value); |
152 | | - } |
153 | | - |
154 | | - public void systemProperty(String key, Object value) { |
155 | | - systemProperties.put(key, value); |
156 | | - } |
157 | | - |
158 | | - @Override |
159 | | - public Iterable<String> asArguments() { |
160 | | - return systemProperties.entrySet() |
161 | | - .stream() |
162 | | - .map( |
163 | | - entry -> "-D" |
164 | | - + entry.getKey() |
165 | | - + "=" |
166 | | - + (entry.getValue() instanceof Supplier ? ((Supplier) entry.getValue()).get() : entry.getValue()) |
167 | | - ) |
168 | | - .collect(Collectors.toList()); |
169 | | - } |
170 | | - |
171 | | - // Track system property keys as an input so our build cache key will change if we add properties but values are still ignored |
172 | | - @Input |
173 | | - public Iterable<String> getPropertyNames() { |
174 | | - return systemProperties.keySet(); |
175 | | - } |
176 | | -} |
| 142 | + |
0 commit comments