This repository has been archived by the owner on Jan 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'gradle' into update-#46
Conflicts: build.gradle gradle/wrapper/gradle-wrapper.jar gradle/wrapper/gradle-wrapper.properties
- Loading branch information
Showing
101 changed files
with
9,127 additions
and
19 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
Binary file not shown.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Thu Jul 21 19:45:49 EDT 2016 | ||
#Mon Aug 15 11:03:23 EDT 2016 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-all.zip |
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
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
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
60 changes: 60 additions & 0 deletions
60
src/test/core/src/testFixtures/groovy/org/gradle/api/RecordingAntBuildListener.groovy
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,60 @@ | ||
/* | ||
* Copyright 2013 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.gradle.api | ||
|
||
import org.apache.tools.ant.BuildEvent | ||
import org.apache.tools.ant.BuildListener | ||
|
||
class RecordingAntBuildListener implements BuildListener { | ||
|
||
List<BuildEvent> buildStarted = [] | ||
List<BuildEvent> buildFinished = [] | ||
List<BuildEvent> targetStarted = [] | ||
List<BuildEvent> targetFinished = [] | ||
List<BuildEvent> taskStarted = [] | ||
List<BuildEvent> taskFinished = [] | ||
List<BuildEvent> messageLogged = [] | ||
|
||
void buildStarted(BuildEvent event) { | ||
buildStarted << event | ||
} | ||
|
||
void buildFinished(BuildEvent event) { | ||
buildFinished << event | ||
} | ||
|
||
void targetStarted(BuildEvent event) { | ||
targetStarted << event | ||
} | ||
|
||
void targetFinished(BuildEvent event) { | ||
targetFinished << event | ||
} | ||
|
||
void taskStarted(BuildEvent event) { | ||
taskStarted << event | ||
} | ||
|
||
void taskFinished(BuildEvent event) { | ||
taskFinished << event | ||
} | ||
|
||
void messageLogged(BuildEvent event) { | ||
messageLogged << event | ||
} | ||
|
||
} |
72 changes: 72 additions & 0 deletions
72
src/test/core/src/testFixtures/groovy/org/gradle/api/file/FileCollectionMatchers.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,72 @@ | ||
/* | ||
* Copyright 2013 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.gradle.api.file; | ||
|
||
import org.gradle.api.internal.file.CompositeFileCollection; | ||
import org.gradle.api.internal.file.TestFiles; | ||
import org.gradle.api.internal.file.UnionFileCollection; | ||
import org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection; | ||
import org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext; | ||
import org.hamcrest.BaseMatcher; | ||
import org.hamcrest.Description; | ||
import org.hamcrest.Factory; | ||
import org.hamcrest.Matcher; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
public class FileCollectionMatchers { | ||
@Factory | ||
public static <T extends FileCollection> Matcher<T> sameCollection(final FileCollection expected) { | ||
return new BaseMatcher<T>() { | ||
public boolean matches(Object o) { | ||
FileCollection actual = (FileCollection) o; | ||
List<? extends FileCollection> actualCollections = unpack(actual); | ||
List<? extends FileCollection> expectedCollections = unpack(expected); | ||
boolean equals = actualCollections.equals(expectedCollections); | ||
if (!equals) { | ||
System.out.println("expected: " + expectedCollections); | ||
System.out.println("actual: " + actualCollections); | ||
} | ||
return equals; | ||
} | ||
|
||
private List<? extends FileCollection> unpack(FileCollection expected) { | ||
if (expected instanceof UnionFileCollection) { | ||
UnionFileCollection collection = (UnionFileCollection) expected; | ||
return new ArrayList<FileCollection>(collection.getSources()); | ||
} | ||
if (expected instanceof DefaultConfigurableFileCollection) { | ||
DefaultConfigurableFileCollection collection = (DefaultConfigurableFileCollection) expected; | ||
return new ArrayList<FileCollection>((Set) collection.getFrom()); | ||
} | ||
if (expected instanceof CompositeFileCollection) { | ||
CompositeFileCollection collection = (CompositeFileCollection) expected; | ||
DefaultFileCollectionResolveContext context = new DefaultFileCollectionResolveContext(TestFiles.resolver()); | ||
collection.visitContents(context); | ||
return context.resolveAsFileCollections(); | ||
} | ||
throw new RuntimeException("Cannot get children of " + expected); | ||
} | ||
|
||
public void describeTo(Description description) { | ||
description.appendText("same file collection as ").appendValue(expected); | ||
} | ||
}; | ||
} | ||
} |
93 changes: 93 additions & 0 deletions
93
src/test/core/src/testFixtures/groovy/org/gradle/api/internal/file/TestFiles.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,93 @@ | ||
/* | ||
* Copyright 2012 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.gradle.api.internal.file; | ||
|
||
import org.gradle.api.internal.file.collections.DefaultDirectoryFileTreeFactory; | ||
import org.gradle.api.internal.file.collections.DirectoryFileTreeFactory; | ||
import org.gradle.api.tasks.util.PatternSet; | ||
import org.gradle.api.tasks.util.internal.PatternSets; | ||
import org.gradle.internal.Factory; | ||
import org.gradle.internal.nativeintegration.filesystem.FileSystem; | ||
import org.gradle.process.internal.DefaultExecActionFactory; | ||
import org.gradle.process.internal.ExecActionFactory; | ||
import org.gradle.process.internal.ExecHandleFactory; | ||
import org.gradle.process.internal.JavaExecHandleFactory; | ||
import org.gradle.testfixtures.internal.NativeServicesTestFixture; | ||
|
||
import java.io.File; | ||
|
||
public class TestFiles { | ||
private static final FileSystem FILE_SYSTEM = NativeServicesTestFixture.getInstance().get(FileSystem.class); | ||
private static final DefaultFileLookup FILE_LOOKUP = new DefaultFileLookup(FILE_SYSTEM, PatternSets.getNonCachingPatternSetFactory()); | ||
|
||
public static FileLookup fileLookup() { | ||
return FILE_LOOKUP; | ||
} | ||
|
||
public static FileSystem fileSystem() { | ||
return FILE_SYSTEM; | ||
} | ||
|
||
/** | ||
* Returns a resolver with no base directory. | ||
*/ | ||
public static FileResolver resolver() { | ||
return FILE_LOOKUP.getFileResolver(); | ||
} | ||
|
||
/** | ||
* Returns a resolver with the given base directory. | ||
*/ | ||
public static FileResolver resolver(File baseDir) { | ||
return FILE_LOOKUP.getFileResolver(baseDir); | ||
} | ||
|
||
public static DirectoryFileTreeFactory directoryFileTreeFactory() { | ||
return new DefaultDirectoryFileTreeFactory(); | ||
} | ||
|
||
public static FileCollectionFactory fileCollectionFactory() { | ||
return new DefaultFileCollectionFactory(); | ||
} | ||
|
||
public static SourceDirectorySetFactory sourceDirectorySetFactory() { | ||
return new DefaultSourceDirectorySetFactory(resolver(), new DefaultDirectoryFileTreeFactory()); | ||
} | ||
|
||
public static SourceDirectorySetFactory sourceDirectorySetFactory(File baseDir) { | ||
return new DefaultSourceDirectorySetFactory(resolver(baseDir), new DefaultDirectoryFileTreeFactory()); | ||
} | ||
|
||
public static ExecActionFactory execActionFactory() { | ||
return new DefaultExecActionFactory(resolver()); | ||
} | ||
|
||
public static ExecHandleFactory execHandleFactory() { | ||
return new DefaultExecActionFactory(resolver()); | ||
} | ||
|
||
public static ExecHandleFactory execHandleFactory(File baseDir) { | ||
return new DefaultExecActionFactory(resolver(baseDir)); | ||
} | ||
|
||
public static JavaExecHandleFactory javaExecHandleFactory(File baseDir) { | ||
return new DefaultExecActionFactory(resolver(baseDir)); | ||
} | ||
|
||
public static Factory<PatternSet> getPatternSetFactory() { | ||
return resolver().getPatternSetFactory(); | ||
} | ||
} |
Oops, something went wrong.