diff --git a/common-client/src/main/kotlin/BackendService.kt b/common-client/src/main/kotlin/BackendService.kt new file mode 100644 index 0000000..1e0c113 --- /dev/null +++ b/common-client/src/main/kotlin/BackendService.kt @@ -0,0 +1,3 @@ +object BackendService { + +} \ No newline at end of file diff --git a/common/build.gradle b/common/build.gradle index 68f3cda..830d908 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -7,3 +7,12 @@ dependencies { testCompile "org.jetbrains.kotlin:kotlin-test-annotations-common" testCompile "org.jetbrains.kotlin:kotlin-test-common" } + +compileKotlinCommon { + kotlinOptions { + freeCompilerArgs = [ + "-Xuse-experimental=kotlin.Experimental", + "-Xuse-experimental=kotlin.ExperimentalMultiplatform" + ] + } +} \ No newline at end of file diff --git a/common/src/main/kotlin/edu/unito/klinika/annotations/Annotations.kt b/common/src/main/kotlin/edu/unito/klinika/annotations/Annotations.kt new file mode 100644 index 0000000..a9d77a7 --- /dev/null +++ b/common/src/main/kotlin/edu/unito/klinika/annotations/Annotations.kt @@ -0,0 +1,13 @@ +package edu.unito.klinika.annotations + +@UseExperimental(ExperimentalMultiplatform::class) +@OptionalExpectation +expect annotation class Entity() + +@UseExperimental(ExperimentalMultiplatform::class) +@OptionalExpectation +expect annotation class Id() + +@UseExperimental(ExperimentalMultiplatform::class) +@OptionalExpectation +expect annotation class GeneratedValue() \ No newline at end of file diff --git a/common/src/main/kotlin/edu/unito/klinika/data/Data.kt b/common/src/main/kotlin/edu/unito/klinika/data/Data.kt new file mode 100644 index 0000000..88259dc --- /dev/null +++ b/common/src/main/kotlin/edu/unito/klinika/data/Data.kt @@ -0,0 +1,8 @@ +package edu.unito.klinika.data + +import edu.unito.klinika.annotations.Entity +import edu.unito.klinika.annotations.GeneratedValue +import edu.unito.klinika.annotations.Id + +@Entity +class User(@Id @GeneratedValue val id: Long, val name: String) \ No newline at end of file diff --git a/server/build.gradle b/server/build.gradle index 114c4b6..aa74bd5 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -24,8 +24,14 @@ dependencies { compileKotlin { kotlinOptions.jvmTarget = '1.8' + kotlinOptions { + freeCompilerArgs = ['-Xuse-experimental=kotlin.Experimental'] + } } compileTestKotlin { kotlinOptions.jvmTarget = '1.8' + kotlinOptions { + freeCompilerArgs = ['-Xuse-experimental=kotlin.Experimental'] + } } sourceCompatibility = '1.8' \ No newline at end of file diff --git a/server/src/main/kotlin/edu/unito/klinika/Main.kt b/server/src/main/kotlin/edu/unito/klinika/Main.kt index 88cb613..04a43cc 100644 --- a/server/src/main/kotlin/edu/unito/klinika/Main.kt +++ b/server/src/main/kotlin/edu/unito/klinika/Main.kt @@ -1,11 +1,15 @@ package edu.unito.klinika import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.boot.autoconfigure.domain.EntityScan import org.springframework.boot.runApplication + @SpringBootApplication class KlinikaApplication fun main(args: Array) { runApplication(*args) } + + diff --git a/server/src/main/kotlin/edu/unito/klinika/annotations/Annotations.kt b/server/src/main/kotlin/edu/unito/klinika/annotations/Annotations.kt new file mode 100644 index 0000000..c557b12 --- /dev/null +++ b/server/src/main/kotlin/edu/unito/klinika/annotations/Annotations.kt @@ -0,0 +1,10 @@ +package edu.unito.klinika.annotations + +import javax.persistence.Entity +import javax.persistence.GeneratedValue +import javax.persistence.Id + +actual typealias Entity = Entity +actual typealias Id = Id +actual typealias GeneratedValue = GeneratedValue +