In Gradle how do I reference an imported ant task with special chars?

Ollie Edwards

I have an ant build which contains tasks of format

build
build.foo.bar

So to add dependencies in gradle the first one is easy

build.dependsOn(...)

But the second one is interpreted as method nesting. I suspect there's a standard groovy way to do this but I haven't cracked it.

How do I reference an ant task containing periods in an build.gradle file?

JB Nizet
project.tasks['build.foo.bar'].dependsOn(...)

should do the trick.

See Project.tasks, which returns a TaskContainer (extending TaskCollection), and TaskCollection.getAt() which, as its doc says, can be called using the [] operator.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I ignore special chars and numbers from my input?

How do I convert special chars of passwords typed with CAPSLOCK?

How do I json_decode string with special chars (" \\ " )

How do I exclude all subdirectories from Gradle zip task using Ant include/exclude pattern?

How do I make an alias for a Gradle task?

How do I intercept failures of a Gradle task?

How do I set the working directory for the Ant 'junit' task?

How do I prevent Maven build fail on Ant task failure?

How do I execute an Ant command if a task fails?

How do i remove the special chars that show as `\uxxx` in python3 string object?

How do I convert special UTF-8 chars to their iso-8859-1 equivalent using javascript?

How do I handle special chars in the credentials of the Symfony Mailer component in SMTP transport?

ZSH: How do I echo a program's output to a temp file if the output has newlines and other special chars?

Eclipse ant build: how do I reference the current Eclipse path?

How to convert gradle ant java task to kotlin

How to refactor common code in Gradle Ant task?

How do I execute ant.java properly from gradle?

How do I execute a Gradle plugin task before another one?

How do I set task properties in a Gradle Plugin

How do I add a dependency to the android gradle task 'test'?

How do I overwrite a task in gradle kotlin-dsl

How do I alias gradle task as if it were called with -x parameter?

How do I print both "from" and "to" of Gradle Copy task?

How do I publish file created by zip task in gradle

How do I use Gradle to implement an artifact in the custom jar task?

How can I set special chars in the git log --pretty=format?

How should I reference functions in imported packages?

How do I properly reference resources using a basic Gradle project?

Signing apk by gradle - invalid encoding for special chars