mirror of
https://github.com/irmen/prog8.git
synced 2024-10-16 18:23:59 +00:00
project restructure
This commit is contained in:
parent
f2380457d6
commit
d37d62574c
@ -1,7 +1,7 @@
|
|||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="dbus-java-3.2.4">
|
<library name="dbus-java-3.2.4">
|
||||||
<CLASSES>
|
<CLASSES>
|
||||||
<root url="jar://$PROJECT_DIR$/compiler/lib/dbus-java-3.2.4.jar!/" />
|
<root url="jar://$PROJECT_DIR$/dbusCompilerService/lib/dbus-java-3.2.4.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
<component name="ProjectModuleManager">
|
<component name="ProjectModuleManager">
|
||||||
<modules>
|
<modules>
|
||||||
<module fileurl="file://$PROJECT_DIR$/compiler/compiler.iml" filepath="$PROJECT_DIR$/compiler/compiler.iml" />
|
<module fileurl="file://$PROJECT_DIR$/compiler/compiler.iml" filepath="$PROJECT_DIR$/compiler/compiler.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/dbusCompilerService/dbusCompilerService.iml" filepath="$PROJECT_DIR$/dbusCompilerService/dbusCompilerService.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/docs/docs.iml" filepath="$PROJECT_DIR$/docs/docs.iml" />
|
<module fileurl="file://$PROJECT_DIR$/docs/docs.iml" filepath="$PROJECT_DIR$/docs/docs.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/examples/examples.iml" filepath="$PROJECT_DIR$/examples/examples.iml" />
|
<module fileurl="file://$PROJECT_DIR$/examples/examples.iml" filepath="$PROJECT_DIR$/examples/examples.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/parser/parser.iml" filepath="$PROJECT_DIR$/parser/parser.iml" />
|
<module fileurl="file://$PROJECT_DIR$/parser/parser.iml" filepath="$PROJECT_DIR$/parser/parser.iml" />
|
||||||
|
@ -1,20 +1,11 @@
|
|||||||
buildscript {
|
|
||||||
dependencies {
|
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
// id "org.jetbrains.kotlin.jvm" version "1.4.21"
|
id 'java'
|
||||||
id 'application'
|
id 'application'
|
||||||
|
id "org.jetbrains.kotlin.jvm" version "1.4.21"
|
||||||
id 'org.jetbrains.dokka' version "0.9.18"
|
id 'org.jetbrains.dokka' version "0.9.18"
|
||||||
id 'com.github.johnrengelman.shadow' version '5.2.0'
|
id 'com.github.johnrengelman.shadow' version '5.2.0'
|
||||||
id 'java'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: "kotlin"
|
|
||||||
apply plugin: "java"
|
|
||||||
|
|
||||||
targetCompatibility = 11
|
targetCompatibility = 11
|
||||||
sourceCompatibility = 11
|
sourceCompatibility = 11
|
||||||
|
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
package prog8.server.dbus
|
|
||||||
|
|
||||||
//import org.freedesktop.dbus.interfaces.DBusInterface
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//interface IrmenDbusTest: DBusInterface
|
|
||||||
//{
|
|
||||||
// fun Status(address: String): Map<Int, String>
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//internal class TestService: IrmenDbusTest {
|
|
||||||
// override fun Status(address: String): Map<Int, String> {
|
|
||||||
// return mapOf(
|
|
||||||
// 5 to "hello",
|
|
||||||
// 42 to address
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// override fun isRemote() = true
|
|
||||||
// override fun getObjectPath() = "/razorvine/TestService"
|
|
||||||
//}
|
|
@ -1,17 +0,0 @@
|
|||||||
package prog8.server.dbus
|
|
||||||
|
|
||||||
|
|
||||||
//import org.freedesktop.dbus.connections.impl.DBusConnection
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//fun main() {
|
|
||||||
// DBusConnection.getConnection(DBusConnection.DBusBusType.SESSION).use {
|
|
||||||
// println(it.names.toList())
|
|
||||||
// println(it.uniqueName)
|
|
||||||
// println(it.address)
|
|
||||||
// println(it.machineId)
|
|
||||||
// val obj = it.getRemoteObject("local.net.razorvine.dbus.test", "/razorvine/TestService", IrmenDbusTest::class.java)
|
|
||||||
// println(obj.Status("irmen"))
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
@ -1,18 +0,0 @@
|
|||||||
package prog8.server.dbus
|
|
||||||
|
|
||||||
//import org.freedesktop.dbus.connections.impl.DBusConnection
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//fun main() {
|
|
||||||
// DBusConnection.getConnection(DBusConnection.DBusBusType.SESSION).use {
|
|
||||||
// it.requestBusName("local.net.razorvine.dbus.test")
|
|
||||||
// println(it.names.toList())
|
|
||||||
// println(it.uniqueName)
|
|
||||||
// println(it.address)
|
|
||||||
// println(it.machineId)
|
|
||||||
// val service = TestService()
|
|
||||||
// it.exportObject(service.objectPath, service)
|
|
||||||
//
|
|
||||||
// Thread.sleep(100000)
|
|
||||||
// }
|
|
||||||
//}
|
|
95
dbusCompilerService/build.gradle
Normal file
95
dbusCompilerService/build.gradle
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
|
||||||
|
plugins {
|
||||||
|
id 'java'
|
||||||
|
id 'application'
|
||||||
|
id "org.jetbrains.kotlin.jvm" version "1.4.21"
|
||||||
|
id 'com.github.johnrengelman.shadow' version '5.2.0'
|
||||||
|
}
|
||||||
|
|
||||||
|
targetCompatibility = 11
|
||||||
|
sourceCompatibility = 11
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
maven { url "https://kotlin.bintray.com/kotlinx" }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||||
|
// implementation "org.jetbrains.kotlin:kotlin-reflect"
|
||||||
|
implementation 'org.jetbrains.kotlinx:kotlinx-cli:0.3.1'
|
||||||
|
implementation "com.github.hypfvieh:dbus-java:3.2.4"
|
||||||
|
implementation "org.slf4j:slf4j-simple:1.7.30"
|
||||||
|
|
||||||
|
testImplementation "org.jetbrains.kotlin:kotlin-test-junit5"
|
||||||
|
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.2'
|
||||||
|
testImplementation 'org.hamcrest:hamcrest-junit:2.0.0.0'
|
||||||
|
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.2'
|
||||||
|
}
|
||||||
|
|
||||||
|
compileKotlin {
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "11"
|
||||||
|
// verbose = true
|
||||||
|
// freeCompilerArgs += "-XXLanguage:+NewInference"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileTestKotlin {
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "11"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
srcDirs = ["${project.projectDir}/src"]
|
||||||
|
}
|
||||||
|
resources {
|
||||||
|
srcDirs = ["${project.projectDir}/res"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
test {
|
||||||
|
java {
|
||||||
|
srcDirs = ["${project.projectDir}/test"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
startScripts.enabled = false
|
||||||
|
|
||||||
|
application {
|
||||||
|
mainClassName = 'prog8.dbus.TestdbusKt'
|
||||||
|
applicationName = 'testdbus'
|
||||||
|
}
|
||||||
|
|
||||||
|
artifacts {
|
||||||
|
archives shadowJar
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
shadowJar {
|
||||||
|
archiveBaseName = 'prog8compilerservice'
|
||||||
|
archiveVersion = '1.0'
|
||||||
|
// minimize()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
test {
|
||||||
|
// Enable JUnit 5 (Gradle 4.6+).
|
||||||
|
useJUnitPlatform()
|
||||||
|
|
||||||
|
// Always run tests, even when nothing changed.
|
||||||
|
dependsOn 'cleanTest'
|
||||||
|
|
||||||
|
// Show test results.
|
||||||
|
testLogging {
|
||||||
|
events "skipped", "failed"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task wrapper(type: Wrapper) {
|
||||||
|
gradleVersion = '6.1.1'
|
||||||
|
}
|
14
dbusCompilerService/dbusCompilerService.iml
Normal file
14
dbusCompilerService/dbusCompilerService.iml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$/../dbusCompilerService">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/../dbusCompilerService/src" isTestSource="false" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="jdk" jdkName="11" jdkType="JavaSDK" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
||||||
|
<orderEntry type="library" name="kotlinx-cli-jvm" level="project" />
|
||||||
|
<orderEntry type="library" name="dbus-java-3.2.4" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
22
dbusCompilerService/src/prog8/dbus/IrmenDbusTest.kt
Normal file
22
dbusCompilerService/src/prog8/dbus/IrmenDbusTest.kt
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package prog8.dbus
|
||||||
|
|
||||||
|
import org.freedesktop.dbus.interfaces.DBusInterface
|
||||||
|
|
||||||
|
|
||||||
|
interface IrmenDbusTest: DBusInterface
|
||||||
|
{
|
||||||
|
fun Status(address: String): Map<Int, String>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
internal class TestService: IrmenDbusTest {
|
||||||
|
override fun Status(address: String): Map<Int, String> {
|
||||||
|
return mapOf(
|
||||||
|
5 to "hello",
|
||||||
|
42 to address
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun isRemote() = true
|
||||||
|
override fun getObjectPath() = "/razorvine/TestService"
|
||||||
|
}
|
17
dbusCompilerService/src/prog8/dbus/clientmain.kt
Normal file
17
dbusCompilerService/src/prog8/dbus/clientmain.kt
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
package prog8.dbus
|
||||||
|
|
||||||
|
|
||||||
|
import org.freedesktop.dbus.connections.impl.DBusConnection
|
||||||
|
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
DBusConnection.getConnection(DBusConnection.DBusBusType.SESSION).use {
|
||||||
|
println(it.names.toList())
|
||||||
|
println(it.uniqueName)
|
||||||
|
println(it.address)
|
||||||
|
println(it.machineId)
|
||||||
|
val obj = it.getRemoteObject("local.net.razorvine.dbus.test", "/razorvine/TestService", IrmenDbusTest::class.java)
|
||||||
|
println(obj.Status("irmen"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
18
dbusCompilerService/src/prog8/dbus/testdbus.kt
Normal file
18
dbusCompilerService/src/prog8/dbus/testdbus.kt
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package prog8.dbus
|
||||||
|
|
||||||
|
import org.freedesktop.dbus.connections.impl.DBusConnection
|
||||||
|
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
DBusConnection.getConnection(DBusConnection.DBusBusType.SESSION).use {
|
||||||
|
it.requestBusName("local.net.razorvine.dbus.test")
|
||||||
|
println(it.names.toList())
|
||||||
|
println(it.uniqueName)
|
||||||
|
println(it.address)
|
||||||
|
println(it.machineId)
|
||||||
|
val service = TestService()
|
||||||
|
it.exportObject(service.objectPath, service)
|
||||||
|
|
||||||
|
Thread.sleep(100000)
|
||||||
|
}
|
||||||
|
}
|
@ -1,2 +1,3 @@
|
|||||||
include ':parser'
|
include ':parser'
|
||||||
include ':compiler'
|
include ':compiler'
|
||||||
|
include ':dbusCompilerService'
|
||||||
|
Loading…
Reference in New Issue
Block a user