update mimes generator
This commit is contained in:
parent
58d92849fc
commit
570ca331fd
@ -1,12 +1,12 @@
|
|||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
kotlin_version=1.4.0
|
kotlin_version=1.4.10
|
||||||
kotlin_coroutines_version=1.3.9
|
kotlin_coroutines_version=1.3.9
|
||||||
kotlin_serialisation_core_version=1.0.0-RC
|
kotlin_serialisation_core_version=1.0.0-RC2
|
||||||
|
|
||||||
ktor_version=1.4.0
|
ktor_version=1.4.1
|
||||||
|
|
||||||
klockVersion=1.12.0
|
klockVersion=1.12.1
|
||||||
uuidVersion=0.2.2
|
uuidVersion=0.2.2
|
||||||
|
|
||||||
exposed_version=0.27.1
|
exposed_version=0.27.1
|
||||||
|
@ -40,7 +40,7 @@ kotlin {
|
|||||||
commonMain {
|
commonMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation kotlin('stdlib')
|
implementation kotlin('stdlib')
|
||||||
api "org.jetbrains.kotlinx:kotlinx-serialization-core:$kotlin_serialisation_core_version"
|
api "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialisation_core_version"
|
||||||
api "org.jetbrains.kotlinx:kotlinx-serialization-cbor:$kotlin_serialisation_core_version"
|
api "org.jetbrains.kotlinx:kotlinx-serialization-cbor:$kotlin_serialisation_core_version"
|
||||||
|
|
||||||
api projectByName("utils.common")
|
api projectByName("utils.common")
|
||||||
|
@ -41,7 +41,7 @@ kotlin {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation kotlin('stdlib')
|
implementation kotlin('stdlib')
|
||||||
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version"
|
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version"
|
||||||
api "org.jetbrains.kotlinx:kotlinx-serialization-core:$kotlin_serialisation_core_version"
|
api "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialisation_core_version"
|
||||||
|
|
||||||
api "com.soywiz.korlibs.klock:klock:$klockVersion"
|
api "com.soywiz.korlibs.klock:klock:$klockVersion"
|
||||||
api "com.benasher44:uuid:$uuidVersion"
|
api "com.benasher44:uuid:$uuidVersion"
|
||||||
|
@ -38,11 +38,11 @@ if __name__ == '__main__':
|
|||||||
code2 += ' KnownMimeTypes.Any,\n'
|
code2 += ' KnownMimeTypes.Any,\n'
|
||||||
for key, group in grouped:
|
for key, group in grouped:
|
||||||
group_name = key.capitalize()
|
group_name = key.capitalize()
|
||||||
code += 'sealed class %s(raw: String) : MimeType, KnownMimeTypes(raw) {\n' % group_name
|
code += '@Serializable(MimeTypeSerializer::class)\nsealed class %s(raw: String) : MimeType, KnownMimeTypes(raw) {\n' % group_name
|
||||||
code += ' object Any: %s ("%s/*")\n' % (group_name, key)
|
code += ' @Serializable(MimeTypeSerializer::class)\n object Any: %s ("%s/*")\n' % (group_name, key)
|
||||||
for mime in group:
|
for mime in group:
|
||||||
name = fix_name(mime['mime_category'], mime['mime_name'])
|
name = fix_name(mime['mime_category'], mime['mime_name'])
|
||||||
code += ' object %s: %s ("%s/%s")\n' % (name, group_name, mime['mime_category'], mime['mime_name'])
|
code += ' @Serializable(MimeTypeSerializer::class)\n object %s: %s ("%s/%s")\n' % (name, group_name, mime['mime_category'], mime['mime_name'])
|
||||||
code2 += ' KnownMimeTypes.%s.%s,\n' % (group_name, name)
|
code2 += ' KnownMimeTypes.%s.%s,\n' % (group_name, name)
|
||||||
code += '}\n\n'
|
code += '}\n\n'
|
||||||
code2 += ')\n'
|
code2 += ')\n'
|
||||||
|
Loading…
Reference in New Issue
Block a user