Update Kotlin example

This commit is contained in:
Alexey Andreev 2016-04-12 22:01:22 +03:00
parent b0e9f6f7a5
commit 4a49b9464b
4 changed files with 27 additions and 17 deletions

View File

@ -30,7 +30,7 @@
<description>A sample application written in Kotlin and compiled by TeaVM</description>
<properties>
<kotlin.version>0.11.91.1</kotlin.version>
<kotlin.version>1.0.1-2</kotlin.version>
</properties>
<dependencies>

View File

@ -1,14 +0,0 @@
package org.teavm.samples.kotlin
import org.teavm.jso.*
import org.teavm.jso.browser.*
import org.teavm.jso.dom.html.*
import org.teavm.jso.dom.events.*
fun main(args : Array<String>) {
var document = Window.current().getDocument();
document.getElementById("hello-kotlin").addEventListener("click", EventListener<MouseEvent>() {
Window.alert("Hello, developer!");
})
}

View File

@ -0,0 +1,24 @@
/*
* Copyright 2016 Alexey Andreev.
*
* 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.
*/
package org.teavm.samples.kotlin
import org.teavm.jso.browser.*
fun main(args : Array<String>) {
val document = Window.current().document;
document.getElementById("hello-kotlin").addEventListener("click") { Window.alert("Hello, developer!") }
}

View File

@ -22,8 +22,8 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jetbrains.kotlin:kotlin-stdlib:0.11.91.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jetbrains.kotlin:kotlin-runtime:0.11.91.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jetbrains.kotlin:kotlin-stdlib:1.0.1-2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jetbrains.kotlin:kotlin-runtime:1.0.1-2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.11" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="module" module-name="teavm-classlib" scope="PROVIDED" />