Skip to content

Commit

Permalink
Update to Kotlin 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ntrrgc committed Mar 6, 2017
1 parent 33388fa commit 89cb3f4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ ts-generator supports:

## Installation

ts-generator requires Kotlin 1.1, which is EAP at time of writing. This library has been tested with 1.1-M04.

Kotlin 1.0 is not compatible as its reflection library is not powerful enough to do this transformation.

See [this post](https://blog.jetbrains.com/kotlin/2016/12/kotlin-1-1-m04-is-here/) to see how install Kotlin 1.1 EAP.
ts-generator requires Kotlin 1.1. Kotlin 1.0 is not compatible as its reflection library is not powerful enough to do this transformation.

Then you need to include this library in your project. The easiest way is to [download it from JitPack](https://jitpack.io/#ntrrgc/ts-generator). For instance, in Gradle you would add this to `build.gradle`:

Expand All @@ -40,7 +36,7 @@ repositories {
}
dependencies {
compile 'com.github.ntrrgc:ts-generator:1.0.0-pre1'
compile 'com.github.ntrrgc:ts-generator:1.0.0'
}
```

Expand Down
6 changes: 2 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@
*/

group 'me.ntrrgc'
version '1.0.0-pre1'
version '1.0.0'

buildscript {
ext.kotlin_version = '1.1-M04'
ext.kotlin_version = '1.1.0'

repositories {
maven { url 'http://dl.bintray.com/kotlin/kotlin-eap-1.1' }
mavenCentral()
}
dependencies {
Expand All @@ -43,7 +42,6 @@ junitPlatform {
apply plugin: 'kotlin'

repositories {
maven { url 'http://dl.bintray.com/kotlin/kotlin-eap-1.1' }
maven { url "https://dl.bintray.com/jetbrains/spek" }
mavenCentral()
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/me/ntrrgc/tsGenerator/KClassComparator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package me.ntrrgc.tsGenerator

import kotlin.reflect.KClass
import kotlin.reflect.isSubclassOf
import kotlin.reflect.full.isSubclassOf

/**
* Used to sort classes so that more specific instances are
Expand Down
3 changes: 3 additions & 0 deletions src/main/kotlin/me/ntrrgc/tsGenerator/TypeScriptGenerator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import java.beans.Introspector
import java.lang.reflect.ParameterizedType
import java.lang.reflect.Type
import kotlin.reflect.*
import kotlin.reflect.full.createType
import kotlin.reflect.full.isSubclassOf
import kotlin.reflect.full.superclasses
import kotlin.reflect.jvm.javaType

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package me.ntrrgc.tsGenerator

import kotlin.reflect.KClass
import kotlin.reflect.isSubclassOf
import kotlin.reflect.full.isSubclassOf

fun ClassTransformer.onlyOnSubclassesOf(klass: KClass<*>): FilteredClassTransformer {
return FilteredClassTransformer(this, { it.isSubclassOf(klass) })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ import org.jetbrains.spek.api.Spek
import org.jetbrains.spek.api.dsl.it
import java.beans.Introspector
import java.util.*
import kotlin.reflect.*
import kotlin.reflect.KClass
import kotlin.reflect.KProperty
import kotlin.reflect.KType
import kotlin.reflect.full.createType
import kotlin.reflect.full.withNullability
import kotlin.reflect.jvm.kotlinFunction

fun assertGeneratedCode(klass: KClass<*>,
Expand Down

0 comments on commit 89cb3f4

Please sign in to comment.