Skip to content

Commit

Permalink
Revert "Temporarily reverting everything since 810f052 for 3.0-milest…
Browse files Browse the repository at this point in the history
…one-1 release"

This reverts commit 506f8ce.
  • Loading branch information
eriwen committed Jun 8, 2016
1 parent 506f8ce commit 94b9299
Show file tree
Hide file tree
Showing 197 changed files with 20,351 additions and 947 deletions.
2 changes: 1 addition & 1 deletion design-docs/gradle-3.0.md
Expand Up @@ -25,7 +25,7 @@ Note: for the change listed below, the old behaviour or feature to be removed sh
- Move internal types `org.gradle.logging.StandardOutputCapture` and `org.gradle.logging.LoggingManagerInternal` into an internal package.
- Merge `Module` and `ModuleInternal`, now that `Module` is internal (Done)
- Internal `has()`, `get()` and `set()` dynamic methods exposed by `ExtraPropertiesDynamicObjectAdapter` (Done)
- Constructor on `DefaultSourceDirectorySet` (Done)
- Constructor on `DefaultSourceDirectorySet` - not for 3.0, deprecation only happened in 2.14 and it is widely used

## Change minimum version for running Gradle to Java 7

Expand Down
3 changes: 2 additions & 1 deletion gradle/buildSplits.gradle
Expand Up @@ -27,7 +27,8 @@ def buckets = [
":jvmServices",
":docs",
":distributions",
":soak"
":soak",
":smokeTest"
],

"3": [
Expand Down
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Expand Up @@ -166,7 +166,7 @@ libraries.bouncycastle_pgp = dependencies.module("org.bouncycastle:bcpg-jdk15on:

libraries.joda = 'joda-time:joda-time:2.8.2@jar'

versions.aws = "1.11.4"
versions.aws = "1.11.6"
versions.jackson = "2.6.6"
libraries.awsS3 = [
"com.amazonaws:aws-java-sdk-s3:${versions.aws}@jar",
Expand Down
2 changes: 2 additions & 0 deletions gradle/idea.gradle
Expand Up @@ -214,6 +214,8 @@ idea {
"-DintegTest.libsRepo=${rootProject.file('build/repo').absolutePath}",
"-Dorg.gradle.integtest.daemon.registry=${rootProject.file('build/daemon').absolutePath}",
"-DintegTest.distsDir=${rootProject.distsDir.absolutePath}",
"-DsmokeTest.gradleHomeDir=${rootProject.intTestImage.destinationDir.absolutePath}",
"-DsmokeTest.gradleUserHomeDir=${rootProject.file('intTestHomeDir').absolutePath}",
"-Dorg.gradle.integtest.executer=embedded",
"-Dorg.gradle.integtest.versions=latest",
"-ea",
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Fri Jun 03 14:02:00 EDT 2016
#Tue Jun 07 10:47:35 MST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-3.0-20160603173718+0000-bin.zip
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-3.0-20160607000021+0000-bin.zip
1 change: 1 addition & 0 deletions settings.gradle
Expand Up @@ -79,6 +79,7 @@ include 'platformPlay'
include 'testKit'
include 'installationBeacon'
include 'soak'
include 'smokeTest'

rootProject.name = 'gradle'
rootProject.children.each {project ->
Expand Down
Expand Up @@ -198,18 +198,23 @@ public boolean apply(ScriptBlock input) {
});
}

public static boolean isString(ConstantExpression constantExpression) {
return constantExpression.getType().getName().equals(String.class.getName());
public static boolean isOfType(ConstantExpression constantExpression, Class<?> type) {
return constantExpression.getType().getName().equals(type.getName());
}

@Nullable
public static ConstantExpression hasSingleConstantStringArg(MethodCallExpression call) {
return hasSingleConstantArgOfType(call, String.class);
}

@Nullable
public static ConstantExpression hasSingleConstantArgOfType(MethodCallExpression call, Class<?> type) {
ArgumentListExpression argumentList = (ArgumentListExpression) call.getArguments();
if (argumentList.getExpressions().size() == 1) {
Expression argumentExpression = argumentList.getExpressions().get(0);
if (argumentExpression instanceof ConstantExpression) {
ConstantExpression constantArgumentExpression = (ConstantExpression) argumentExpression;
if (isString(constantArgumentExpression)) {
if (isOfType(constantArgumentExpression, type)) {
return constantArgumentExpression;
}
}
Expand Down
Expand Up @@ -24,6 +24,7 @@ import org.gradle.api.internal.project.IsolatedAntBuilder
import org.gradle.api.plugins.quality.internal.CheckstyleReportsImpl
import org.gradle.api.reporting.Reporting
import org.gradle.api.resources.TextResource
import org.gradle.api.tasks.Console
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.Internal
Expand Down Expand Up @@ -137,7 +138,7 @@ class Checkstyle extends SourceTask implements VerificationTask, Reporting<Check
/**
* Whether or not rule violations are to be displayed on the console.
*/
@Input
@Console
boolean showViolations = true

@CompileStatic(TypeCheckingMode.SKIP)
Expand Down
Expand Up @@ -112,11 +112,11 @@ class Pmd extends SourceTask implements VerificationTask, Reporting<PmdReports>
/**
* Specifies the rule priority threshold.
*
* @see PmdExtension#rulePriority
*/
* @see PmdExtension#rulePriority
*/
@Input
@Incubating
int rulePriority
int rulePriority

/**
* Sets the rule priority threshold.
Expand Down
Expand Up @@ -24,7 +24,6 @@ import org.gradle.test.fixtures.file.TestFile
import org.gradle.test.fixtures.server.http.HttpServer
import org.gradle.test.matchers.UserAgentMatcher
import org.gradle.util.GradleVersion
import org.gradle.test.fixtures.file.LeaksFileHandles
import org.junit.Rule
import org.junit.Test

Expand All @@ -37,7 +36,6 @@ public class ExternalScriptExecutionIntegrationTest extends AbstractIntegrationT
public final HttpServer server = new HttpServer()

@Test
@LeaksFileHandles
public void executesExternalScriptAgainstAProjectWithCorrectEnvironment() {
createExternalJar()
createBuildSrc()
Expand Down Expand Up @@ -65,6 +63,10 @@ try {
assert false: 'should fail'
} catch (ClassNotFoundException e) {
// expected
} finally {
if (buildscript.classLoader instanceof Closeable) {
buildscript.classLoader.close()
}
}
task doStuff
Expand Down
Expand Up @@ -19,7 +19,6 @@ import org.gradle.integtests.fixtures.AbstractIntegrationSpec
import org.gradle.integtests.fixtures.executer.ArtifactBuilder
import org.gradle.integtests.fixtures.executer.ExecutionResult
import org.gradle.test.fixtures.file.TestFile
import org.gradle.test.fixtures.file.LeaksFileHandles

class InitScriptExecutionIntegrationTest extends AbstractIntegrationSpec {
def "executes init.gradle from user home dir"() {
Expand Down Expand Up @@ -56,7 +55,6 @@ class InitScriptExecutionIntegrationTest extends AbstractIntegrationSpec {
b < c
}

@LeaksFileHandles
def "executes init script with correct environment"() {
given:
def implClassName = 'com.google.common.collect.Multimap'
Expand All @@ -81,6 +79,10 @@ try {
assert false: 'should fail'
} catch (ClassNotFoundException e) {
// expected
} finally {
if (initscript.classLoader instanceof Closeable) {
initscript.classLoader.close()
}
}
"""

Expand Down
Expand Up @@ -19,7 +19,6 @@ import org.gradle.integtests.fixtures.AbstractIntegrationTest
import org.gradle.integtests.fixtures.executer.ArtifactBuilder
import org.gradle.integtests.fixtures.executer.ExecutionResult
import org.gradle.test.fixtures.file.TestFile
import org.gradle.test.fixtures.file.LeaksFileHandles
import org.junit.Test

import static org.hamcrest.Matchers.containsString
Expand All @@ -28,7 +27,6 @@ import static org.junit.Assert.assertThat

class SettingsScriptExecutionIntegrationTest extends AbstractIntegrationTest {
@Test
@LeaksFileHandles
public void executesSettingsScriptWithCorrectEnvironment() {
createExternalJar()
createBuildSrc()
Expand All @@ -52,6 +50,10 @@ try {
assert false: 'should fail'
} catch (ClassNotFoundException e) {
// expected
} finally {
if (buildscript.classLoader instanceof Closeable) {
buildscript.classLoader.close()
}
}
"""
testFile('build.gradle') << 'task doStuff'
Expand Down
Expand Up @@ -27,7 +27,7 @@ class InMemoryTaskArtifactsIntegrationTest extends DaemonIntegrationSpec {
task someTask {
inputs.property "someEnum", SomeEnum.E1
def f = new File("build/e1")
outputs.dir f
outputs.includeDir f
doLast {
f.mkdirs()
}
Expand Down
Expand Up @@ -27,13 +27,13 @@ class InputOutputEnsuringTaskExecuterIntegrationTest extends AbstractIntegration
it.configure {
println "Inputs are configured via nested configure()"
}
it.file("input.txt")
it.includeFile("input.txt")
}
outputs.configure {
it.configure {
println "Outputs are configured via nested configure()"
}
it.file("output.txt")
it.includeFile("output.txt")
}
doLast {
file("output.txt") << file("input.txt")
Expand Down
Expand Up @@ -367,13 +367,13 @@ class CopyTaskIntegrationSpec extends AbstractIntegrationSpec {
configurations { compile }
dependencies { compile files('a.jar') }
task fileProducer {
outputs.file 'build/out.txt'
outputs.includeFile 'build/out.txt'
doLast {
file('build/out.txt').text = 'some content'
}
}
task dirProducer {
outputs.dir 'build/outdir'
outputs.includeDir 'build/outdir'
doLast {
file('build/outdir').mkdirs()
file('build/outdir/file1.txt').text = 'some content'
Expand Down Expand Up @@ -404,13 +404,13 @@ class CopyTaskIntegrationSpec extends AbstractIntegrationSpec {
configurations { compile }
dependencies { compile files('a.jar') }
task fileProducer {
outputs.file 'build/out.txt'
outputs.includeFile 'build/out.txt'
doLast {
file('build/out.txt').text = 'some content'
}
}
task dirProducer {
outputs.dir 'build/outdir'
outputs.includeDir 'build/outdir'
doLast {
file('build/outdir').mkdirs()
file('build/outdir/file1.txt').text = 'some content'
Expand Down
Expand Up @@ -84,6 +84,9 @@ class ExecutionTimeTaskConfigurationIntegrationTest extends AbstractIntegrationS
"inputs.file('a')" | "TaskInputs.file(Object)"
"inputs.files('a')" | "TaskInputs.files(Object...)"
"inputs.dir('a')" | "TaskInputs.dir(Object)"
"inputs.includeFile('a')" | "TaskInputs.includeFile(Object)"
"inputs.includeFiles('a')" | "TaskInputs.includeFiles(Object...)"
"inputs.includeDir('a')" | "TaskInputs.includeDir(Object)"
"inputs.property('key', 'value')" | "TaskInputs.property(String, Object)"
"inputs.properties([key: 'value'])" | "TaskInputs.properties(Map)"
"inputs.source('a')" | "TaskInputs.source(Object)"
Expand All @@ -94,6 +97,8 @@ class ExecutionTimeTaskConfigurationIntegrationTest extends AbstractIntegrationS
"outputs.file('a')" | "TaskOutputs.file(Object)"
"outputs.files('a')" | "TaskOutputs.files(Object...)"
"outputs.dir('a')" | "TaskOutputs.dir(Object)"
"outputs.includeFile('a')" | "TaskOutputs.includeFile(Object)"
"outputs.includeDir('a')" | "TaskOutputs.includeDir(Object)"
"outputs.configure {}" | "TaskOutputs.configure(Action)"
}
}
Expand Up @@ -23,7 +23,7 @@ class FailingIncrementalTasksIntegrationTest extends AbstractIntegrationSpec {
def "consecutively failing task has correct up-to-date status and failure"() {
buildFile << """
task foo {
outputs.file("out.txt")
outputs.includeFile("out.txt")
doLast {
if (project.file("out.txt").exists()) {
throw new RuntimeException("Boo!")
Expand Down
Expand Up @@ -398,15 +398,15 @@ task b(type: DirTransformerTask) {
public void canUseUpToDatePredicateToForceTaskToExecute() {
testFile('build.gradle') << '''
task inputsAndOutputs {
inputs.files 'src.txt'
outputs.file 'src.a.txt'
inputs.includeFiles 'src.txt'
outputs.includeFile 'src.a.txt'
outputs.upToDateWhen { project.hasProperty('uptodate') }
doFirst {
outputs.files.singleFile.text = "[${inputs.files.singleFile.text}]"
}
}
task noOutputs {
inputs.files 'src.txt'
inputs.includeFile 'src.txt'
outputs.upToDateWhen { project.hasProperty('uptodate') }
doFirst { }
}
Expand Down

0 comments on commit 94b9299

Please sign in to comment.