Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pseuco-ide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
10
Issues
10
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseuco
pseuco-ide
Commits
bfd19009
Verified
Commit
bfd19009
authored
Dec 09, 2019
by
Konstantin Kopper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kotlin 1.3.61 and some dependency upgrades
parent
9dfeb3b7
Pipeline
#14577
passed with stages
in 5 minutes and 5 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
15 deletions
+47
-15
build.gradle.kts
build.gradle.kts
+9
-9
src/main/kotlin/com/pseuco/PseuCoComFile.kt
src/main/kotlin/com/pseuco/PseuCoComFile.kt
+19
-3
src/main/kotlin/com/pseuco/websocket/SocketMessage.kt
src/main/kotlin/com/pseuco/websocket/SocketMessage.kt
+19
-3
No files found.
build.gradle.kts
View file @
bfd19009
...
...
@@ -7,8 +7,8 @@ if (!JavaVersion.current().isJava8Compatible)
error
(
"Only JDK 8 or newer is supported!"
)
plugins
{
kotlin
(
"jvm"
)
version
"1.3.6
0
"
kotlin
(
"plugin.serialization"
)
version
"1.3.6
0
"
kotlin
(
"jvm"
)
version
"1.3.6
1
"
kotlin
(
"plugin.serialization"
)
version
"1.3.6
1
"
id
(
"org.jetbrains.dokka"
)
version
"0.9.18"
}
...
...
@@ -16,9 +16,9 @@ repositories {
jcenter
()
}
val
ktorVersion
=
"1.2.
5
"
val
ktorVersion
=
"1.2.
6
"
val
junitVersion
=
"5.5.2"
val
aspectjVersion
=
"1.9.
4
"
val
aspectjVersion
=
"1.9.
5
"
dependencies
{
// The pseuco-java-compiler
...
...
@@ -31,7 +31,7 @@ dependencies {
implementation
(
"org.jetbrains.kotlinx"
,
"kotlinx-coroutines-core"
,
"1.3.2"
)
// Kotlin serialization
implementation
(
"org.jetbrains.kotlinx"
,
"kotlinx-serialization-runtime"
,
"0.1
3
.0"
)
implementation
(
"org.jetbrains.kotlinx"
,
"kotlinx-serialization-runtime"
,
"0.1
4
.0"
)
// OpenJFX
if
(
JavaVersion
.
current
().
isJava11Compatible
)
{
...
...
@@ -41,7 +41,7 @@ dependencies {
}
// Provides RichText TextAreas. Used for code input area.
implementation
(
"org.fxmisc.richtext"
,
"richtextfx"
,
"0.10.
2
"
)
implementation
(
"org.fxmisc.richtext"
,
"richtextfx"
,
"0.10.
3
"
)
// Google GSON library for JSON
implementation
(
"com.google.code.gson"
,
"gson"
,
"2.8.6"
)
...
...
@@ -58,7 +58,7 @@ dependencies {
implementation
(
"io.ktor"
,
"ktor-freemarker"
,
ktorVersion
)
// http4k WebSocket client library
implementation
(
"org.http4k"
,
"http4k-client-websocket"
,
"3.
196
.0"
)
implementation
(
"org.http4k"
,
"http4k-client-websocket"
,
"3.
200
.0"
)
// AspectJ runtime
runtimeOnly
(
"org.aspectj"
,
"aspectjrt"
,
aspectjVersion
)
...
...
@@ -70,7 +70,7 @@ dependencies {
testImplementation
(
"org.junit.jupiter"
,
"junit-jupiter-params"
,
junitVersion
)
testRuntimeOnly
(
"org.junit.jupiter"
,
"junit-jupiter-engine"
,
junitVersion
)
testImplementation
(
"org.mockito"
,
"mockito-junit-jupiter"
,
"3.
1
.0"
)
testImplementation
(
"org.mockito"
,
"mockito-junit-jupiter"
,
"3.
2
.0"
)
}
version
=
"2.0.3"
...
...
@@ -296,7 +296,7 @@ val dokka by tasks.getting(DokkaTask::class) {
}
externalDocumentationLink
{
url
=
url
(
"https://api.ktor.io/
1.2.4/"
)
// TODO replace by ktorVersion
url
=
url
(
"https://api.ktor.io/
$ktorVersion/"
)
}
linkMapping
{
...
...
src/main/kotlin/com/pseuco/PseuCoComFile.kt
View file @
bfd19009
package
com.pseuco
import
kotlinx.serialization.Decoder
import
kotlinx.serialization.Encoder
import
kotlinx.serialization.KSerializer
import
kotlinx.serialization.Required
import
kotlinx.serialization.SerialDescriptor
import
kotlinx.serialization.Serializable
import
kotlinx.serialization.
internal.CommonEnumSerializer
import
kotlinx.serialization.
UnionKind
/**
* Class representing sharable pseuCo.com files.
...
...
@@ -43,7 +47,19 @@ data class PseuCoComFile(val name: String, val content: String, @Required val ty
* @author Konstantin Kopper
* @since 2.0.4
*/
companion
object
:
CommonEnumSerializer
<
Type
>(
"PseuCoComFile.Type"
,
values
(),
values
().
map
{
it
.
name
.
toLowerCase
()
}.
toTypedArray
())
companion
object
:
KSerializer
<
Type
>
{
override
val
descriptor
=
object
:
SerialDescriptor
{
override
val
name
=
"PseuCoComFile.Type"
override
val
kind
=
UnionKind
.
ENUM_KIND
override
val
elementsCount
=
values
().
size
override
fun
getElementDescriptor
(
index
:
Int
):
SerialDescriptor
=
this
override
fun
getElementIndex
(
name
:
String
):
Int
=
valueOf
(
name
.
toUpperCase
()).
ordinal
override
fun
getElementName
(
index
:
Int
):
String
=
values
()[
index
].
name
.
toLowerCase
()
}
override
fun
deserialize
(
decoder
:
Decoder
):
Type
=
values
()[
descriptor
.
getElementIndex
(
decoder
.
decodeString
())]
override
fun
serialize
(
encoder
:
Encoder
,
obj
:
Type
)
=
encoder
.
encodeString
(
descriptor
.
getElementName
(
obj
.
ordinal
))
}
}
}
src/main/kotlin/com/pseuco/websocket/SocketMessage.kt
View file @
bfd19009
...
...
@@ -6,9 +6,10 @@ import kotlinx.serialization.Decoder
import
kotlinx.serialization.Encoder
import
kotlinx.serialization.KSerializer
import
kotlinx.serialization.SerialDescriptor
import
kotlinx.serialization.SerialKind
import
kotlinx.serialization.Serializable
import
kotlinx.serialization.SerializationException
import
kotlinx.serialization.
internal.CommonEnumSerializer
import
kotlinx.serialization.
UnionKind
import
kotlinx.serialization.internal.SerialClassDescImpl
/**
...
...
@@ -126,8 +127,23 @@ sealed class SocketMessage(val type: String) {
* @author Konstantin Kopper
* @since 2.0.4
*/
companion
object
:
CommonEnumSerializer
<
Code
>(
"SocketMessage.Response.Error.Code"
,
values
(),
values
().
map
{
it
.
name
.
toLowerCase
().
replace
(
Regex
(
"_(\\w)"
))
{
match
->
match
.
groupValues
[
1
].
toUpperCase
()
}
}.
toTypedArray
())
companion
object
:
KSerializer
<
Code
>
{
private
val
stringValues
=
values
().
map
{
it
.
name
.
toLowerCase
().
replace
(
Regex
(
"_(\\w)"
))
{
match
->
match
.
groupValues
[
1
].
toUpperCase
()
}
}
override
val
descriptor
=
object
:
SerialDescriptor
{
override
val
name
:
String
=
"SocketMessage.Response.Error.Code"
override
val
kind
:
SerialKind
=
UnionKind
.
ENUM_KIND
override
val
elementsCount
:
Int
=
values
().
size
override
fun
getElementIndex
(
name
:
String
):
Int
=
valueOf
(
name
).
ordinal
override
fun
getElementName
(
index
:
Int
):
String
=
values
()[
index
].
name
}
override
fun
deserialize
(
decoder
:
Decoder
):
Code
=
values
()[
stringValues
.
indexOf
(
decoder
.
decodeString
())]
override
fun
serialize
(
encoder
:
Encoder
,
obj
:
Code
)
=
encoder
.
encodeString
(
stringValues
[
obj
.
ordinal
])
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment