Skip to content

Commit

Permalink
Merge pull request #6311 from gradle/oehme/gradle-50
Browse files Browse the repository at this point in the history
Prepare for Gradle 5.0
  • Loading branch information
oehme committed Aug 23, 2018
2 parents 322638d + 92a6283 commit ebc68b1
Show file tree
Hide file tree
Showing 25 changed files with 59 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class WrapperPluginAutoApplyActionIntegTest extends AbstractIntegrationSpec {
then:

outputContains("running custom wrapper task")
outputContains("Creating a custom task named 'wrapper' has been deprecated. This is scheduled to be removed in Gradle 5.0. You can configure the existing task using the 'wrapper { }' syntax or create your custom task under a different name.")
outputContains("Creating a custom task named 'wrapper' has been deprecated.")
wrapper.notGenerated()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import static org.gradle.util.TextUtil.getPlatformLineSeparator

class CheckstylePluginMultiProjectTest extends AbstractIntegrationSpec {

private static final EXPECTED_DEPRECATION_MESSAGE = "Setting the Checkstyle configuration file under 'config/checkstyle' of a sub project has been deprecated. This is scheduled to be removed in Gradle 5.0. Use the root project's 'config/checkstyle' directory instead.";
private static final EXPECTED_DEPRECATION_MESSAGE = "Setting the Checkstyle configuration file under 'config/checkstyle' of a sub project has been deprecated.";

def "configures checkstyle extension to read config from root project in a single project build"() {
given:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ class CheckstylePluginVersionIntegrationTest extends MultiVersionIntegrationSpec
executer.expectDeprecationWarning()
succeeds "checkstyleMain"
then:
outputContains("Adding 'config_loc' to checkstyle.configProperties has been deprecated. This is scheduled to be removed in Gradle 5.0. Use checkstyle.configDir instead as this will behave better with up-to-date checks.")
outputContains("Adding 'config_loc' to checkstyle.configProperties has been deprecated.")
result.assertTaskExecuted(":checkstyleMain")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public interface DomainObjectCollection<T> extends Collection<T> {
* <strong>Note: this method currently has a placeholder name and will almost certainly be renamed.</strong>
*
* @param provider A {@link Provider} of {@link Iterable} that can provide the elements when required.
* @since 4.11
* @since 5.0
*/
@Incubating
void addAllLater(Provider<? extends Iterable<T>> provider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public interface MutableVersionConstraint extends VersionConstraint {
/**
* Sets the required version of this module. Any other version constraints will be overriden.
* @param version the preferred version of this module
* @since 4.11
* @since 5.0
*/
void require(String version);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,12 @@ class NameValidationIntegrationTest extends AbstractIntegrationSpec {
}

void assertPrintsForbiddenCharacterDeprecationMessage(String nameDescription, String deprecatedName, String suggestion = '') {
assert output.contains("The $nameDescription '$deprecatedName' contains at least one of the following characters: [ , /, \\, :, <, >, \", ?, *, |]. This has been deprecated and is scheduled to be removed in Gradle 5.0.$suggestion")
outputContains("The $nameDescription '$deprecatedName' contains at least one of the following characters: [ , /, \\, :, <, >, \", ?, *, |].")
outputContains(suggestion)
}

void assertPrintsForbiddenStartOrEndCharacterDeprecationMessage(String nameDescription, String deprecatedName, String suggestion = '') {
assert output.contains("The $nameDescription '$deprecatedName' starts or ends with a '.'. This has been deprecated and is scheduled to be removed in Gradle 5.0.$suggestion")
outputContains("The $nameDescription '$deprecatedName' starts or ends with a '.'.")
outputContains(suggestion)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ apply plugin: CustomPlugin
then:
executer.expectDeprecationWarning()
succeeds('help')
outputContains("@DeferredConfigurable has been deprecated. This is scheduled to be removed in Gradle 5.0.")
outputContains("@DeferredConfigurable has been deprecated.")
}

def "configure actions on deferred configurable extension are not applied if extension is not referenced"() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def p = $expr

where:
expr | warning
"layout.newDirectoryVar()" | "The ProjectLayout.newDirectoryVar() method has been deprecated. This is scheduled to be removed in Gradle 5.0. Please use the ProjectLayout.directoryProperty() method instead."
"layout.newFileVar()" | "The ProjectLayout.newFileVar() method has been deprecated. This is scheduled to be removed in Gradle 5.0. Please use the ProjectLayout.fileProperty() method instead."
"layout.newDirectoryVar()" | "The ProjectLayout.newDirectoryVar() method has been deprecated."
"layout.newFileVar()" | "The ProjectLayout.newFileVar() method has been deprecated."
}

def "can attach a calculated directory to task property"() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ p.get()
run()

then:
output.contains("The property(Class) method has been deprecated. This is scheduled to be removed in Gradle 5.0. Please use the ObjectFactory.property(Class) method instead.")
output.contains("The property(Class) method has been deprecated.")

where:
expr | _
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class InternalTaskOptionApiIntegrationTest extends AbstractIntegrationSpec {

then:
outputContains('option=foo')
outputContains('org.gradle.api.internal.tasks.options.OptionValues has been deprecated. This is scheduled to be removed in Gradle 5.0. Use org.gradle.api.tasks.options.OptionValues instead.')
outputContains('org.gradle.api.internal.tasks.options.Option has been deprecated. This is scheduled to be removed in Gradle 5.0. Use org.gradle.api.tasks.options.Option instead.')
outputContains('org.gradle.api.internal.tasks.options.OptionValues has been deprecated.')
outputContains('org.gradle.api.internal.tasks.options.Option has been deprecated.')
}

static String taskUsingInternalApi() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ task noop{
succeeds('noop')

then:
outputContains("The support for implicit import of internal classes has been deprecated. This is scheduled to be removed in Gradle 5.0.")
outputContains("The support for implicit import of internal classes has been deprecated.")
outputContains("build.gradle' is using GradleVersion from the private org.gradle.util package. Please either stop using internal classes (recommended) or import them explicitly at the top of your build file.")
}

Expand All @@ -76,7 +76,7 @@ task noop{
succeeds('noop')

then:
outputContains("The support for implicit import of internal classes has been deprecated. This is scheduled to be removed in Gradle 5.0.")
outputContains("The support for implicit import of internal classes has been deprecated.")
outputContains("foo.gradle' is using GradleVersion from the private org.gradle.util package. Please either stop using internal classes (recommended) or import them explicitly at the top of your build file.")
}

Expand All @@ -94,7 +94,7 @@ task noop{
succeeds('noop')

then:
outputContains('The support for implicit import of internal classes has been deprecated. This is scheduled to be removed in Gradle 5.0. Build file')
outputContains('The support for implicit import of internal classes has been deprecated.')
outputContains("build.gradle' is using CollectionUtils and GradleVersion from the private org.gradle.util package. Please either stop using internal classes (recommended) or import them explicitly at the top of your build file.")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ class NameValidatorTest extends Specification {

void assertForbidden(name, message) {
if (name == '') {
assert message.contains("is empty. This has been deprecated and is scheduled to be removed in Gradle 5.0.")
assert message.contains("is empty. This has been deprecated ")
} else if (name.contains("" + forbiddenLeadingAndTrailingCharacter)) {
assert message.contains("' starts or ends with a '.'. This has been deprecated and is scheduled to be removed in Gradle 5.0.")
assert message.contains("' starts or ends with a '.'. This has been deprecated ")
} else {
assert message.contains("""' contains at least one of the following characters: [ , /, \\, :, <, >, ", ?, *, |]. This has been deprecated and is scheduled to be removed in Gradle 5.0.""")
assert message.contains("""' contains at least one of the following characters: [ , /, \\, :, <, >, ", ?, *, |]. This has been deprecated""")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ import org.gradle.integtests.tooling.fixture.ToolingApiVersion
import org.gradle.tooling.model.idea.IdeaContentRoot
import org.gradle.tooling.model.idea.IdeaModule
import org.gradle.tooling.model.idea.IdeaProject
import org.gradle.util.ToBeImplemented
import org.junit.Ignore

/**
* NOTE: Starting with Gradle 5.0 the contract of IdeaModule#sourceDirs and IdeaModule#testSourceDirs changes in
* a way that the resource directories are excluded.
*/
@ToolingApiVersion(">=5.0")
@TargetGradleVersion(">=5.0")
@Ignore
@ToBeImplemented
class ToolingApiIdeaModelCrossVersionSpec extends ToolingApiSpecification {


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import org.gradle.integtests.fixtures.AbstractIntegrationSpec
import org.gradle.test.fixtures.file.LeaksFileHandles
import org.gradle.test.fixtures.server.http.HttpServer
import org.gradle.util.Requires
import org.junit.Ignore

import static org.gradle.util.TestPrecondition.KOTLIN_SCRIPT

Expand Down Expand Up @@ -134,6 +135,7 @@ class GradleKotlinDslIntegrationTest extends AbstractIntegrationSpec {
executer.cleanup()
}

@Ignore("TODO re-enable once a 5.0 nightly is out")
def 'can query KotlinBuildScriptModel'() {
given:
// This test breaks encapsulation a bit in the interest of ensuring Gradle Kotlin DSL use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,16 @@ public void deprecationWarningAppearsWhenNestedBuildHasNoSettingsFile() {
subDirectory.file("build.gradle").write("");

ExecutionResult result = inDirectory(subDirectory).withTasks("help").expectDeprecationWarning().run();
result.assertOutputContains("Support for nested build without a settings file was deprecated. This is scheduled to be removed in Gradle 5.0. You should create a empty settings file in " + subDirectory.getAbsolutePath());
result.assertOutputContains("Support for nested build without a settings file was deprecated.");
result.assertOutputContains("You should create a empty settings file in " + subDirectory.getAbsolutePath());

result = usingBuildFile(subBuildFile).inDirectory(subDirectory).withTasks("help").expectDeprecationWarning().run();
result.assertOutputContains("Support for nested build without a settings file was deprecated. This is scheduled to be removed in Gradle 5.0. You should create a empty settings file in " + subDirectory.getAbsolutePath());
result.assertOutputContains("Support for nested build without a settings file was deprecated.");
result.assertOutputContains("You should create a empty settings file in " + subDirectory.getAbsolutePath());

result = usingProjectDir(subDirectory).withTasks("help").expectDeprecationWarning().run();
result.assertOutputContains("Support for nested build without a settings file was deprecated. This is scheduled to be removed in Gradle 5.0. You should create a empty settings file in " + subDirectory.getAbsolutePath());
result.assertOutputContains("Support for nested build without a settings file was deprecated.");
result.assertOutputContains("You should create a empty settings file in " + subDirectory.getAbsolutePath());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class TaskDefinitionIntegrationTest extends AbstractIntegrationSpec {

then:
output.contains(message)
output.contains("The Task.leftShift(Closure) method has been deprecated. This is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.")
output.contains("The Task.leftShift(Closure) method has been deprecated.")
}

def "can construct a custom task without constructor arguments"() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class DeprecatedUsageBuildOperationProgressIntegrationTest extends AbstractInteg
then:
def initDeprecation = operations.only("Apply script init.gradle to build").progress.find {it.hasDetailsOfType(DeprecatedUsageProgressDetails)}
initDeprecation.details.summary == 'Init script has been deprecated.'
initDeprecation.details.removalDetails == 'This is scheduled to be removed in Gradle 5.0.'
initDeprecation.details.removalDetails == 'This is scheduled to be removed in Gradle 6.0.'
initDeprecation.details.advice == null
initDeprecation.details.contextualAdvice == null
initDeprecation.details.stackTrace.size > 0
Expand All @@ -85,7 +85,7 @@ class DeprecatedUsageBuildOperationProgressIntegrationTest extends AbstractInteg

def pluginDeprecation = operations.only("Apply plugin SomePlugin to root project 'root'").progress.find {it.hasDetailsOfType(DeprecatedUsageProgressDetails)}
pluginDeprecation.details.summary == 'Plugin has been deprecated.'
pluginDeprecation.details.removalDetails == 'This is scheduled to be removed in Gradle 5.0.'
pluginDeprecation.details.removalDetails == 'This is scheduled to be removed in Gradle 6.0.'
pluginDeprecation.details.advice == null
pluginDeprecation.details.contextualAdvice == null
pluginDeprecation.details.type == 'USER_CODE_DIRECT'
Expand All @@ -95,7 +95,7 @@ class DeprecatedUsageBuildOperationProgressIntegrationTest extends AbstractInteg

def invocationDeprecation = operations.only("Apply script build.gradle to root project 'root'").progress.findAll {it.hasDetailsOfType(DeprecatedUsageProgressDetails)}[0]
invocationDeprecation.details.summary == 'Some invocation feature has been deprecated.'
invocationDeprecation.details.removalDetails == 'This is scheduled to be removed in Gradle 5.0.'
invocationDeprecation.details.removalDetails == 'This is scheduled to be removed in Gradle 6.0.'
invocationDeprecation.details.advice == "Don't do custom invocation."
invocationDeprecation.details.type == "BUILD_INVOCATION"
invocationDeprecation.details.stackTrace.size > 0
Expand All @@ -104,7 +104,7 @@ class DeprecatedUsageBuildOperationProgressIntegrationTest extends AbstractInteg

def userIndirectCodeDeprecation = operations.only("Apply script build.gradle to root project 'root'").progress.findAll {it.hasDetailsOfType(DeprecatedUsageProgressDetails)}[1]
userIndirectCodeDeprecation.details.summary == 'Some indirect deprecation has been deprecated.'
userIndirectCodeDeprecation.details.removalDetails == 'This is scheduled to be removed in Gradle 5.0.'
userIndirectCodeDeprecation.details.removalDetails == 'This is scheduled to be removed in Gradle 6.0.'
userIndirectCodeDeprecation.details.advice == "Some advice."
userIndirectCodeDeprecation.details.type == 'USER_CODE_INDIRECT'
userIndirectCodeDeprecation.details.stackTrace.size > 0
Expand All @@ -113,7 +113,7 @@ class DeprecatedUsageBuildOperationProgressIntegrationTest extends AbstractInteg

def scriptPluginDeprecation = operations.only("Apply script script.gradle to root project 'root'").progress.find {it.hasDetailsOfType(DeprecatedUsageProgressDetails)}
scriptPluginDeprecation.details.summary == 'Plugin script has been deprecated.'
scriptPluginDeprecation.details.removalDetails == 'This is scheduled to be removed in Gradle 5.0.'
scriptPluginDeprecation.details.removalDetails == 'This is scheduled to be removed in Gradle 6.0.'
scriptPluginDeprecation.details.advice == null
scriptPluginDeprecation.details.type == 'USER_CODE_DIRECT'
scriptPluginDeprecation.details.stackTrace.size > 0
Expand All @@ -132,7 +132,7 @@ class DeprecatedUsageBuildOperationProgressIntegrationTest extends AbstractInteg

def typedTaskDeprecation = operations.only("Execute someAction for :t").progress.find {it.hasDetailsOfType(DeprecatedUsageProgressDetails)}
typedTaskDeprecation.details.summary == 'Typed task has been deprecated.'
typedTaskDeprecation.details.removalDetails == 'This is scheduled to be removed in Gradle 5.0.'
typedTaskDeprecation.details.removalDetails == 'This is scheduled to be removed in Gradle 6.0.'
typedTaskDeprecation.details.advice == null
typedTaskDeprecation.details.contextualAdvice == null
typedTaskDeprecation.details.type == 'USER_CODE_DIRECT'
Expand All @@ -143,7 +143,7 @@ class DeprecatedUsageBuildOperationProgressIntegrationTest extends AbstractInteg

def typedTaskDeprecation2 = operations.only("Execute someAction for :t2").progress.find {it.hasDetailsOfType(DeprecatedUsageProgressDetails)}
typedTaskDeprecation2.details.summary == 'Typed task has been deprecated.'
typedTaskDeprecation2.details.removalDetails == 'This is scheduled to be removed in Gradle 5.0.'
typedTaskDeprecation2.details.removalDetails == 'This is scheduled to be removed in Gradle 6.0.'
typedTaskDeprecation2.details.advice == null
typedTaskDeprecation2.details.contextualAdvice == null
typedTaskDeprecation2.details.type == 'USER_CODE_DIRECT'
Expand All @@ -166,7 +166,7 @@ class DeprecatedUsageBuildOperationProgressIntegrationTest extends AbstractInteg
then:
def buildSrcDeprecations = operations.only("Apply script build.gradle to project ':buildSrc'").progress.find {it.hasDetailsOfType(DeprecatedUsageProgressDetails)}
buildSrcDeprecations.details.summary.contains('BuildSrc script has been deprecated.')
buildSrcDeprecations.details.removalDetails.contains('This is scheduled to be removed in Gradle 5.0.')
buildSrcDeprecations.details.removalDetails.contains('This is scheduled to be removed in Gradle 6.0.')
buildSrcDeprecations.details.advice == null
buildSrcDeprecations.details.contextualAdvice == null
buildSrcDeprecations.details.type == 'USER_CODE_DIRECT'
Expand Down Expand Up @@ -203,7 +203,7 @@ class DeprecatedUsageBuildOperationProgressIntegrationTest extends AbstractInteg
then:
def includedBuildScriptDeprecations = operations.only("Apply script build.gradle to project ':included'").progress.find {it.hasDetailsOfType(DeprecatedUsageProgressDetails)}
includedBuildScriptDeprecations.details.summary == 'Included build script has been deprecated.'
includedBuildScriptDeprecations.details.removalDetails == 'This is scheduled to be removed in Gradle 5.0.'
includedBuildScriptDeprecations.details.removalDetails == 'This is scheduled to be removed in Gradle 6.0.'
includedBuildScriptDeprecations.details.advice == null
includedBuildScriptDeprecations.details.contextualAdvice == null
includedBuildScriptDeprecations.details.type == 'USER_CODE_DIRECT'
Expand All @@ -213,7 +213,7 @@ class DeprecatedUsageBuildOperationProgressIntegrationTest extends AbstractInteg

def includedBuildTaskDeprecations = operations.only("Execute doLast {} action for :included:t").progress.find {it.hasDetailsOfType(DeprecatedUsageProgressDetails)}
includedBuildTaskDeprecations.details.summary == 'Included build task has been deprecated.'
includedBuildTaskDeprecations.details.removalDetails == 'This is scheduled to be removed in Gradle 5.0.'
includedBuildTaskDeprecations.details.removalDetails == 'This is scheduled to be removed in Gradle 6.0.'
includedBuildTaskDeprecations.details.advice == null
includedBuildTaskDeprecations.details.contextualAdvice == null
includedBuildTaskDeprecations.details.type == 'USER_CODE_DIRECT'
Expand Down

0 comments on commit ebc68b1

Please sign in to comment.