From 656689c576fb7e8ebd603939c476e3efc9cb0a8c Mon Sep 17 00:00:00 2001 From: Evgeny Goldin Date: Sat, 28 Jan 2012 03:22:43 +0200 Subject: [PATCH] Ant task - nested support --- build-tools/Wiki.txt | 36 +++++++++++++++++-- .../buildtools/ant/BytecodeCompilerTask.java | 10 ++++++ build-tools/build.xml | 20 ++++++++--- 3 files changed, 58 insertions(+), 8 deletions(-) diff --git a/build-tools/Wiki.txt b/build-tools/Wiki.txt index 407a7b4241c..39498050276 100644 --- a/build-tools/Wiki.txt +++ b/build-tools/Wiki.txt @@ -1,5 +1,5 @@ {toc:style=disc|indent=20px} -h1. Ant +h1. Ant - task To define an Ant's {{**}} task you need to define a {{*KOTLIN_HOME*}} environment variable and reference it in your Ant build: @@ -23,12 +23,16 @@ h2. {{**}} attributes | {align:center}{{*src*}}{align} | Kotlin source file or directory to compile | {{"src"}} or {{"module"}} needs to be specified |   | | {align:center}{{*module*}}{align} | Kotlin [module|http://confluence.jetbrains.net/display/Kotlin/Modules+and+Compilation] to compile | {{"src"}} or {{"module"}} needs to be specified |   | | {align:center}{{*output*}}{align} | Destination directory | If {{"src"}} is used - {{"output"}} or {{"jar"}} needs to be specified |   | -| {align:center}{{*jar*}}{align} | Destination jar file | If {{"src"}} is used - {{"output"}} or {{"jar"}} needs to be specified -If {{"module"}} is used - only {{"jar"}} can be specified or it can be omitted | {align:center}{{"moduleName.jar"}}{align} | +| {align:center}{{*jar*}}{align} | Destination jar file | If {{"src"}} is used - {{"output"}} or {{"jar"}} needs to be specified |   | +| {align:center}{{*classpath*}}{align} | Compilation class path | {align:center}{{false}}{align} |   | +| {align:center}{{*classpathref*}}{align} | Compilation class path reference | {align:center}{{false}}{align} |   | | {align:center}{{*stdlib*}}{align} | Path to {{"kotlin-runtime.jar"}} | {align:center}{{false}}{align} | {align:center}{{""}}{align} | | {align:center}{{*includeRuntime*}}{align} | If {{"jar"}} is used - whether Kotlin runtime library is included | {align:center}{{false}}{align} | {align:center}{{true}}{align} | +{{}} accepts a nested {{}} element, similarly to [{{}}|http://evgeny-goldin.org/javadoc/ant/Tasks/javac.html]. + + h2. Examples @@ -63,3 +67,29 @@ fun main(args: Array) { print("${args[0]}|${args[1]}|${args[2]}") } {code} + + +h3. Classpath examples + + +{code} + + + + + + + + + + + + + + + + + + + +{code} diff --git a/build-tools/ant/src/org/jetbrains/jet/buildtools/ant/BytecodeCompilerTask.java b/build-tools/ant/src/org/jetbrains/jet/buildtools/ant/BytecodeCompilerTask.java index e0c4ad04e91..160891d104a 100644 --- a/build-tools/ant/src/org/jetbrains/jet/buildtools/ant/BytecodeCompilerTask.java +++ b/build-tools/ant/src/org/jetbrains/jet/buildtools/ant/BytecodeCompilerTask.java @@ -63,6 +63,16 @@ public class BytecodeCompilerTask extends Task { } + /** + * Set the nested {@code } to be used for this compilation. + * + * @param classpath an Ant Path object containing the compilation classpath. + */ + public void addConfiguredClasspath( Path classpath ) { + setClasspath( classpath ); + } + + @Override public void execute() { diff --git a/build-tools/build.xml b/build-tools/build.xml index be2a96fa142..dff713e6a51 100644 --- a/build-tools/build.xml +++ b/build-tools/build.xml @@ -4,9 +4,11 @@ + + @@ -15,7 +17,7 @@ - + @@ -25,7 +27,7 @@ - + @@ -103,16 +105,24 @@ - + + + + + - + + + + + - +