Skip to content

Commit 61cbbd4

Browse files
committed
First minimal port to Kotlin/JavaFX
1 parent 1cdde92 commit 61cbbd4

File tree

22 files changed

+963
-0
lines changed

22 files changed

+963
-0
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Gradle files
2+
.gradle/
3+
build/
4+
out/
5+
6+
# IntelliJ IDEA
7+
*.iml
8+
.idea/
9+
10+
# Debug
11+
/asfui.properties

build.gradle

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
apply plugin: 'kotlin'
2+
3+
group 'me.alvr'
4+
version '2.0.0-alpha1'
5+
6+
buildscript {
7+
ext.kotlin_version = '1.1.3-2'
8+
9+
repositories {
10+
mavenCentral()
11+
jcenter()
12+
}
13+
dependencies {
14+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15+
}
16+
}
17+
18+
repositories {
19+
mavenCentral()
20+
jcenter()
21+
}
22+
23+
dependencies {
24+
compile 'khttp:khttp:0.1.0'
25+
compile 'no.tornado:tornadofx:1.7.9'
26+
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
27+
compile 'org.zeroturnaround:zt-exec:1.10'
28+
}
29+
30+
compileKotlin {
31+
kotlinOptions.jvmTarget = "1.8"
32+
}
33+
34+
compileTestKotlin {
35+
kotlinOptions.jvmTarget = "1.8"
36+
}
37+
38+
jar {
39+
manifest {
40+
attributes 'Main-Class': 'me.alvr.asfui.MainKt'
41+
}
42+
43+
from {
44+
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
45+
}
46+
47+
destinationDir = file("$rootDir/out")
48+
}

gradle/wrapper/gradle-wrapper.jar

53.5 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Sat Aug 12 20:35:08 CEST 2017
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

gradlew

Lines changed: 172 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rootProject.name = 'asfui'
2+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package me.alvr.asfui
2+
3+
import javafx.scene.control.TextArea
4+
import org.zeroturnaround.exec.ProcessExecutor
5+
import org.zeroturnaround.exec.StartedProcess
6+
import org.zeroturnaround.exec.stream.LogOutputStream
7+
8+
object ASFProcess {
9+
private lateinit var process: StartedProcess
10+
var started = false
11+
12+
fun start(output: TextArea) {
13+
if (!started) {
14+
process = ProcessExecutor()
15+
.command(Configuration.getPropertyString(Configuration.BINARY, Configuration.BINARY_DEFAULT), "--server")
16+
.redirectOutput(object : LogOutputStream() {
17+
override fun processLine(line: String?) {
18+
output.appendText("$line\n")
19+
}
20+
})
21+
.destroyOnExit()
22+
.start()
23+
started = true
24+
}
25+
}
26+
27+
fun stop() {
28+
if (started) {
29+
started = false
30+
process.process.destroy()
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)