Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Commit

Permalink
Readme and License added
Browse files Browse the repository at this point in the history
  • Loading branch information
sothmann committed Jan 28, 2014
1 parent 407320e commit c74d50f
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 0 deletions.
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright (C) 2014 S�nke Sothmann

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# TypeScript Gradle Plugin

This plugin makes it easy to build TypeScript projects using Gradle.
Among other things, the plugin provides a task to run the TypeScript compiler.

# Examples

Several example projects can be found in [/examples](examples).

# Quickstart

This will guide you through the steps needed to set up typescript-gradle-plugin for a TypeScript application project using Maven/Gradle standard layout.

## Plugin dependency

As this is not a core Gradle plugin, you have to ensure, that Gradle knows how to get the plugin. Do do this, add the following lines to your build.gradle:

buildscript {
repositories {
maven {
url 'https://github.com/sothmann/typescript-gradle-plugin/repo/'
}
mavenCentral()
}
dependencies {
classpath 'de.richsource.gradle.plugins:typescript-gradle-plugin:0.1'
}
}

Next, apply the plugin.

apply plugin: "typescript"

## Configuring the TypeScript compile task

You can configure the TypeScript compile task as shown below:

compileTypeScript {
declaration = true
// additional configuration options
}

# Available configuration options for the compileTypeScript task

source - required, (Set<File>) a set of files or directories to compile
outputDir - optional, (File) the output directory
out - (optional), (File) Concatenate and emit output to single file
module - (optional), (de.richsource.gradle.plugins.typescript.Module) Specify module code generation (AMD or COMMONJS)
target - (optional), (de.richsource.gradle.plugins.typescript.Target) Specify ECMAScript target version (ES3 or ES5)
declaration - (optional), (boolean) Generates corresponding .d.ts file
noImplicitAny - (optional), (boolean) Warn on expressions and declarations with an implied 'any' type
noResolve - (optional), (boolean) Skip resolution and preprocessing
removeComments - (optional), (boolean) Do not emit comments to output
sourcemap - (optional), (boolean) Generates corresponding .map file
sourceRoot - (optional), (File) Specifies the location where debugger should locate TypeScript files instead of source locations
codepage - (optional), (Integer) Specify the codepage to use when opening source files
mapRoot - (optional), (File) Specifies the location where debugger should locate map files instead of generated locations
16 changes: 16 additions & 0 deletions examples/JavaTypescriptWebapp/src/main/java/demo/EchoServlet.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/**
* Copyright (C) 2014 Sönke Sothmann
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package demo;

import java.io.IOException;
Expand Down
16 changes: 16 additions & 0 deletions examples/JavaTypescriptWebapp/src/main/ts/demo.ts
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
/**
* Copyright (C) 2014 Sönke Sothmann
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

console.log("Hello World");
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/**
* Copyright (C) 2014 Sönke Sothmann
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.richsource.gradle.plugins.typescript;

import org.gradle.api.DefaultTask
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/**
* Copyright (C) 2014 Sönke Sothmann
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.richsource.gradle.plugins.typescript

enum Module {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/**
* Copyright (C) 2014 Sönke Sothmann
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.richsource.gradle.plugins.typescript

enum Target {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/**
* Copyright (C) 2014 Sönke Sothmann
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.richsource.gradle.plugins.typescript

import org.gradle.api.Plugin
Expand Down

0 comments on commit c74d50f

Please sign in to comment.