Created
December 9, 2023 22:45
-
-
Save alllex/393120c044fac75b0feb2812228304e3 to your computer and use it in GitHub Desktop.
Test that allows extending a built-in Wrapper task by a non abstract user-defined class
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
class TmpIntegrationTest extends AbstractIntegrationSpec { | |
def "tmp test"() { | |
settingsFile << """ | |
rootProject.name = "root" | |
""" | |
buildFile << """ | |
class MyWrapper extends Wrapper { | |
// Just to make MyWrapper compile | |
@Override | |
public Property<Boolean> getValidateDistributionUrl() { return getServices().get(ObjectFactory.class).property(Boolean.class).convention(true); } | |
} | |
tasks.register("myWrapper", MyWrapper) | |
""" | |
expect: | |
file("gradle/wrapper/gradle-wrapper.properties").assertDoesNotExist() | |
when: | |
run("myWrapper") | |
then: | |
file("gradle/wrapper/gradle-wrapper.properties").exists() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment