File tree Expand file tree Collapse file tree 10 files changed +304
-278
lines changed
src/commonMain/kotlin/org/modelix/model/api
src/commonMain/kotlin/org/modelix/model/lazy
model-server/src/main/kotlin/org/modelix/model/server Expand file tree Collapse file tree 10 files changed +304
-278
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,13 @@ subprojects {
28
28
version = rootProject.version
29
29
group = rootProject.group
30
30
31
+ tasks.withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > ().all {
32
+ kotlinOptions {
33
+ jvmTarget = " 11"
34
+ freeCompilerArgs + = listOf (" -Xjvm-default=all-compatibility" )
35
+ }
36
+ }
37
+
31
38
repositories {
32
39
mavenLocal()
33
40
maven { url = uri(" https://artifacts.itemis.cloud/repository/maven-mps/" ) }
Original file line number Diff line number Diff line change @@ -10,12 +10,6 @@ val kotlinLoggingVersion: String by rootProject
10
10
val kotlinxHtmlVersion: String by rootProject
11
11
val modelixIncrementalVersion: String by rootProject
12
12
13
- tasks.withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > ().all {
14
- kotlinOptions {
15
- jvmTarget = " 11"
16
- }
17
- }
18
-
19
13
kotlin {
20
14
jvm()
21
15
js(IR ) {
Original file line number Diff line number Diff line change @@ -12,13 +12,6 @@ configurations {
12
12
13
13
description = " API to access models stored in Modelix"
14
14
15
- tasks.withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > ().all {
16
- kotlinOptions {
17
- jvmTarget = " 11"
18
- freeCompilerArgs + = listOf (" -Xjvm-default=all-compatibility" )
19
- }
20
- }
21
-
22
15
ktlint {
23
16
disabledRules.add(" no-wildcard-imports" )
24
17
outputToConsole.set(true )
Original file line number Diff line number Diff line change @@ -29,4 +29,8 @@ data class ConceptReference(val uid: String) : IConceptReference {
29
29
override fun serialize (): String {
30
30
return uid
31
31
}
32
+
33
+ override fun toString (): String {
34
+ return uid
35
+ }
32
36
}
Original file line number Diff line number Diff line change @@ -11,12 +11,6 @@ configurations {
11
11
ktlint
12
12
}
13
13
14
- tasks.withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > ().configureEach {
15
- kotlinOptions {
16
- jvmTarget = " 11"
17
- }
18
- }
19
-
20
14
java {
21
15
toolchain {
22
16
languageVersion.set(JavaLanguageVersion .of(11 ))
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ package org.modelix.model.lazy
17
17
18
18
import kotlinx.datetime.Clock
19
19
import kotlinx.datetime.Instant
20
+ import kotlinx.datetime.TimeZone
21
+ import kotlinx.datetime.toInstant
20
22
import org.modelix.model.IVersion
21
23
import org.modelix.model.api.INodeReference
22
24
import org.modelix.model.api.LocalPNodeReference
@@ -103,9 +105,21 @@ class CLVersion : IVersion {
103
105
val id: Long
104
106
get() = data!! .id
105
107
108
+ @Deprecated(" Use getTimestamp()" )
106
109
val time: String?
107
110
get() = data!! .time
108
111
112
+ fun getTimestamp (): Instant ? {
113
+ val dateTimeStr = data!! .time ? : return null
114
+ try {
115
+ return Instant .fromEpochSeconds(dateTimeStr.toLong())
116
+ } catch (ex: Exception ) {}
117
+ try {
118
+ return kotlinx.datetime.LocalDateTime .parse(dateTimeStr).toInstant(TimeZone .currentSystemDefault())
119
+ } catch (ex: Exception ) {}
120
+ return null
121
+ }
122
+
109
123
@Deprecated(" Use getContentHash()" , ReplaceWith (" getContentHash()" ))
110
124
val hash: String
111
125
get() = data!! .hash
Original file line number Diff line number Diff line change @@ -132,9 +132,9 @@ object Main {
132
132
)
133
133
}
134
134
135
- val historyHandler = HistoryHandler (localModelClient)
136
135
val jsonModelServer = DeprecatedLightModelServer (localModelClient)
137
136
val repositoriesManager = RepositoriesManager (localModelClient)
137
+ val historyHandler = HistoryHandler (localModelClient, repositoriesManager)
138
138
val modelReplicationServer = ModelReplicationServer (repositoriesManager)
139
139
val ktorServer: NettyApplicationEngine = embeddedServer(Netty , port = port) {
140
140
install(Routing )
You can’t perform that action at this time.
0 commit comments