File tree 2 files changed +14
-6
lines changed
buildSrc/src/main/java/org/elasticsearch/gradle/test/rest 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 51
51
* @see RestResourcesPlugin
52
52
*/
53
53
public class CopyRestApiTask extends DefaultTask {
54
- private static final String COPY_TO = "rest-api-spec/api" ;
54
+ private static final String REST_API_PREFIX = "rest-api-spec/api" ;
55
55
final ListProperty <String > includeCore = getProject ().getObjects ().listProperty (String .class );
56
56
final ListProperty <String > includeXpack = getProject ().getObjects ().listProperty (String .class );
57
57
@@ -109,7 +109,7 @@ public FileTree getInputDir() {
109
109
110
110
@ OutputDirectory
111
111
public File getOutputDir () {
112
- return new File (getTestSourceSet ().getOutput ().getResourcesDir (), COPY_TO );
112
+ return new File (getTestSourceSet ().getOutput ().getResourcesDir (), REST_API_PREFIX );
113
113
}
114
114
115
115
@ TaskAction
@@ -132,7 +132,13 @@ void copy() {
132
132
project .copy (c -> {
133
133
c .from (project .zipTree (coreConfig .getSingleFile ()));
134
134
c .into (getTestSourceSet ().getOutput ().getResourcesDir ()); // this ends up as the same dir as outputDir
135
- c .include (includeCore .get ().stream ().map (prefix -> COPY_TO + "/" + prefix + "*/**" ).collect (Collectors .toList ()));
135
+ if (includeCore .get ().isEmpty ()) {
136
+ c .include (REST_API_PREFIX + "/**" );
137
+ } else {
138
+ c .include (
139
+ includeCore .get ().stream ().map (prefix -> REST_API_PREFIX + "/" + prefix + "*/**" ).collect (Collectors .toList ())
140
+ );
141
+ }
136
142
});
137
143
}
138
144
// only copy x-pack specs if explicitly instructed
Original file line number Diff line number Diff line change 48
48
* @see RestResourcesPlugin
49
49
*/
50
50
public class CopyRestTestsTask extends DefaultTask {
51
- private static final String COPY_TO = "rest-api-spec/test" ;
51
+ private static final String REST_TEST_PREFIX = "rest-api-spec/test" ;
52
52
final ListProperty <String > includeCore = getProject ().getObjects ().listProperty (String .class );
53
53
final ListProperty <String > includeXpack = getProject ().getObjects ().listProperty (String .class );
54
54
@@ -103,7 +103,7 @@ public FileTree getInputDir() {
103
103
104
104
@ OutputDirectory
105
105
public File getOutputDir () {
106
- return new File (getTestSourceSet ().getOutput ().getResourcesDir (), COPY_TO );
106
+ return new File (getTestSourceSet ().getOutput ().getResourcesDir (), REST_TEST_PREFIX );
107
107
}
108
108
109
109
@ TaskAction
@@ -128,7 +128,9 @@ void copy() {
128
128
project .copy (c -> {
129
129
c .from (project .zipTree (coreConfig .getSingleFile ()));
130
130
c .into (getTestSourceSet ().getOutput ().getResourcesDir ()); // this ends up as the same dir as outputDir
131
- c .include (includeCore .get ().stream ().map (prefix -> COPY_TO + "/" + prefix + "*/**" ).collect (Collectors .toList ()));
131
+ c .include (
132
+ includeCore .get ().stream ().map (prefix -> REST_TEST_PREFIX + "/" + prefix + "*/**" ).collect (Collectors .toList ())
133
+ );
132
134
});
133
135
}
134
136
}
You can’t perform that action at this time.
0 commit comments