Skip to content
This repository was archived by the owner on Jan 25, 2021. It is now read-only.

Commit 38b17c4

Browse files
committed
updating to gradle 4.4
1 parent 9cda3a3 commit 38b17c4

File tree

11 files changed

+57
-16
lines changed

11 files changed

+57
-16
lines changed

build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repositories {
1616
}
1717

1818
ext {
19-
gradleVersions = '4.3'
19+
gradleVersions = '4.4'
2020
androidGradleBuildVersion = '3.0.0-beta3'
2121
androidCompileSdkVersion = 'android-26'
2222
androidBuildToolsVersion = '26.0.1'
@@ -53,6 +53,7 @@ ext {
5353

5454
versions.maven = "3.0.4"
5555
versions.groovy = "2.4.12"
56+
versions.ant = "1.9.9"
5657

5758
dependencies {
5859
jacocoRuntime "org.jacoco:org.jacoco.agent:${jacoco.toolVersion}:runtime"
@@ -65,7 +66,7 @@ dependencies {
6566
dependency "org.apache.maven:maven-settings-builder:${versions.maven}@jar"
6667

6768
//plexus:
68-
dependency "org.codehaus.plexus:plexus-utils:2.0.6@jar"
69+
dependency "org.codehaus.plexus:plexus-utils:2.1@jar"
6970
dependency "org.codehaus.plexus:plexus-interpolation:1.14@jar"
7071
dependency "org.codehaus.plexus:plexus-component-annotations:1.5.5@jar"
7172
dependency "org.codehaus.plexus:plexus-container-default:1.5.5@jar"
@@ -125,8 +126,8 @@ dependencies {
125126
testCompile dependencies.module('org.apache.ivy:ivy:2.2.0'){
126127
dependency "com.jcraft:jsch:0.1.54"
127128
}
128-
testCompile dependencies.module('org.apache.ant:ant:1.9.6') {
129-
dependency 'org.apache.ant:ant-launcher:1.9.6@jar'
129+
testCompile dependencies.module("org.apache.ant:ant:${versions.ant}") {
130+
dependency "org.apache.ant:ant-launcher:${versions.ant}@jar"
130131
}
131132
}
132133

@@ -230,7 +231,7 @@ jacocoTestReport.dependsOn test
230231
check.dependsOn jacocoTestReport
231232

232233
task wrapper(type: Wrapper) {
233-
gradleVersion = '4.3'
234+
gradleVersion = '4.4'
234235
distributionUrl = "https://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
235236
}
236237

gradle/wrapper/gradle-wrapper.jar

-398 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

src/test/core/src/testFixtures/groovy/org/gradle/util/TestUtil.groovy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ class TestUtil {
9494
private static void hackInTaskProperties(Class type, Task task, Map args) {
9595
args.each { k, v ->
9696
def field = type.getDeclaredFields().find { it.name == k }
97+
if (!field) {
98+
field = type.getSuperclass().getDeclaredFields().find { it.name == k }
99+
}
97100
if (field) {
98101
field.setAccessible(true)
99102
field.set(task, v)
@@ -179,6 +182,7 @@ class TestUtil {
179182
static String createUniqueId() {
180183
return new UID().toString();
181184
}
185+
182186
}
183187

184188

src/test/core/src/testFixtures/groovy/org/gradle/util/ports/FixedAvailablePortAllocator.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class FixedAvailablePortAllocator extends AbstractAvailablePortAllocator {
2222
static final String WORKER_ID_SYS_PROPERTY = "org.gradle.test.worker"
2323
static final String AGENT_NUM_SYS_PROPERTY = "org.gradle.ci.agentNum"
2424
static final String TOTAL_AGENTS_SYS_PROPERTY = "org.gradle.ci.agentCount"
25-
static final int DEFAULT_RANGE_SIZE = 50
25+
static final int DEFAULT_RANGE_SIZE = 100
2626
private static FixedAvailablePortAllocator instance
2727
final int workerId
2828
final int agentNum

src/test/internal-testing/src/main/groovy/org/gradle/integtests/fixtures/DefaultTestExecutionResult.groovy

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import org.hamcrest.Matcher
2121

2222
class DefaultTestExecutionResult implements TestExecutionResult {
2323

24-
def results = []
24+
List<TestExecutionResult> results = []
2525

2626
public DefaultTestExecutionResult(TestFile projectDir, String buildDirName = 'build', String binary='', String testedBinary = '', String testTaskName = 'test') {
2727
String binaryPath = binary?"/$binary":''
@@ -43,13 +43,25 @@ class DefaultTestExecutionResult implements TestExecutionResult {
4343
}
4444

4545
TestClassExecutionResult testClass(String testClass) {
46-
new DefaultTestClassExecutionResult(results.collect {it.testClass(testClass)});
46+
new DefaultTestClassExecutionResult(results.collect {it.testClass(testClass)})
4747
}
4848

4949
TestClassExecutionResult testClassStartsWith(String testClass) {
5050
new DefaultTestClassExecutionResult(results.collect { it.testClassStartsWith(testClass) })
5151
}
5252

53+
void assertNoTestClassesExecuted() {
54+
assert totalNumberOfTestClassesExecuted == 0
55+
}
56+
57+
@Override
58+
int getTotalNumberOfTestClassesExecuted() {
59+
assert !results.isEmpty()
60+
def firstResult = results[0].totalNumberOfTestClassesExecuted
61+
assert results.every { firstResult == it.totalNumberOfTestClassesExecuted }
62+
return firstResult
63+
}
64+
5365
private class DefaultTestClassExecutionResult implements TestClassExecutionResult {
5466
def testClassResults
5567

src/test/internal-testing/src/main/groovy/org/gradle/integtests/fixtures/HtmlTestExecutionResult.groovy

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,16 @@ class HtmlTestExecutionResult implements TestExecutionResult {
3636
}
3737

3838
private void indexContainsTestClass(String... expectedTestClasses) {
39+
List<String> executedTestClasses = getExecutedTestClasses()
40+
assert executedTestClasses.containsAll(expectedTestClasses)
41+
}
42+
43+
private List<String> getExecutedTestClasses() {
3944
def indexFile = new File(htmlReportDirectory, "index.html")
4045
assert indexFile.exists()
4146
Document html = Jsoup.parse(indexFile, null)
4247
def executedTestClasses = html.select("div:has(h2:contains(Classes)).tab a").collect { it.text() }
43-
assert executedTestClasses.containsAll(expectedTestClasses)
48+
executedTestClasses
4449
}
4550

4651
private void assertHtmlReportForTestClassExists(String... classNames) {
@@ -57,6 +62,11 @@ class HtmlTestExecutionResult implements TestExecutionResult {
5762
return new HtmlTestClassExecutionResult(new File(htmlReportDirectory, "classes").listFiles().find { it.name.startsWith(FileUtils.toSafeFileName(testClass)) })
5863
}
5964

65+
@Override
66+
int getTotalNumberOfTestClassesExecuted() {
67+
return getExecutedTestClasses().size()
68+
}
69+
6070
private static class HtmlTestClassExecutionResult implements TestClassExecutionResult {
6171
private File htmlFile
6272
private List<String> testsExecuted = []

src/test/internal-testing/src/main/groovy/org/gradle/integtests/fixtures/JUnitXmlTestExecutionResult.groovy

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ class JUnitXmlTestExecutionResult implements TestExecutionResult {
4545
this
4646
}
4747

48-
def fromFileToTestClass(String s) {
49-
s.replaceAll(/#([\d\w][\d\w])/){
50-
(char)Integer.parseInt(it[1], 16)
51-
}
48+
String fromFileToTestClass(File junitXmlFile) {
49+
def xml = new XmlSlurper().parse(junitXmlFile)
50+
xml.@'name'.text()
5251
}
5352

5453
TestClassExecutionResult testClass(String testClass) {
@@ -60,6 +59,11 @@ class JUnitXmlTestExecutionResult implements TestExecutionResult {
6059
return new JUnitTestClassExecutionResult(matching[1], matching[0], outputAssociation)
6160
}
6261

62+
@Override
63+
int getTotalNumberOfTestClassesExecuted() {
64+
return findClasses().size()
65+
}
66+
6367
private def findTestClass(String testClass) {
6468
def classes = findClasses()
6569
assertThat(classes.keySet(), hasItem(testClass))
@@ -84,7 +88,7 @@ class JUnitXmlTestExecutionResult implements TestExecutionResult {
8488
testResultsDir.eachFile { File file ->
8589
def matcher = (file.name=~/TEST-(.+)\.xml/)
8690
if (matcher.matches()) {
87-
classes[fromFileToTestClass(matcher.group(1))] = file
91+
classes[fromFileToTestClass(file)] = file
8892
}
8993
}
9094
return classes

src/test/internal-testing/src/main/groovy/org/gradle/integtests/fixtures/TestExecutionResult.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@ public interface TestExecutionResult {
3131
* Returns the result for the first test class whose name starts with the given string.
3232
*/
3333
TestClassExecutionResult testClassStartsWith(String testClass);
34+
35+
int getTotalNumberOfTestClassesExecuted();
3436
}

src/test/internal-testing/src/main/groovy/org/gradle/test/fixtures/encoding/Identifier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static Identifier getPunctuation() {
8787

8888
public static Identifier getNonAscii() {
8989
if (OperatingSystem.current().isMacOsX()) {
90-
// The hfs+ file system stores file names in decomposed form. Don't use precomposed characters on OS X, as way too few things normalise text correctly
90+
// The hfs+ file system stores file names in decomposed form. Don't use precomposed characters on macOS, as way too few things normalise text correctly
9191
return new Identifier(NON_PRECOMPOSED_NON_ASCII, "non-ascii");
9292
}
9393
return new Identifier(NON_ASCII_CHARS, "non-ascii");

0 commit comments

Comments
 (0)