Skip to content

Commit 8ad4d61

Browse files
added Gradle plugin description
1 parent afd593c commit 8ad4d61

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

README.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ Supported types include:
3434
- array
3535
- `List` and `Map` (including derived interfaces and implementation classes)
3636

37-
Primarily typescript-generator is used as Maven plugin:
37+
38+
Maven
39+
-----
40+
41+
In Maven build you can use `typescript-generator-maven-plugin` like this:
3842
``` xml
3943
<plugin>
4044
<groupId>cz.habarta.typescript-generator</groupId>
@@ -58,8 +62,44 @@ Primarily typescript-generator is used as Maven plugin:
5862
</plugin>
5963
```
6064

65+
More complete sample can be found [here](sample-maven).
6166
Detailed description how to configure typescript-generator-maven-plugin is on generated [site](http://vojtechhabarta.github.io/typescript-generator/maven/typescript-generator-maven-plugin/generate-mojo.html).
6267

63-
If you do not use Maven you can invoke typescript-generator directly using `TypeScriptGenerator.generateTypeScript()` method.
68+
69+
Gradle
70+
------
71+
72+
In Gradle build you can use `cz.habarta.typescript-generator` plugin like this:
73+
```groovy
74+
apply plugin: 'cz.habarta.typescript-generator'
75+
buildscript {
76+
repositories {
77+
mavenCentral()
78+
}
79+
dependencies {
80+
classpath group: 'cz.habarta.typescript-generator', name: 'typescript-generator-gradle-plugin', version: '1.2.x'
81+
}
82+
}
83+
generateTypeScript {
84+
outputFile = 'build/sample.d.ts'
85+
classes = [
86+
'cz.habarta.typescript.generator.sample.Person'
87+
]
88+
jsonLibrary = 'jackson2'
89+
namespace = 'Rest';
90+
// module = 'my-module'
91+
// declarePropertiesAsOptional = false
92+
// removeTypeNameSuffix = 'Json'
93+
// mapDate = 'asNumber'
94+
}
95+
```
96+
97+
More complete sample can be found [here](sample-gradle).
98+
Gradle plugin has the same features as Maven plugin, for detailed description see Maven generated [site](http://vojtechhabarta.github.io/typescript-generator/maven/typescript-generator-maven-plugin/generate-mojo.html).
99+
100+
101+
Direct invocation
102+
-----------------
103+
If you do not use Maven or Gradle you can invoke typescript-generator directly using `TypeScriptGenerator.generateTypeScript()` method.
64104

65105
Releases are available from [Maven Central Repository](http://search.maven.org/#search%7Cga%7C1%7Ccz.habarta.typescript-generator).

0 commit comments

Comments
 (0)