AntBuildStep
A build step running ant script
Example. Adds a simpe Ant build step with specified build file and targets. Default JDK is used.
buildType {
// Other Build Type settings ...
steps {
// Other Build Steps ...
ant {
name = "My Ant step"
mode = antFile {
path = "my-build.xml"
}
targets = "target1 target2"
}
Content copied to clipboard }
}
Example. Adds an Ant build step with build file content specified directly in the step settings. Custom working directory is set. Custom Ant setup is provided, as well as custom JDK home and JVM parameters are set. IDEA-based code coverage is configured.
buildType {
// Other Build Type settings ...
steps {
// Other Build Steps ...
ant {
name = "My Ant step"
mode = antScript {
content = """
// Example Build file
// content goes here ...
""".trimIndent()
}
workingDir = "ant-project/"
targets = "target1 target2"
antHome = "my-ant/home"
antArguments = "-quiet"
jdkHome = "%env.JDK_11_0%"
jvmArgs = "-Xmx512m"
coverageEngine = idea {
includeClasses = "org.sample.*"
excludeClasses = "org.sample.test.*"
}
}
Content copied to clipboard }
}
Example. Adds an Ant build step with build file content specified directly in the step settings to be run inside a Docker container. Custom test parameter is set. This build step will run even if some previous build steps are failed.
buildType {
// Other Build Type settings ...
steps {
// Other Build Steps ...
ant {
name = "My Ant step"
executionMode = BuildStep.ExecutionMode.RUN_ON_FAILURE
mode = antScript {
content = """
// Example Build file
// content goes here ...
""".trimIndent()
}
targets = "target1 target2"
reduceTestFeedback = AntBuildStep.TestPolicy.RECENTLY_FAILED_AND_MODIFIED
dockerImage = "myImage:2.4"
dockerImagePlatform = AntBuildStep.ImagePlatform.Linux
dockerPull = true
}
Content copied to clipboard }
}
See also
Constructors
Types
Docker image platforms
Tests reordering policy
Functions
Executes the ant script at the given path
Executes the ant script with the given content
Deletes all configured build step conditions
Configures build step conditions
Copies parameters of this object to the specified target
Creates an instance of this build step via reflection using a no argument constructor, used during copying. Throws an error if this class doesn't have a default constructor. Subclasses can override it to create an instance without using a default constructor.
Emma coverage engine Emma is out of date and it does not support Java 8. Consider using IntelliJ IDEA or JaCoCo coverage runners. Add a 'clean' target to your Ant build for this coverage runner to work.
Validates this object and reports found errors to the provided consumer
Properties
If enabled, "pull image" command will be run before docker run.
Build working directory for ant script, specify it if it is different from the checkout directory.