Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
eb7afb6c
Commit
eb7afb6c
authored
Mar 24, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to Kotlin 1.4-M1
parent
f2bd3218
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
168 additions
and
137 deletions
+168
-137
build.gradle.kts
build.gradle.kts
+8
-14
buildSrc/build.gradle.kts
buildSrc/build.gradle.kts
+7
-0
buildSrc/src/main/kotlin/dependencies.kt
buildSrc/src/main/kotlin/dependencies.kt
+42
-0
compatibility-validator/build.gradle.kts
compatibility-validator/build.gradle.kts
+1
-6
gradle.properties
gradle.properties
+1
-12
mirai-core-qqandroid/build.gradle.kts
mirai-core-qqandroid/build.gradle.kts
+20
-44
mirai-core/build.gradle.kts
mirai-core/build.gradle.kts
+39
-61
mirai-core/src/androidMain/kotlin/net/mamoe/mirai/event/internal/MiraiAtomicBoolean.kt
...tlin/net/mamoe/mirai/event/internal/MiraiAtomicBoolean.kt
+25
-0
mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/event/internal/MiraiAtomicBoolean.kt
...tlin/net/mamoe/mirai/event/internal/MiraiAtomicBoolean.kt
+25
-0
No files found.
build.gradle.kts
View file @
eb7afb6c
...
@@ -5,26 +5,22 @@ buildscript {
...
@@ -5,26 +5,22 @@ buildscript {
repositories
{
repositories
{
mavenLocal
()
mavenLocal
()
maven
(
url
=
"https://mirrors.huaweicloud.com/repository/maven"
)
maven
(
url
=
"https://mirrors.huaweicloud.com/repository/maven"
)
maven
(
url
=
"https://dl.bintray.com/kotlin/kotlin-eap"
)
jcenter
()
jcenter
()
// mavenCentral()
google
()
google
()
// maven (url="https://dl.bintray.com/kotlin/kotlin-eap")
}
}
dependencies
{
dependencies
{
val
kotlinVersion
:
String
by
project
classpath
(
"com.android.tools.build:gradle:${Versions.Android.androidGradlePlugin}"
)
val
atomicFuVersion
:
String
by
project
classpath
(
"org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.Kotlin.stdlib}"
)
classpath
(
"org.jetbrains.kotlin:kotlin-serialization:${Versions.Kotlin.stdlib}"
)
classpath
(
"com.android.tools.build:gradle:3.5.3"
)
classpath
(
"org.jetbrains.kotlinx:atomicfu-gradle-plugin:${Versions.Kotlin.atomicFU}"
)
classpath
(
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
)
// classpath("com.github.jengelman.gradle.plugins:shadow:5.2.0")
classpath
(
"org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion"
)
classpath
(
"org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicFuVersion"
)
}
}
}
}
plugins
{
plugins
{
id
(
"org.jetbrains.dokka"
)
version
"0.10.1"
apply
false
id
(
"org.jetbrains.dokka"
)
version
Versions
.
Kotlin
.
dokka
apply
false
id
(
"com.jfrog.bintray"
)
version
Versions
.
Publishing
.
bintray
apply
false
}
}
runCatching
{
runCatching
{
...
@@ -43,11 +39,9 @@ allprojects {
...
@@ -43,11 +39,9 @@ allprojects {
version
=
getProperty
(
"miraiVersion"
)
version
=
getProperty
(
"miraiVersion"
)
repositories
{
repositories
{
mavenLocal
()
maven
(
url
=
"https://mirrors.huaweicloud.com/repository/maven"
)
maven
(
url
=
"https://mirrors.huaweicloud.com/repository/maven"
)
maven
(
url
=
"https://dl.bintray.com/kotlin/kotlin-eap"
)
jcenter
()
jcenter
()
// mavenCentral()
google
()
google
()
// maven (url="https://dl.bintray.com/kotlin/kotlin-eap")
}
}
}
}
\ No newline at end of file
buildSrc/build.gradle.kts
0 → 100644
View file @
eb7afb6c
plugins
{
`kotlin-dsl`
}
repositories
{
jcenter
()
}
\ No newline at end of file
buildSrc/src/main/kotlin/dependencies.kt
0 → 100644
View file @
eb7afb6c
/*
* Copyright 2020 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
object
Versions
{
object
Mirai
{
const
val
version
=
"0.30.0"
}
object
Kotlin
{
const
val
stdlib
=
"1.4-M1"
const
val
coroutines
=
"1.3.5-1.4-M1"
const
val
atomicFU
=
"0.14.2-1.4-M1"
const
val
serialization
=
"0.20.0-1.4-M1"
const
val
ktor
=
"1.3.2-1.4-M1"
const
val
io
=
"0.1.16"
const
val
coroutinesIo
=
"0.1.16"
const
val
dokka
=
"0.10.1"
}
object
Android
{
const
val
androidGradlePlugin
=
"3.5.3"
}
object
Publishing
{
const
val
bintray
=
"1.8.4-jetbrains-3"
}
}
@Suppress
(
"unused"
)
fun
kotlinx
(
id
:
String
,
version
:
String
)
=
"org.jetbrains.kotlinx:kotlinx-$id:$version"
@Suppress
(
"unused"
)
fun
ktor
(
id
:
String
,
version
:
String
)
=
"io.ktor:ktor-$id:$version"
compatibility-validator/build.gradle.kts
View file @
eb7afb6c
...
@@ -7,11 +7,6 @@ plugins {
...
@@ -7,11 +7,6 @@ plugins {
description
=
"Binary and source compatibility validator for mirai-core and mirai-core-qqandroid"
description
=
"Binary and source compatibility validator for mirai-core and mirai-core-qqandroid"
val
kotlinVersion
:
String
by
rootProject
.
ext
val
coroutinesVersion
:
String
by
rootProject
.
ext
fun
kotlinx
(
id
:
String
,
version
:
String
)
=
"org.jetbrains.kotlinx:kotlinx-$id:$version"
kotlin
{
kotlin
{
sourceSets
{
sourceSets
{
all
{
all
{
...
@@ -23,7 +18,7 @@ kotlin {
...
@@ -23,7 +18,7 @@ kotlin {
dependencies
{
dependencies
{
api
(
kotlin
(
"stdlib"
))
api
(
kotlin
(
"stdlib"
))
api
(
project
(
":mirai-core-qqandroid"
))
api
(
project
(
":mirai-core-qqandroid"
))
api
(
kotlinx
(
"coroutines-core"
,
coroutinesVersion
))
api
(
kotlinx
(
"coroutines-core"
,
Versions
.
Kotlin
.
coroutines
))
}
}
}
}
}
}
...
...
gradle.properties
View file @
eb7afb6c
# style guide
# style guide
kotlin.code.style
=
official
kotlin.code.style
=
official
# config
# config
miraiVersion
=
0.29.1
kotlin.incremental.multiplatform
=
true
kotlin.incremental.multiplatform
=
true
kotlin.parallel.tasks.in.project
=
true
kotlin.parallel.tasks.in.project
=
true
# kotlin
\ No newline at end of file
kotlinVersion
=
1.3.70
# kotlin libraries
serializationVersion
=
0.20.0
coroutinesVersion
=
1.3.4
atomicFuVersion
=
0.14.1
kotlinXIoVersion
=
0.1.16
coroutinesIoVersion
=
0.1.16
# utility
ktorVersion
=
1.3.2
\ No newline at end of file
mirai-core-qqandroid/build.gradle.kts
View file @
eb7afb6c
...
@@ -3,34 +3,15 @@
...
@@ -3,34 +3,15 @@
plugins
{
plugins
{
kotlin
(
"multiplatform"
)
kotlin
(
"multiplatform"
)
id
(
"kotlinx-atomicfu"
)
id
(
"kotlinx-atomicfu"
)
id
(
"kotlinx-
serialization"
)
kotlin
(
"plugin.
serialization"
)
`maven-publish`
`maven-publish`
id
(
"com.jfrog.bintray"
)
version
"1.8.4-jetbrains-3"
id
(
"com.jfrog.bintray"
)
}
}
val
kotlinVersion
:
String
by
rootProject
.
ext
val
atomicFuVersion
:
String
by
rootProject
.
ext
val
coroutinesVersion
:
String
by
rootProject
.
ext
val
kotlinXIoVersion
:
String
by
rootProject
.
ext
val
coroutinesIoVersion
:
String
by
rootProject
.
ext
val
ktorVersion
:
String
by
rootProject
.
ext
val
serializationVersion
:
String
by
rootProject
.
ext
fun
kotlinx
(
id
:
String
,
version
:
String
)
=
"org.jetbrains.kotlinx:kotlinx-$id:$version"
fun
ktor
(
id
:
String
,
version
:
String
)
=
"io.ktor:ktor-$id:$version"
description
=
"QQ protocol library"
description
=
"QQ protocol library"
val
isAndroidSDKAvailable
:
Boolean
by
project
val
isAndroidSDKAvailable
:
Boolean
by
project
val
miraiVersion
:
String
by
project
version
=
miraiVersion
kotlin
{
kotlin
{
if
(
isAndroidSDKAvailable
)
{
if
(
isAndroidSDKAvailable
)
{
apply
(
from
=
rootProject
.
file
(
"gradle/android.gradle"
))
apply
(
from
=
rootProject
.
file
(
"gradle/android.gradle"
))
...
@@ -58,30 +39,29 @@ kotlin {
...
@@ -58,30 +39,29 @@ kotlin {
sourceSets
{
sourceSets
{
all
{
all
{
languageSettings
.
enableLanguageFeature
(
"InlineClasses"
)
languageSettings
.
enableLanguageFeature
(
"InlineClasses"
)
languageSettings
.
useExperimentalAnnotation
(
"kotlin.Experimental"
)
languageSettings
.
useExperimentalAnnotation
(
"kotlin.Experimental"
)
dependencies
{
dependencies
{
api
(
project
(
":mirai-core"
))
api
(
project
(
":mirai-core"
))
api
(
kotlin
(
"stdlib"
,
kotlinVersion
))
api
(
"org.jetbrains.kotlinx:atomicfu:$atomicFuVersion"
)
api
(
kotlinx
(
"io"
,
kotlinXIoVersion
))
api
(
kotlinx
(
"coroutines-io"
,
coroutinesIoVersion
))
api
(
kotlinx
(
"coroutines-core"
,
coroutinesVersion
))
}
}
}
}
commonMain
{
commonMain
{
dependencies
{
dependencies
{
api
(
kotlinx
(
"serialization-runtime-common"
,
serializationVersion
))
api
(
kotlin
(
"stdlib"
,
Versions
.
Kotlin
.
stdlib
))
api
(
kotlinx
(
"serialization-protobuf-common"
,
serializationVersion
))
api
(
kotlinx
(
"serialization-runtime-common"
,
Versions
.
Kotlin
.
serialization
))
api
(
kotlinx
(
"serialization-protobuf-common"
,
Versions
.
Kotlin
.
serialization
))
api
(
"org.jetbrains.kotlinx:atomicfu:${Versions.Kotlin.atomicFU}"
)
api
(
kotlinx
(
"io"
,
Versions
.
Kotlin
.
io
))
api
(
kotlinx
(
"coroutines-io"
,
Versions
.
Kotlin
.
coroutinesIo
))
api
(
kotlinx
(
"coroutines-core"
,
Versions
.
Kotlin
.
coroutines
))
}
}
}
}
commonTest
{
commonTest
{
dependencies
{
dependencies
{
api
(
kotlin
(
"test-annotations-common"
))
implementation
(
kotlin
(
"test-annotations-common"
))
api
(
kotlin
(
"test-common"
))
implementation
(
kotlin
(
"test-common"
))
implementation
(
kotlin
(
"script-runtime"
))
implementation
(
kotlin
(
"script-runtime"
))
}
}
}
}
...
@@ -89,14 +69,14 @@ kotlin {
...
@@ -89,14 +69,14 @@ kotlin {
if
(
isAndroidSDKAvailable
)
{
if
(
isAndroidSDKAvailable
)
{
val
androidMain
by
getting
{
val
androidMain
by
getting
{
dependencies
{
dependencies
{
api
(
kotlinx
(
"serialization-protobuf"
,
serializationVers
ion
))
api
(
kotlinx
(
"serialization-protobuf"
,
Versions
.
Kotlin
.
serializat
ion
))
}
}
}
}
val
androidTest
by
getting
{
val
androidTest
by
getting
{
dependencies
{
dependencies
{
implementation
(
kotlin
(
"test"
,
kotlinVersion
))
implementation
(
kotlin
(
"test"
,
Versions
.
Kotlin
.
stdlib
))
implementation
(
kotlin
(
"test-junit"
,
kotlinVersion
))
implementation
(
kotlin
(
"test-junit"
,
Versions
.
Kotlin
.
stdlib
))
implementation
(
kotlin
(
"test-annotations-common"
))
implementation
(
kotlin
(
"test-annotations-common"
))
implementation
(
kotlin
(
"test-common"
))
implementation
(
kotlin
(
"test-common"
))
}
}
...
@@ -106,16 +86,16 @@ kotlin {
...
@@ -106,16 +86,16 @@ kotlin {
val
jvmMain
by
getting
{
val
jvmMain
by
getting
{
dependencies
{
dependencies
{
runtimeOnly
(
files
(
"build/classes/kotlin/jvm/main"
))
// classpath is not properly set by IDE
runtimeOnly
(
files
(
"build/classes/kotlin/jvm/main"
))
// classpath is not properly set by IDE
api
(
kotlinx
(
"serialization-runtime"
,
serializationVers
ion
))
api
(
kotlinx
(
"serialization-runtime"
,
Versions
.
Kotlin
.
serializat
ion
))
//api(kotlinx("serialization-protobuf",
serializationVers
ion))
//api(kotlinx("serialization-protobuf",
Versions.Kotlin.serializat
ion))
}
}
}
}
val
jvmTest
by
getting
{
val
jvmTest
by
getting
{
dependencies
{
dependencies
{
api
(
kotlin
(
"test"
,
kotlinVersion
))
implementation
(
kotlin
(
"test"
,
Versions
.
Kotlin
.
stdlib
))
api
(
kotlin
(
"test-junit"
,
kotlinVersion
))
implementation
(
kotlin
(
"test-junit"
,
Versions
.
Kotlin
.
stdlib
))
implementation
(
"org.pcap4j:pcap4j-distribution:1.8.2"
)
implementation
(
"org.pcap4j:pcap4j-distribution:1.8.2"
)
runtimeOnly
(
files
(
"build/classes/kotlin/jvm/main"
))
// classpath is not properly set by IDE
runtimeOnly
(
files
(
"build/classes/kotlin/jvm/main"
))
// classpath is not properly set by IDE
...
@@ -124,9 +104,5 @@ kotlin {
...
@@ -124,9 +104,5 @@ kotlin {
}
}
}
}
}
}
//
//tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
// kotlinOptions.jvmTarget = "1.8"
//}
apply
(
from
=
rootProject
.
file
(
"gradle/publish.gradle"
))
apply
(
from
=
rootProject
.
file
(
"gradle/publish.gradle"
))
mirai-core/build.gradle.kts
View file @
eb7afb6c
...
@@ -3,35 +3,16 @@
...
@@ -3,35 +3,16 @@
plugins
{
plugins
{
kotlin
(
"multiplatform"
)
kotlin
(
"multiplatform"
)
id
(
"kotlinx-atomicfu"
)
id
(
"kotlinx-atomicfu"
)
id
(
"kotlinx-
serialization"
)
kotlin
(
"plugin.
serialization"
)
id
(
"org.jetbrains.dokka"
)
id
(
"org.jetbrains.dokka"
)
`maven-publish`
`maven-publish`
id
(
"com.jfrog.bintray"
)
version
"1.8.4-jetbrains-3"
id
(
"com.jfrog.bintray"
)
}
}
val
kotlinVersion
:
String
by
rootProject
.
ext
val
atomicFuVersion
:
String
by
rootProject
.
ext
val
coroutinesVersion
:
String
by
rootProject
.
ext
val
kotlinXIoVersion
:
String
by
rootProject
.
ext
val
coroutinesIoVersion
:
String
by
rootProject
.
ext
val
ktorVersion
:
String
by
rootProject
.
ext
val
serializationVersion
:
String
by
rootProject
.
ext
fun
kotlinx
(
id
:
String
,
version
:
String
)
=
"org.jetbrains.kotlinx:kotlinx-$id:$version"
fun
ktor
(
id
:
String
,
version
:
String
)
=
"io.ktor:ktor-$id:$version"
description
=
"QQ protocol library"
description
=
"QQ protocol library"
val
isAndroidSDKAvailable
:
Boolean
by
project
val
isAndroidSDKAvailable
:
Boolean
by
project
val
miraiVersion
:
String
by
project
version
=
miraiVersion
kotlin
{
kotlin
{
if
(
isAndroidSDKAvailable
)
{
if
(
isAndroidSDKAvailable
)
{
apply
(
from
=
rootProject
.
file
(
"gradle/android.gradle"
))
apply
(
from
=
rootProject
.
file
(
"gradle/android.gradle"
))
...
@@ -63,22 +44,22 @@ kotlin {
...
@@ -63,22 +44,22 @@ kotlin {
commonMain
{
commonMain
{
dependencies
{
dependencies
{
api
(
kotlin
(
"stdlib"
,
kotlinVersion
))
api
(
kotlin
(
"stdlib"
))
api
(
kotlin
(
"serialization"
,
kotlinVersion
))
api
(
kotlin
(
"serialization"
))
api
(
kotlin
(
"reflect"
,
kotlinVersion
))
api
(
kotlin
(
"reflect"
))
api
(
kotlinx
(
"coroutines-core-common"
,
coroutinesVersion
))
api
(
kotlinx
(
"coroutines-core-common"
,
Versions
.
Kotlin
.
coroutines
))
api
(
kotlinx
(
"serialization-runtime-common"
,
serializationVers
ion
))
api
(
kotlinx
(
"serialization-runtime-common"
,
Versions
.
Kotlin
.
serializat
ion
))
api
(
kotlinx
(
"serialization-protobuf-common"
,
serializationVers
ion
))
api
(
kotlinx
(
"serialization-protobuf-common"
,
Versions
.
Kotlin
.
serializat
ion
))
api
(
kotlinx
(
"io"
,
kotlinXIoVersion
))
api
(
kotlinx
(
"io"
,
Versions
.
Kotlin
.
io
))
api
(
kotlinx
(
"coroutines-io"
,
coroutinesIoVersion
))
api
(
kotlinx
(
"coroutines-io"
,
Versions
.
Kotlin
.
coroutinesIo
))
api
(
kotlinx
(
"coroutines-core"
,
coroutinesVersion
))
api
(
kotlinx
(
"coroutines-core"
,
Versions
.
Kotlin
.
coroutines
))
api
(
"org.jetbrains.kotlinx:atomicfu-common:$
atomicFuVersion
"
)
api
(
"org.jetbrains.kotlinx:atomicfu-common:$
{Versions.Kotlin.atomicFU}
"
)
api
(
ktor
(
"client-cio"
,
ktorVersion
))
api
(
ktor
(
"client-cio"
,
Versions
.
Kotlin
.
ktor
))
api
(
ktor
(
"client-core"
,
ktorVersion
))
api
(
ktor
(
"client-core"
,
Versions
.
Kotlin
.
ktor
))
api
(
ktor
(
"network"
,
ktorVersion
))
api
(
ktor
(
"network"
,
Versions
.
Kotlin
.
ktor
))
}
}
}
}
commonTest
{
commonTest
{
...
@@ -91,22 +72,22 @@ kotlin {
...
@@ -91,22 +72,22 @@ kotlin {
if
(
isAndroidSDKAvailable
)
{
if
(
isAndroidSDKAvailable
)
{
val
androidMain
by
getting
{
val
androidMain
by
getting
{
dependencies
{
dependencies
{
api
(
kotlin
(
"reflect"
,
kotlinVersion
))
api
(
kotlin
(
"reflect"
))
api
(
kotlinx
(
"io-jvm"
,
kotlinXIoVersion
))
api
(
kotlinx
(
"io-jvm"
,
Versions
.
Kotlin
.
io
))
api
(
kotlinx
(
"serialization-runtime"
,
serializationVers
ion
))
api
(
kotlinx
(
"serialization-runtime"
,
Versions
.
Kotlin
.
serializat
ion
))
api
(
kotlinx
(
"serialization-protobuf"
,
serializationVers
ion
))
api
(
kotlinx
(
"serialization-protobuf"
,
Versions
.
Kotlin
.
serializat
ion
))
api
(
kotlinx
(
"coroutines-android"
,
coroutinesVersion
))
api
(
kotlinx
(
"coroutines-android"
,
Versions
.
Kotlin
.
coroutines
))
api
(
kotlinx
(
"coroutines-io-jvm"
,
coroutinesIoVersion
))
api
(
kotlinx
(
"coroutines-io-jvm"
,
Versions
.
Kotlin
.
coroutinesIo
))
api
(
ktor
(
"client-android"
,
ktorVersion
))
api
(
ktor
(
"client-android"
,
Versions
.
Kotlin
.
ktor
))
}
}
}
}
val
androidTest
by
getting
{
val
androidTest
by
getting
{
dependencies
{
dependencies
{
implementation
(
kotlin
(
"test"
,
kotlinVersion
))
implementation
(
kotlin
(
"test"
))
implementation
(
kotlin
(
"test-junit"
,
kotlinVersion
))
implementation
(
kotlin
(
"test-junit"
))
implementation
(
kotlin
(
"test-annotations-common"
))
implementation
(
kotlin
(
"test-annotations-common"
))
implementation
(
kotlin
(
"test-common"
))
implementation
(
kotlin
(
"test-common"
))
}
}
...
@@ -115,16 +96,16 @@ kotlin {
...
@@ -115,16 +96,16 @@ kotlin {
val
jvmMain
by
getting
{
val
jvmMain
by
getting
{
dependencies
{
dependencies
{
//api(kotlin("stdlib-jdk8"
, kotlinVersion
))
//api(kotlin("stdlib-jdk8"))
//api(kotlin("stdlib-jdk7"
, kotlinVersion
))
//api(kotlin("stdlib-jdk7"))
api
(
kotlin
(
"reflect"
,
kotlinVersion
))
api
(
kotlin
(
"reflect"
))
api
(
ktor
(
"client-core-jvm"
,
ktorVersion
))
api
(
ktor
(
"client-core-jvm"
,
Versions
.
Kotlin
.
ktor
))
api
(
kotlinx
(
"io-jvm"
,
kotlinXIoVersion
))
api
(
kotlinx
(
"io-jvm"
,
Versions
.
Kotlin
.
io
))
api
(
kotlinx
(
"serialization-runtime"
,
serializationVers
ion
))
api
(
kotlinx
(
"serialization-runtime"
,
Versions
.
Kotlin
.
serializat
ion
))
api
(
kotlinx
(
"serialization-protobuf"
,
serializationVers
ion
))
api
(
kotlinx
(
"serialization-protobuf"
,
Versions
.
Kotlin
.
serializat
ion
))
api
(
kotlinx
(
"coroutines-io-jvm"
,
coroutinesIoVersion
))
api
(
kotlinx
(
"coroutines-io-jvm"
,
Versions
.
Kotlin
.
coroutinesIo
))
api
(
kotlinx
(
"coroutines-core"
,
coroutinesVersion
))
api
(
kotlinx
(
"coroutines-core"
,
Versions
.
Kotlin
.
coroutines
))
api
(
"org.bouncycastle:bcprov-jdk15on:1.64"
)
api
(
"org.bouncycastle:bcprov-jdk15on:1.64"
)
runtimeOnly
(
files
(
"build/classes/kotlin/jvm/main"
))
// classpath is not properly set by IDE
runtimeOnly
(
files
(
"build/classes/kotlin/jvm/main"
))
// classpath is not properly set by IDE
...
@@ -133,8 +114,8 @@ kotlin {
...
@@ -133,8 +114,8 @@ kotlin {
val
jvmTest
by
getting
{
val
jvmTest
by
getting
{
dependencies
{
dependencies
{
implementation
(
kotlin
(
"test"
,
kotlinVersion
))
implementation
(
kotlin
(
"test"
))
implementation
(
kotlin
(
"test-junit"
,
kotlinVersion
))
implementation
(
kotlin
(
"test-junit"
))
implementation
(
"org.pcap4j:pcap4j-distribution:1.8.2"
)
implementation
(
"org.pcap4j:pcap4j-distribution:1.8.2"
)
runtimeOnly
(
files
(
"build/classes/kotlin/jvm/test"
))
// classpath is not properly set by IDE
runtimeOnly
(
files
(
"build/classes/kotlin/jvm/test"
))
// classpath is not properly set by IDE
...
@@ -142,10 +123,7 @@ kotlin {
...
@@ -142,10 +123,7 @@ kotlin {
}
}
}
}
}
}
//
//tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
// kotlinOptions.jvmTarget = "1.8"
//}
tasks
{
tasks
{
val
dokka
by
getting
(
org
.
jetbrains
.
dokka
.
gradle
.
DokkaTask
::
class
)
{
val
dokka
by
getting
(
org
.
jetbrains
.
dokka
.
gradle
.
DokkaTask
::
class
)
{
outputFormat
=
"html"
outputFormat
=
"html"
...
...
mirai-core/src/androidMain/kotlin/net/mamoe/mirai/event/internal/MiraiAtomicBoolean.kt
View file @
eb7afb6c
package
net.mamoe.mirai.event.internal
package
net.mamoe.mirai.event.internal
import
net.mamoe.mirai.event.Event
import
net.mamoe.mirai.event.Listener
import
net.mamoe.mirai.utils.LockFreeLinkedList
import
java.util.concurrent.atomic.AtomicBoolean
import
java.util.concurrent.atomic.AtomicBoolean
import
kotlin.reflect.KClass
internal
actual
class
MiraiAtomicBoolean
actual
constructor
(
initial
:
Boolean
)
{
internal
actual
class
MiraiAtomicBoolean
actual
constructor
(
initial
:
Boolean
)
{
private
val
delegate
:
AtomicBoolean
=
AtomicBoolean
(
initial
)
private
val
delegate
:
AtomicBoolean
=
AtomicBoolean
(
initial
)
...
@@ -14,4 +18,25 @@ internal actual class MiraiAtomicBoolean actual constructor(initial: Boolean) {
...
@@ -14,4 +18,25 @@ internal actual class MiraiAtomicBoolean actual constructor(initial: Boolean) {
set
(
value
)
{
set
(
value
)
{
delegate
.
set
(
value
)
delegate
.
set
(
value
)
}
}
}
internal
actual
class
EventListeners
<
E
:
Event
>
actual
constructor
(
clazz
:
KClass
<
E
>)
:
LockFreeLinkedList
<
Listener
<
E
>>()
{
@Suppress
(
"UNCHECKED_CAST"
,
"UNSUPPORTED"
,
"NO_REFLECTION_IN_CLASS_PATH"
)
actual
val
supertypes
:
Set
<
KClass
<
out
Event
>>
by
lazy
{
val
supertypes
=
mutableSetOf
<
KClass
<
out
Event
>>()
fun
addSupertypes
(
clazz
:
KClass
<
out
Event
>)
{
clazz
.
supertypes
.
forEach
{
val
classifier
=
it
.
classifier
as
?
KClass
<
out
Event
>
if
(
classifier
!=
null
)
{
supertypes
.
add
(
classifier
)
addSupertypes
(
classifier
)
}
}
}
addSupertypes
(
clazz
)
supertypes
}
}
}
\ No newline at end of file
mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/event/internal/MiraiAtomicBoolean.kt
View file @
eb7afb6c
package
net.mamoe.mirai.event.internal
package
net.mamoe.mirai.event.internal
import
net.mamoe.mirai.event.Event
import
net.mamoe.mirai.event.Listener
import
net.mamoe.mirai.utils.LockFreeLinkedList
import
java.util.concurrent.atomic.AtomicBoolean
import
java.util.concurrent.atomic.AtomicBoolean
import
kotlin.reflect.KClass
internal
actual
class
MiraiAtomicBoolean
actual
constructor
(
initial
:
Boolean
)
{
internal
actual
class
MiraiAtomicBoolean
actual
constructor
(
initial
:
Boolean
)
{
...
@@ -15,4 +19,25 @@ internal actual class MiraiAtomicBoolean actual constructor(initial: Boolean) {
...
@@ -15,4 +19,25 @@ internal actual class MiraiAtomicBoolean actual constructor(initial: Boolean) {
set
(
value
)
{
set
(
value
)
{
delegate
.
set
(
value
)
delegate
.
set
(
value
)
}
}
}
internal
actual
class
EventListeners
<
E
:
Event
>
actual
constructor
(
clazz
:
KClass
<
E
>)
:
LockFreeLinkedList
<
Listener
<
E
>>()
{
@Suppress
(
"UNCHECKED_CAST"
,
"UNSUPPORTED"
,
"NO_REFLECTION_IN_CLASS_PATH"
)
actual
val
supertypes
:
Set
<
KClass
<
out
Event
>>
by
lazy
{
val
supertypes
=
mutableSetOf
<
KClass
<
out
Event
>>()
fun
addSupertypes
(
clazz
:
KClass
<
out
Event
>)
{
clazz
.
supertypes
.
forEach
{
val
classifier
=
it
.
classifier
as
?
KClass
<
out
Event
>
if
(
classifier
!=
null
)
{
supertypes
.
add
(
classifier
)
addSupertypes
(
classifier
)
}
}
}
addSupertypes
(
clazz
)
supertypes
}
}
}
\ No newline at end of file
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