-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Gradle] fix esql compile cacheability (#111651)
- We use a JvmCommandlineprovider to reference the generated source folder and keep gradle cache happy
- Loading branch information
Showing
3 changed files
with
196 additions
and
148 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
...va/org/elasticsearch/gradle/internal/util/SourceDirectoryCommandLineArgumentProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
package org.elasticsearch.gradle.internal.util; | ||
|
||
import org.gradle.api.file.Directory; | ||
import org.gradle.api.tasks.InputDirectory; | ||
import org.gradle.api.tasks.PathSensitive; | ||
import org.gradle.api.tasks.PathSensitivity; | ||
import org.gradle.process.CommandLineArgumentProvider; | ||
|
||
import java.util.Arrays; | ||
|
||
public class SourceDirectoryCommandLineArgumentProvider implements CommandLineArgumentProvider { | ||
|
||
private final Directory sourceDirectory; | ||
|
||
public SourceDirectoryCommandLineArgumentProvider(Directory sourceDirectory) { | ||
this.sourceDirectory = sourceDirectory; | ||
} | ||
|
||
public Iterable<String> asArguments() { | ||
return Arrays.asList("-s", sourceDirectory.getAsFile().getAbsolutePath()); | ||
} | ||
|
||
@InputDirectory | ||
@PathSensitive(PathSensitivity.RELATIVE) | ||
public Directory getSourceDirectory() { | ||
return sourceDirectory; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.