diff --git a/core/build.gradle b/core/build.gradle index 7cda07b..c7bda49 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -3,34 +3,33 @@ plugins { } apply from: '../buildtools/ColoredOutput.gradle' apply from: '../buildtools/jacoco.gradle' -apply plugin: 'java-library' -apply plugin: 'kotlin' +apply plugin: 'kotlin-multiplatform' apply plugin: 'maven-publish' +kotlin { + jvm { -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" + } + sourceSets { + commonMain { - implementation project(path: ':etch') -} + } + commonTest { + dependencies { + implementation 'junit:junit:4.12' + } + } + jvmMain { + dependencies { + implementation project(path: ':etch') + } + } + } +} sourceCompatibility = "1.8" targetCompatibility = "1.8" -// https://youtrack.jetbrains.com/issue/IDEA-119280 -tasks.register('copyTestResources', Copy) { - from "${projectDir}/src/test/resources" - into "${buildDir}/classes/test" -} -tasks.register('copyTestResourcesOut', Copy) { - from "${projectDir}/src/test/resources" - into "${buildDir}/../out/test/classes" -} -// doesn't seem to actually work, you should run this step manually -processTestResources.dependsOn copyTestResources -processTestResources.dependsOn copyTestResourcesOut - publishing { publications { maven(MavenPublication) { @@ -38,8 +37,6 @@ publishing { groupId 'io.bimmergestalt' artifactId 'IDriveConnectKit' version '0.6' - - from components.java } } } diff --git a/core/src/main/java/io/bimmergestalt/idriveconnectkit/CDSProperty.kt b/core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/CDSProperty.kt similarity index 100% rename from core/src/main/java/io/bimmergestalt/idriveconnectkit/CDSProperty.kt rename to core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/CDSProperty.kt diff --git a/core/src/main/java/io/bimmergestalt/idriveconnectkit/RHMIDimensions.kt b/core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/RHMIDimensions.kt similarity index 100% rename from core/src/main/java/io/bimmergestalt/idriveconnectkit/RHMIDimensions.kt rename to core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/RHMIDimensions.kt diff --git a/core/src/main/java/io/bimmergestalt/idriveconnectkit/Utils.kt b/core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/Utils.kt similarity index 100% rename from core/src/main/java/io/bimmergestalt/idriveconnectkit/Utils.kt rename to core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/Utils.kt diff --git a/core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIAction.kt b/core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIAction.kt similarity index 100% rename from core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIAction.kt rename to core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIAction.kt diff --git a/core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIActionCallbacks.kt b/core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIActionCallbacks.kt similarity index 100% rename from core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIActionCallbacks.kt rename to core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIActionCallbacks.kt diff --git a/core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIApplication.kt b/core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIApplication.kt similarity index 100% rename from core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIApplication.kt rename to core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIApplication.kt diff --git a/core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIApplicationWrappers.kt b/core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIApplicationWrappers.kt similarity index 100% rename from core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIApplicationWrappers.kt rename to core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIApplicationWrappers.kt diff --git a/core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIComponent.kt b/core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIComponent.kt similarity index 100% rename from core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIComponent.kt rename to core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIComponent.kt diff --git a/core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIEvent.kt b/core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIEvent.kt similarity index 100% rename from core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIEvent.kt rename to core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIEvent.kt diff --git a/core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIEventCallbacks.kt b/core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIEventCallbacks.kt similarity index 100% rename from core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIEventCallbacks.kt rename to core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIEventCallbacks.kt diff --git a/core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIModel.kt b/core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIModel.kt similarity index 100% rename from core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIModel.kt rename to core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIModel.kt diff --git a/core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIProperty.kt b/core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIProperty.kt similarity index 100% rename from core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIProperty.kt rename to core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIProperty.kt diff --git a/core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIState.kt b/core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIState.kt similarity index 100% rename from core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/RHMIState.kt rename to core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/RHMIState.kt diff --git a/core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/mocking/MockApplication.kt b/core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/mocking/MockApplication.kt similarity index 100% rename from core/src/main/java/io/bimmergestalt/idriveconnectkit/rhmi/mocking/MockApplication.kt rename to core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/rhmi/mocking/MockApplication.kt diff --git a/core/src/main/java/io/bimmergestalt/idriveconnectkit/xmlutils/XMLUtils.kt b/core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/xmlutils/XMLUtils.kt similarity index 100% rename from core/src/main/java/io/bimmergestalt/idriveconnectkit/xmlutils/XMLUtils.kt rename to core/src/commonMain/kotlin/io/bimmergestalt/idriveconnectkit/xmlutils/XMLUtils.kt diff --git a/core/src/test/java/io/bimmergestalt/idriveconnectkit/TestCDSProperty.kt b/core/src/commonTest/kotlin/io/bimmergestalt/idriveconnectkit/TestCDSProperty.kt similarity index 100% rename from core/src/test/java/io/bimmergestalt/idriveconnectkit/TestCDSProperty.kt rename to core/src/commonTest/kotlin/io/bimmergestalt/idriveconnectkit/TestCDSProperty.kt diff --git a/core/src/test/java/io/bimmergestalt/idriveconnectkit/TestComponentEvents.kt b/core/src/commonTest/kotlin/io/bimmergestalt/idriveconnectkit/TestComponentEvents.kt similarity index 100% rename from core/src/test/java/io/bimmergestalt/idriveconnectkit/TestComponentEvents.kt rename to core/src/commonTest/kotlin/io/bimmergestalt/idriveconnectkit/TestComponentEvents.kt diff --git a/core/src/test/java/io/bimmergestalt/idriveconnectkit/TestRHMIApplication.kt b/core/src/commonTest/kotlin/io/bimmergestalt/idriveconnectkit/TestRHMIApplication.kt similarity index 100% rename from core/src/test/java/io/bimmergestalt/idriveconnectkit/TestRHMIApplication.kt rename to core/src/commonTest/kotlin/io/bimmergestalt/idriveconnectkit/TestRHMIApplication.kt diff --git a/core/src/test/java/io/bimmergestalt/idriveconnectkit/TestRHMIApplicationIdempotent.kt b/core/src/commonTest/kotlin/io/bimmergestalt/idriveconnectkit/TestRHMIApplicationIdempotent.kt similarity index 100% rename from core/src/test/java/io/bimmergestalt/idriveconnectkit/TestRHMIApplicationIdempotent.kt rename to core/src/commonTest/kotlin/io/bimmergestalt/idriveconnectkit/TestRHMIApplicationIdempotent.kt diff --git a/core/src/test/java/io/bimmergestalt/idriveconnectkit/TestRHMIApplicationSynchronized.kt b/core/src/commonTest/kotlin/io/bimmergestalt/idriveconnectkit/TestRHMIApplicationSynchronized.kt similarity index 100% rename from core/src/test/java/io/bimmergestalt/idriveconnectkit/TestRHMIApplicationSynchronized.kt rename to core/src/commonTest/kotlin/io/bimmergestalt/idriveconnectkit/TestRHMIApplicationSynchronized.kt diff --git a/core/src/test/java/io/bimmergestalt/idriveconnectkit/TestRHMIDimensions.kt b/core/src/commonTest/kotlin/io/bimmergestalt/idriveconnectkit/TestRHMIDimensions.kt similarity index 100% rename from core/src/test/java/io/bimmergestalt/idriveconnectkit/TestRHMIDimensions.kt rename to core/src/commonTest/kotlin/io/bimmergestalt/idriveconnectkit/TestRHMIDimensions.kt diff --git a/core/src/test/java/io/bimmergestalt/idriveconnectkit/TestUtils.kt b/core/src/commonTest/kotlin/io/bimmergestalt/idriveconnectkit/TestUtils.kt similarity index 100% rename from core/src/test/java/io/bimmergestalt/idriveconnectkit/TestUtils.kt rename to core/src/commonTest/kotlin/io/bimmergestalt/idriveconnectkit/TestUtils.kt diff --git a/core/src/test/java/io/bimmergestalt/idriveconnectkit/TestXMLParsing.kt b/core/src/commonTest/kotlin/io/bimmergestalt/idriveconnectkit/TestXMLParsing.kt similarity index 99% rename from core/src/test/java/io/bimmergestalt/idriveconnectkit/TestXMLParsing.kt rename to core/src/commonTest/kotlin/io/bimmergestalt/idriveconnectkit/TestXMLParsing.kt index 4b2fb4f..c8ae6f9 100644 --- a/core/src/test/java/io/bimmergestalt/idriveconnectkit/TestXMLParsing.kt +++ b/core/src/commonTest/kotlin/io/bimmergestalt/idriveconnectkit/TestXMLParsing.kt @@ -9,8 +9,6 @@ import org.junit.Assert.* import org.junit.Test import org.w3c.dom.Node import java.lang.IndexOutOfBoundsException -import kotlin.test.BeforeTest -import kotlin.test.expect class TestXMLParsing { val xml = this.javaClass.classLoader.getResourceAsStream("ui_layout.xml")!!.bufferedReader().use { diff --git a/core/src/test/resources/ui_layout.xml b/core/src/commonTest/resources/ui_layout.xml similarity index 100% rename from core/src/test/resources/ui_layout.xml rename to core/src/commonTest/resources/ui_layout.xml diff --git a/core/src/main/java/io/bimmergestalt/idriveconnectkit/IDriveConnection.kt b/core/src/jvmMain/kotlin/io/bimmergestalt/idriveconnectkit/IDriveConnection.kt similarity index 100% rename from core/src/main/java/io/bimmergestalt/idriveconnectkit/IDriveConnection.kt rename to core/src/jvmMain/kotlin/io/bimmergestalt/idriveconnectkit/IDriveConnection.kt diff --git a/core/src/test/java/io/bimmergestalt/idriveconnectkit/TestIDriveConnection.kt b/core/src/jvmTest/kotlin/io/bimmergestalt/idriveconnectkit/TestIDriveConnection.kt similarity index 100% rename from core/src/test/java/io/bimmergestalt/idriveconnectkit/TestIDriveConnection.kt rename to core/src/jvmTest/kotlin/io/bimmergestalt/idriveconnectkit/TestIDriveConnection.kt