This repository has been archived by the owner on Nov 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
166 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
16
examples/JavaTypescriptWebapp/src/main/java/demo/EchoServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
16 changes: 16 additions & 0 deletions
16
...e-plugin/src/main/groovy/de/richsource/gradle/plugins/typescript/CompileTypeScript.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...cript-gradle-plugin/src/main/groovy/de/richsource/gradle/plugins/typescript/Module.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...cript-gradle-plugin/src/main/groovy/de/richsource/gradle/plugins/typescript/Target.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...le-plugin/src/main/groovy/de/richsource/gradle/plugins/typescript/TypescriptPlugin.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters