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

Commit

Permalink
updating with modifications from gradle 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dcendents committed Aug 15, 2016
1 parent a1f5ba1 commit 489280b
Show file tree
Hide file tree
Showing 101 changed files with 9,156 additions and 48 deletions.
37 changes: 34 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@

apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'maven'

repositories {
mavenCentral()
mavenLocal()
}

sourceSets {
test {
groovy {
srcDirs = ['src/test/groovy', 'src/test/core/src/testFixtures/groovy', 'src/test/internal-testing/src/main/groovy' ]
}
}
}

dependencies {
compile gradleApi()

// from gradle/gradle/dependencies.gradle
compile dependencies.module("org.apache.maven:maven-core:3.0.4") {
compileOnly dependencies.module("org.apache.maven:maven-core:3.0.4") {
dependency "org.apache.maven:maven-settings:3.0.4@jar"
dependency "org.apache.maven:maven-settings-builder:3.0.4@jar"

Expand Down Expand Up @@ -52,12 +61,34 @@ dependencies {
}

testCompile 'junit:junit:4.12',
'org.hamcrest:hamcrest-all:1.3'
'org.hamcrest:hamcrest-all:1.3',
// from gradle/subprojects/core/core.gradle, gradle/subprojects/internal-testing/internal-testing.gradle and gradle/gradle/dependencies.gradle
'commons-io:commons-io:2.2',
'commons-lang:commons-lang:2.6@jar',
'org.spockframework:spock-core:1.0-groovy-2.4@jar',
"org.codehaus.groovy:groovy-all:2.4.7",
'org.objenesis:objenesis:1.2@jar',
'cglib:cglib-nodep:2.2.2',
'org.jmock:jmock:2.5.1',
dependencies.create('org.jmock:jmock-junit4:2.5.1') { exclude group: 'junit', module: 'junit-dep' }, //junit-dep pulls old definitions of core junit types.
'org.jmock:jmock-legacy:2.5.1',
'com.google.guava:guava-jdk5:17.0@jar',
'org.jsoup:jsoup:1.6.3',
'com.google.code.findbugs:jsr305:1.3.9@jar',
'org.ow2.asm:asm-all:5.1'

testCompile dependencies.module('org.apache.ivy:ivy:2.2.0'){
dependency "com.jcraft:jsch:0.1.53"
}

testCompile dependencies.module('org.apache.ant:ant:1.9.6') {
dependency 'org.apache.ant:ant-launcher:1.9.6@jar'
}
}
sourceCompatibility = 1.6
targetCompatibility = 1.6

task wrapper(type: Wrapper) {
gradleVersion = '2.14'
gradleVersion = '3.0'
distributionUrl = "https://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jun 20 21:26:40 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-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-all.zip
57 changes: 31 additions & 26 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,30 @@
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

Expand All @@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
Expand All @@ -40,31 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
Expand All @@ -90,7 +89,7 @@ location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
Expand All @@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
Expand Down Expand Up @@ -161,4 +161,9 @@ function splitJvmOpts() {
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
14 changes: 4 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

Expand Down Expand Up @@ -46,10 +46,9 @@ echo location of your Java installation.
goto fail

:init
@rem Get command-line arguments, handling Windowz variants
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
Expand All @@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/gradle/api/plugins/AndroidMavenPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.gradle.api.artifacts.maven.MavenPom;
import org.gradle.api.artifacts.maven.MavenResolver;
import org.gradle.api.internal.artifacts.DefaultModuleVersionIdentifier;
import org.gradle.api.internal.artifacts.ModuleInternal;
import org.gradle.api.internal.artifacts.Module;
import org.gradle.api.internal.artifacts.configurations.ConfigurationInternal;
import org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler;
import org.gradle.api.internal.artifacts.ivyservice.projectmodule.DefaultProjectPublication;
Expand Down Expand Up @@ -137,7 +137,7 @@ public void execute(Project project) {
}

ConfigurationInternal configuration = (ConfigurationInternal) uploadArchives.getConfiguration();
ModuleInternal module = configuration.getModule();
Module module = configuration.getModule();
for (MavenResolver resolver : uploadArchives.getRepositories().withType(MavenResolver.class)) {
MavenPom pom = resolver.getPom();
ModuleVersionIdentifier publicationId = new DefaultModuleVersionIdentifier(
Expand Down
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
}

}
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);
}
};
}
}
Loading

0 comments on commit 489280b

Please sign in to comment.