-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated
sample-maven
and sample-gradle
modules
- Loading branch information
1 parent
39f4b73
commit 370bb97
Showing
7 changed files
with
47 additions
and
55 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 |
---|---|---|
@@ -1,60 +1,56 @@ | ||
|
||
apply plugin: 'java' | ||
apply plugin: 'groovy' | ||
apply plugin: "kotlin" | ||
apply plugin: "scala" | ||
|
||
apply plugin: 'kotlin' | ||
apply plugin: 'scala' | ||
apply plugin: 'cz.habarta.typescript-generator' | ||
|
||
|
||
version = '1.0' | ||
sourceCompatibility = 1.7 | ||
targetCompatibility = 1.7 | ||
version = '2.0' | ||
sourceCompatibility = 1.8 | ||
targetCompatibility = 1.8 | ||
|
||
repositories { | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
compile group: 'com.fasterxml.jackson.jaxrs', name: 'jackson-jaxrs-json-provider', version: '2.6.3' | ||
compile 'org.codehaus.groovy:groovy-all:2.4.12' | ||
compile 'org.scala-lang:scala-library:2.11.8' | ||
compile 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.9.2' | ||
compile 'org.codehaus.groovy:groovy-all:2.4.13' | ||
compile 'org.scala-lang:scala-library:2.12.4' | ||
} | ||
|
||
buildscript { | ||
ext.kotlin_version = '1.2.10' | ||
|
||
repositories { | ||
mavenLocal() | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
classpath group: 'cz.habarta.typescript-generator', name: 'typescript-generator-gradle-plugin', version: '1.+' | ||
|
||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
classpath 'cz.habarta.typescript-generator:typescript-generator-gradle-plugin:2.+' | ||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.10' | ||
classpath 'com.fasterxml.jackson.module:jackson-module-scala_2.12:2.9.2' | ||
} | ||
} | ||
|
||
generateTypeScript { | ||
outputFile = 'build/sample.d.ts' | ||
classes = [ | ||
'cz.habarta.typescript.generator.sample.Person', | ||
'cz.habarta.typescript.generator.sample.PersonGroovy', | ||
'cz.habarta.typescript.generator.sample.PersonKt', | ||
'cz.habarta.typescript.generator.sample.PersonScala', | ||
] | ||
jsonLibrary = 'jackson2' | ||
outputKind = 'global' | ||
namespace = 'GradleSample' | ||
outputKind = 'module' | ||
excludeClasses = [ | ||
GroovyObject.name | ||
'groovy.lang.GroovyObject', | ||
'java.io.Serializable', | ||
'scala.Equals', | ||
'scala.Product', | ||
'scala.Serializable', | ||
] | ||
jackson2Modules = [ | ||
'com.fasterxml.jackson.module.scala.DefaultScalaModule' | ||
] | ||
// declarePropertiesAsOptional = false | ||
// removeTypeNameSuffix = 'Json' | ||
// mapDate = 'asNumber' | ||
} | ||
|
||
// Modify the gradle version here then execute ./gradlew wrapper to change the gradle version | ||
task wrapper(type: Wrapper) { | ||
gradleVersion = '4.4.1' | ||
} | ||
build.dependsOn generateTypeScript |
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
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
12 changes: 8 additions & 4 deletions
12
sample-gradle/src/main/scala/cz/habarta/typescript/generator/sample/PersonScala.scala
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,6 +1,10 @@ | ||
package cz.habarta.typescript.generator.sample; | ||
|
||
package cz.habarta.typescript.generator.sample; | ||
|
||
abstract class PersonScala { | ||
var name: String | ||
} | ||
case class PersonScala ( | ||
name: String, | ||
age: Int, | ||
hasChildren: Boolean, | ||
tags: java.util.List[String], | ||
emails: java.util.Map[String, String] | ||
) |
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