Typescript compiler

Description

Task to process tsc, the typescript compiler (see: typescriptlang.org).

Installation

Please install:
$ npm install -g typescript

Typescript task parameters

Attribute Description Value Required
file typescript file yes, if no fileset
fileset typescript input files yes, if no file
tofile output javascript file <filename>.js by default no
module associated modules commonjs by default no
target javascript target es5 by default no
outputproperty name of choice to log out the outut of the command none by default no
noEmitOnError true|false to prevent the the creation of .js file in case of compile errors false by default no

Examples

/!\ tsc must be installed on the system and set up in the PATH.

<project name="tsc task"> 

  <taskdef name="tsc" 
     classname="net.sourceforge.ant4x.taskdefs.javascript.TscTask" 
     classpath="PATH/TO/ant4x.jar"/> 

  <target name="tsc"> 
  <tsc file="typescript.ts" tofile="out/typescript.js" noEmitOnError="true" outputproperty="outputproperty"/>
  </target>
                    </project>