mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Update Kotlin example
This commit is contained in:
parent
b0e9f6f7a5
commit
4a49b9464b
|
@ -30,7 +30,7 @@
|
||||||
<description>A sample application written in Kotlin and compiled by TeaVM</description>
|
<description>A sample application written in Kotlin and compiled by TeaVM</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<kotlin.version>0.11.91.1</kotlin.version>
|
<kotlin.version>1.0.1-2</kotlin.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
|
@ -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!");
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -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!") }
|
||||||
|
}
|
|
@ -22,8 +22,8 @@
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<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-stdlib:1.0.1-2" 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-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: junit:junit:4.11" level="project" />
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" 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" />
|
<orderEntry type="module" module-name="teavm-classlib" scope="PROVIDED" />
|
||||||
|
|
Loading…
Reference in New Issue
Block a user