File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
buildSrc/src/main/java/org/elasticsearch/gradle/test/rest Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 5151 * @see RestResourcesPlugin
5252 */
5353public 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" ;
5555 final ListProperty <String > includeCore = getProject ().getObjects ().listProperty (String .class );
5656 final ListProperty <String > includeXpack = getProject ().getObjects ().listProperty (String .class );
5757
@@ -109,7 +109,7 @@ public FileTree getInputDir() {
109109
110110 @ OutputDirectory
111111 public File getOutputDir () {
112- return new File (getTestSourceSet ().getOutput ().getResourcesDir (), COPY_TO );
112+ return new File (getTestSourceSet ().getOutput ().getResourcesDir (), REST_API_PREFIX );
113113 }
114114
115115 @ TaskAction
@@ -132,7 +132,13 @@ void copy() {
132132 project .copy (c -> {
133133 c .from (project .zipTree (coreConfig .getSingleFile ()));
134134 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+ }
136142 });
137143 }
138144 // only copy x-pack specs if explicitly instructed
Original file line number Diff line number Diff line change 4848 * @see RestResourcesPlugin
4949 */
5050public 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" ;
5252 final ListProperty <String > includeCore = getProject ().getObjects ().listProperty (String .class );
5353 final ListProperty <String > includeXpack = getProject ().getObjects ().listProperty (String .class );
5454
@@ -103,7 +103,7 @@ public FileTree getInputDir() {
103103
104104 @ OutputDirectory
105105 public File getOutputDir () {
106- return new File (getTestSourceSet ().getOutput ().getResourcesDir (), COPY_TO );
106+ return new File (getTestSourceSet ().getOutput ().getResourcesDir (), REST_TEST_PREFIX );
107107 }
108108
109109 @ TaskAction
@@ -128,7 +128,9 @@ void copy() {
128128 project .copy (c -> {
129129 c .from (project .zipTree (coreConfig .getSingleFile ()));
130130 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+ );
132134 });
133135 }
134136 }
You can’t perform that action at this time.
0 commit comments