Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Latest commit

 

History

History
138 lines (104 loc) · 4.97 KB

README.md

File metadata and controls

138 lines (104 loc) · 4.97 KB

Kotlin Ant DSL

Build Status Download

Kotlin Ant DSL allows using Ant tasks from Kotlin.

Ant {
    echo("Hello World")
    mkdir("dir1")
    copy(todir = "dir1") {
        fileset(dir = "dir2")
            include(name = "**/*.txt")
        }
    }
}

Examples

Define a function to use a custom Ant task:

fun Ant.myanttask(attr1: String, attr2: String) {
    MyAntTask().execute("myanttask") { task ->
        task.setAttr1(attr1)
        task.setAttr2(attr2)
    }
}

Execute custom Ant Task:

Ant {
    myanttask("value1", "value2")
}

Supported Ant features

Tasks

Types

Converter

The Converter converts Ant XML files to Kotlin Ant DSL. Note that Kotlin Ant DSL does not support some Ant tags (e.g. <project> and <target>). So you can not compile/run the output, but you can copy the parts that you need. The primary goal is support migration of Ant builds to Kotlin based build systems (e.g. Kobalt)

Generator

The Kotlin code for the Ant tasks DSL is generated. See generator. If you miss some tasks, you can add them to generator/Main.kt and use ./kobaltw generator:run to generate the DSL. Then use ./kobaltw assemble to compile the DSL.

Who uses Kotlin Ant DSL?

Download

Download

For Maven, Gradle or Kobalt use:

Repository: jcenter (or https://dl.bintray.com/devcharly/maven/) 
Group:      com.devcharly
Artifact:   kotlin-ant-dsl
Version:    (latest)

Requirements

Ant 1.9.7 or later