DevCharly / kotlin-ant-dsl

Kotlin Ant DSL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Kotlin Ant DSL

License:Apache License 2.0


Languages

Language:Kotlin 100.0%Language:Shell 0.0%Language:Batchfile 0.0%