Skip to content
This repository was archived by the owner on Jun 27, 2020. It is now read-only.

Commit af59736

Browse files
author
Sergey Mashkov
committed
Upgrade to Kotlin 1.1 and latest plugin
1 parent 568610b commit af59736

File tree

7 files changed

+18
-26
lines changed

7 files changed

+18
-26
lines changed

full-stack-example/frontend/src/main/kotlin/test/hello/LinesView.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class LinesView(val linesHolder: Element, val formRoot: Element) {
3434

3535
fun addLine(lineText: String) {
3636
document.createElement("p").apply {
37-
textContent = " - " + lineText
37+
textContent = " + " + lineText
3838

3939
linesHolder.appendChild(this)
4040
}
@@ -57,4 +57,4 @@ class LinesView(val linesHolder: Element, val formRoot: Element) {
5757
addButton.removeEventListener("click", buttonHandler)
5858
input.removeEventListener("keypress", inputHandler)
5959
}
60-
}
60+
}

full-stack-example/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#org.gradle.jvmargs=-XX:+UnlockCommercialFeatures -XX:+FlightRecorder
2-
#org.gradle.debug=true
2+
org.gradle.debug=true

test/build.gradle

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,36 @@
11
buildscript {
2-
ext.kotlin_version = '1.1.0-dev-5520'
3-
// ext.kotlin_version = '1.1-SNAPSHOT'
2+
ext.kotlin_version = '1.1.0'
43

54
repositories {
65
jcenter()
7-
mavenLocal()
8-
maven {
9-
url "https://dl.bintray.com/kotlin/kotlin-dev"
10-
}
11-
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
6+
maven { url 'https://jitpack.io' }
127
}
138

149
dependencies {
1510
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
16-
classpath "org.jetbrains.kotlin:kotlin-frontend:0.0.1-SNAPSHOT"
11+
// classpath "org.jetbrains.kotlin:kotlin-frontend:0.0.1-SNAPSHOT"
12+
classpath "com.github.cy6erGn0m:kotlin-frontend-plugin:568610baa1"
1713
}
1814
}
1915

2016
group = 'org.jetbrains.kotlin'
2117
version = '0.0.1-SNAPSHOT'
2218

19+
apply plugin: 'kotlin2js'
2320
apply plugin: 'org.jetbrains.kotlin.frontend'
2421

2522
repositories {
2623
jcenter()
27-
maven {
28-
url "https://dl.bintray.com/kotlin/kotlin-dev"
29-
}
30-
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
3124
}
3225

3326
dependencies {
34-
compile "org.jetbrains.kotlin:kotlin-js-library:$kotlin_version"
27+
compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
28+
compile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version" // for now only compile configuration is supported
3529
}
3630

3731
kotlinFrontend {
3832
npm {
39-
//dependency("kotlin", "1.1.0-dev-4546")
33+
// dependency("kotlin", "1.1.0")
4034
dependency "style-loader"
4135

4236
devDependency("karma")
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package test.hello
22

3-
@native val module: Module
3+
external val module: Module
44

5-
@native interface Module {
5+
external interface Module {
66
val hot: Hot?
77
}
88

9-
@native interface Hot {
9+
external interface Hot {
1010
val data: dynamic
1111

1212
fun accept()
@@ -16,5 +16,4 @@ package test.hello
1616
fun dispose(callback: (data: dynamic) -> Unit)
1717
}
1818

19-
@native
20-
fun require(name: String): dynamic
19+
external fun require(name: String): dynamic

test/src/main/kotlin/test/hello/WebLinesView.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.w3c.dom.events.*
55
import kotlin.browser.*
66
import kotlin.dom.*
77

8-
class WebLinesView(val linesHolder: Element, val formRoot: Element) : LinesView {
8+
class WebLinesView(val linesHolder: Element, formRoot: Element) : LinesView {
99
lateinit override var presenter: LinesPresenter
1010

1111
@Suppress("UNCHECKED_CAST_TO_NATIVE_INTERFACE")
@@ -14,7 +14,7 @@ class WebLinesView(val linesHolder: Element, val formRoot: Element) : LinesView
1414
@Suppress("UNCHECKED_CAST_TO_NATIVE_INTERFACE")
1515
private val addButton = formRoot.querySelector("button") as HTMLButtonElement
1616

17-
private val buttonHandler: (Event) -> Unit = { e ->
17+
private val buttonHandler: (Event) -> Unit = {
1818
presenter.addButtonClicked()
1919
}
2020

test/src/main/kotlin/test/hello/main.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fun main(args: Array<String>) {
2121
application = start(state)
2222
} else {
2323
application = null
24-
document.addEventListener("DOMContentLoaded", { e -> application = start(state) })
24+
document.addEventListener("DOMContentLoaded", { application = start(state) })
2525
}
2626
}
2727

test/src/test/kotlin/test/TestLinesPresenter.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package test
22

33
import org.junit.*
44
import test.hello.*
5-
import java.util.*
65
import kotlin.test.*
76

87
class TestLinesPresenter {

0 commit comments

Comments
 (0)