-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Update Gradle wrapper to 9.0.0 #132932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Gradle wrapper to 9.0.0 #132932
Changes from all commits
cafa4dd
d220564
33c9309
68bc5d5
7d28ba1
ae0a418
0d8883a
08dc144
9f74701
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,11 +80,8 @@ class InternalDistributionArchiveSetupPluginFuncTest extends AbstractGradleFuncT | |
def "registered distribution provides archives and directory variant"() { | ||
given: | ||
file('someFile.txt') << "some content" | ||
|
||
settingsFile << """ | ||
include ':consumer' | ||
include ':producer-tar' | ||
""" | ||
subProject("consumer") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gradle throws error if the project folder does not exist yet. therefore tweaks to our tests in that area. |
||
subProject("producer-tar") | ||
|
||
buildFile << """ | ||
import org.gradle.api.artifacts.type.ArtifactTypeDefinition; | ||
|
@@ -154,9 +151,7 @@ class InternalDistributionArchiveSetupPluginFuncTest extends AbstractGradleFuncT | |
def "builds extracted distribution via extractedAssemble"() { | ||
given: | ||
file('someFile.txt') << "some content" | ||
settingsFile << """ | ||
include ':producer-tar' | ||
""" | ||
subProject("producer-tar") | ||
|
||
buildFile << """ | ||
import org.gradle.api.artifacts.type.ArtifactTypeDefinition; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,15 +9,15 @@ | |
|
||
package org.elasticsearch.gradle.internal | ||
|
||
import spock.lang.Ignore | ||
|
||
import spock.lang.Unroll | ||
|
||
import org.apache.commons.compress.archivers.tar.TarArchiveEntry | ||
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream | ||
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream | ||
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream | ||
import org.elasticsearch.gradle.fixtures.AbstractGradleFuncTest | ||
import org.gradle.api.GradleException | ||
import spock.lang.Unroll | ||
|
||
import java.nio.file.Files | ||
import java.nio.file.Path | ||
|
@@ -66,8 +66,12 @@ tasks.register("buildBZip2Tar", SymbolicLinkPreservingTar) { SymbolicLinkPreserv | |
from fileTree("archiveRoot") | ||
|
||
into('config') { | ||
dirMode 0750 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that APi has been removed |
||
fileMode 0660 | ||
dirPermissions { | ||
unix(0750) | ||
} | ||
filePermissions { | ||
unix(0660) | ||
} | ||
from "real-folder2" | ||
} | ||
} | ||
|
@@ -118,8 +122,10 @@ tasks.register("buildTar", SymbolicLinkPreservingTar) { SymbolicLinkPreservingTa | |
preserverTimestamp << [true, false] | ||
} | ||
|
||
private boolean assertTar(final File archive, final Function<? super FileInputStream, ? extends InputStream> wrapper, boolean preserveFileTimestamps) | ||
throws IOException { | ||
private boolean assertTar(final File archive, | ||
final Function<? super FileInputStream, ? extends InputStream> wrapper, | ||
boolean preserveFileTimestamps) | ||
throws IOException { | ||
try (TarArchiveInputStream tar = new TarArchiveInputStream(wrapper.apply(new FileInputStream(archive)))) { | ||
TarArchiveEntry entry = tar.getNextTarEntry(); | ||
boolean realFolderEntry = false; | ||
|
@@ -132,7 +138,7 @@ tasks.register("buildTar", SymbolicLinkPreservingTar) { SymbolicLinkPreservingTa | |
if (entry.getName().equals("real-folder/")) { | ||
assert entry.isDirectory() | ||
realFolderEntry = true | ||
} else if (entry.getName().equals("real-folder/file")) { | ||
} else if (entry.getName().equals("real-folder/file")) { | ||
assert entry.isFile() | ||
fileEntry = true | ||
} else if (entry.getName().equals("real-folder/link-to-file")) { | ||
|
@@ -145,7 +151,7 @@ tasks.register("buildTar", SymbolicLinkPreservingTar) { SymbolicLinkPreservingTa | |
} else if (entry.getName().equals("config/sub/")) { | ||
assert entry.isDirectory() | ||
assert entry.getMode() == 16872 | ||
}else if (entry.getName().equals("link-in-folder/")) { | ||
} else if (entry.getName().equals("link-in-folder/")) { | ||
assert entry.isDirectory() | ||
linkInFolderEntry = true | ||
} else if (entry.getName().equals("link-in-folder/link-to-file")) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,18 +9,18 @@ | |
|
||
package org.elasticsearch.gradle.internal | ||
|
||
import groovy.ant.AntBuilder | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. packages for some groovy util classes have moved |
||
|
||
import org.apache.tools.ant.BuildListener | ||
import org.apache.tools.ant.BuildLogger | ||
import org.apache.tools.ant.DefaultLogger | ||
import org.apache.tools.ant.Project | ||
import org.gradle.api.DefaultTask | ||
import org.gradle.api.GradleException | ||
import org.gradle.api.file.FileSystemOperations | ||
import org.gradle.api.tasks.Input | ||
import org.gradle.api.tasks.TaskAction | ||
|
||
import javax.inject.Inject | ||
import java.nio.charset.Charset | ||
import javax.inject.Inject | ||
|
||
/** | ||
* A task which will run ant commands. | ||
|
@@ -83,7 +83,8 @@ public abstract class AntTask extends DefaultTask { | |
return new DefaultLogger( | ||
errorPrintStream: stream, | ||
outputPrintStream: stream, | ||
messageOutputLevel: outputLevel) | ||
messageOutputLevel: outputLevel | ||
) | ||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
import org.elasticsearch.gradle.VersionProperties; | ||
import org.elasticsearch.gradle.internal.test.rest.transform.RestTestTransform; | ||
import org.elasticsearch.gradle.internal.test.rest.transform.RestTestTransformer; | ||
import org.elasticsearch.gradle.internal.test.rest.transform.SerializableJsonNode; | ||
import org.elasticsearch.gradle.internal.test.rest.transform.close_to.ReplaceValueInCloseTo; | ||
import org.elasticsearch.gradle.internal.test.rest.transform.do_.ReplaceKeyInDo; | ||
import org.elasticsearch.gradle.internal.test.rest.transform.headers.InjectHeaders; | ||
|
@@ -169,7 +170,7 @@ public void skipTestsByFilePattern(String filePattern, String reason) { | |
* @param value the value used in the replacement. For example "bar" | ||
*/ | ||
public void replaceValueInMatch(String subKey, Object value) { | ||
getTransformations().add(new ReplaceValueInMatch(subKey, MAPPER.convertValue(value, JsonNode.class))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. JsonNode cannot be serialized anymore due to restrictions to the serializer. (details in commit messages). therefore we wrap this in a serializable class There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it simply because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No its not that. its the fact that NodeSerialisation relies on ObjectInputStream#.readFully which is unsupported by the gradle serialization. Usually serializing any more complex class often results in a hassle in Gradle therefore should be avoided as it causes this kind of unexpected behaviour There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I misinterpreted the change. I thought SerializableJsonNode is just a wrapper on JsonNode, but it actually stores the original value and only change it to JsonNode when |
||
getTransformations().add(new ReplaceValueInMatch(subKey, SerializableJsonNode.of(value, JsonNode.class))); | ||
} | ||
|
||
/** | ||
|
@@ -180,7 +181,7 @@ public void replaceValueInMatch(String subKey, Object value) { | |
* @param testName the testName to apply replacement | ||
*/ | ||
public void replaceValueInMatch(String subKey, Object value, String testName) { | ||
getTransformations().add(new ReplaceValueInMatch(subKey, MAPPER.convertValue(value, JsonNode.class), testName)); | ||
getTransformations().add(new ReplaceValueInMatch(subKey, SerializableJsonNode.of(value, JsonNode.class), testName)); | ||
} | ||
|
||
/** | ||
|
@@ -225,7 +226,7 @@ public void replaceKeyInLength(String oldKeyName, String newKeyName) { | |
* @param value the value used in the replacement. For example 99 | ||
*/ | ||
public void replaceValueInLength(String subKey, int value) { | ||
getTransformations().add(new ReplaceValueInLength(subKey, MAPPER.convertValue(value, NumericNode.class))); | ||
getTransformations().add(new ReplaceValueInLength(subKey, SerializableJsonNode.of(value, NumericNode.class))); | ||
} | ||
|
||
/** | ||
|
@@ -237,7 +238,7 @@ public void replaceValueInLength(String subKey, int value) { | |
* @param testName the testName to apply replacement | ||
*/ | ||
public void replaceValueInLength(String subKey, int value, String testName) { | ||
getTransformations().add(new ReplaceValueInLength(subKey, MAPPER.convertValue(value, NumericNode.class), testName)); | ||
getTransformations().add(new ReplaceValueInLength(subKey, SerializableJsonNode.of(value, NumericNode.class), testName)); | ||
} | ||
|
||
/** | ||
|
@@ -260,7 +261,7 @@ public void replaceKeyInMatch(String oldKeyName, String newKeyName) { | |
* @param testName the testName to apply replacement | ||
*/ | ||
public void replaceValueInCloseTo(String subKey, double newValue, String testName) { | ||
getTransformations().add(new ReplaceValueInCloseTo(subKey, MAPPER.convertValue(newValue, NumericNode.class), testName)); | ||
getTransformations().add(new ReplaceValueInCloseTo(subKey, SerializableJsonNode.of(newValue, NumericNode.class), testName)); | ||
} | ||
|
||
/** | ||
|
@@ -271,7 +272,7 @@ public void replaceValueInCloseTo(String subKey, double newValue, String testNam | |
* @param newValue the value used in the replacement. For example 9.5 | ||
*/ | ||
public void replaceValueInCloseTo(String subKey, double newValue) { | ||
getTransformations().add(new ReplaceValueInCloseTo(subKey, MAPPER.convertValue(newValue, NumericNode.class))); | ||
getTransformations().add(new ReplaceValueInCloseTo(subKey, SerializableJsonNode.of(newValue, NumericNode.class))); | ||
} | ||
|
||
/** | ||
|
@@ -282,7 +283,7 @@ public void replaceValueInCloseTo(String subKey, double newValue) { | |
* @param newValue the value used in the replacement | ||
*/ | ||
public void replaceIsTrue(String oldValue, Object newValue) { | ||
getTransformations().add(new ReplaceIsTrue(oldValue, MAPPER.convertValue(newValue, TextNode.class))); | ||
getTransformations().add(new ReplaceIsTrue(oldValue, SerializableJsonNode.of(newValue, TextNode.class))); | ||
} | ||
|
||
/** | ||
|
@@ -294,7 +295,7 @@ public void replaceIsTrue(String oldValue, Object newValue) { | |
* @param testName the testName to apply replacement | ||
*/ | ||
public void replaceIsTrue(String oldValue, Object newValue, String testName) { | ||
getTransformations().add(new ReplaceIsTrue(oldValue, MAPPER.convertValue(newValue, TextNode.class), testName)); | ||
getTransformations().add(new ReplaceIsTrue(oldValue, SerializableJsonNode.of(newValue, TextNode.class), testName)); | ||
} | ||
|
||
/** | ||
|
@@ -305,7 +306,7 @@ public void replaceIsTrue(String oldValue, Object newValue, String testName) { | |
* @param newValue the value used in the replacement | ||
*/ | ||
public void replaceIsFalse(String oldValue, Object newValue) { | ||
getTransformations().add(new ReplaceIsFalse(oldValue, MAPPER.convertValue(newValue, TextNode.class))); | ||
getTransformations().add(new ReplaceIsFalse(oldValue, SerializableJsonNode.of(newValue, TextNode.class))); | ||
} | ||
|
||
/** | ||
|
@@ -317,7 +318,7 @@ public void replaceIsFalse(String oldValue, Object newValue) { | |
* @param testName the testName to apply replacement | ||
*/ | ||
public void replaceIsFalse(String oldValue, Object newValue, String testName) { | ||
getTransformations().add(new ReplaceIsFalse(oldValue, MAPPER.convertValue(newValue, TextNode.class), testName)); | ||
getTransformations().add(new ReplaceIsFalse(oldValue, SerializableJsonNode.of(newValue, TextNode.class), testName)); | ||
} | ||
|
||
/** | ||
|
@@ -329,7 +330,7 @@ public void replaceIsFalse(String oldValue, Object newValue, String testName) { | |
* @param newValue the value used in the replacement | ||
*/ | ||
public void replaceValueTextByKeyValue(String key, String oldValue, Object newValue) { | ||
getTransformations().add(new ReplaceTextual(key, oldValue, MAPPER.convertValue(newValue, TextNode.class))); | ||
getTransformations().add(new ReplaceTextual(key, oldValue, SerializableJsonNode.of(newValue, TextNode.class))); | ||
} | ||
|
||
/** | ||
|
@@ -342,7 +343,7 @@ public void replaceValueTextByKeyValue(String key, String oldValue, Object newVa | |
* @param testName the testName to apply replacement | ||
*/ | ||
public void replaceValueTextByKeyValue(String key, String oldValue, Object newValue, String testName) { | ||
getTransformations().add(new ReplaceTextual(key, oldValue, MAPPER.convertValue(newValue, TextNode.class), testName)); | ||
getTransformations().add(new ReplaceTextual(key, oldValue, SerializableJsonNode.of(newValue, TextNode.class), testName)); | ||
} | ||
|
||
/** | ||
|
@@ -376,7 +377,7 @@ public void removeMatch(String subKey, String testName) { | |
* @param testName the testName to apply addition | ||
*/ | ||
public void addMatch(String subKey, Object value, String testName) { | ||
getTransformations().add(new AddMatch(subKey, MAPPER.convertValue(value, JsonNode.class), testName)); | ||
getTransformations().add(new AddMatch(subKey, SerializableJsonNode.of(value, JsonNode.class), testName)); | ||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
manual creating
default
configuration is deprecated now