Skip to content
TypeScript support for Gradle
Java Groovy TypeScript
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
src
.editorconfig
.gitignore
.travis.yml
LICENSE.txt
README.md
build.gradle
gradlew
gradlew.bat

README.md

Gradle TypeScript Plugin

TypeScript support for Gradle.

Build Status

Gradle 2.0 required. With earlier versions you will get an error that org.gradle.runtime.base.BinaryContainer is missing.

The plugin automatically configures the following things:

  • adds src/main/ts as the default TypeScript source folder
  • configures a compile task to compile TypeScript sources to build/compiled-typescript/output.js

How to release

  1. Run: ./gradlew clean uploadArchives -Prelease -Psonatype
  2. Open: https://oss.sonatype.org/#stagingRepositories
  3. Find the comprezi staging repo, close it and release it.

Tasks

TypeScriptCompile

task compileTypeScript(type: com.prezi.typescript.gradle.TypeScriptCompile) {
	// prepends the given javascript file() to the beginning of the output
	prependJs "<jsfile>"

	// appends the given javascript file() to the end of the output
	appendJs "<jsfile>"

	// source files to compile
	source "<sources>"

	// output file
	outputFile "<jsfile>"

	// invokes the '--noImplicitAny' option (false by default)
	strict false

	// does not remove comments (false by default)
	enableComments false

	// ECMAScript target version: ES3 or ES5 (default)
	target "ES5"

	// add additional flags
	flag "--sourceRoot", "sources/something"
}

Configurations

You can add dependencies (like d.ts files) to the build path using these pre-defined configurations:

  • compile
  • testCompile (extends compile)

For example:

dependencies {
	testCompile "typescript:mocha:1.17.1"
}
You can’t perform that action at this time.