-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add explicit build flag for experimenting with test execution cacheab…
…ility (#42649) * Add build flag for ignoring random test seed as task input * Fix checkstyle violations
- Loading branch information
1 parent
a1e7858
commit 813e57d
Showing
3 changed files
with
72 additions
and
42 deletions.
There are no files selected for viewing
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
30 changes: 30 additions & 0 deletions
30
...Src/src/main/java/org/elasticsearch/gradle/SystemPropertyCommandLineArgumentProvider.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,30 @@ | ||
package org.elasticsearch.gradle; | ||
|
||
import org.gradle.api.tasks.Input; | ||
import org.gradle.process.CommandLineArgumentProvider; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
import java.util.stream.Collectors; | ||
|
||
public class SystemPropertyCommandLineArgumentProvider implements CommandLineArgumentProvider { | ||
private final Map<String, Object> systemProperties = new LinkedHashMap<>(); | ||
|
||
public void systemProperty(String key, Object value) { | ||
systemProperties.put(key, value); | ||
} | ||
|
||
@Override | ||
public Iterable<String> asArguments() { | ||
return systemProperties.entrySet() | ||
.stream() | ||
.map(entry -> "-D" + entry.getKey() + "=" + entry.getValue()) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
// Track system property keys as an input so our build cache key will change if we add properties but values are still ignored | ||
@Input | ||
public Iterable<String> getPropertyNames() { | ||
return systemProperties.keySet(); | ||
} | ||
} |
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