Update dependencies

This commit is contained in:
Him188 2019-11-17 12:52:48 +08:00
parent 15901086d1
commit bdc95d1280
9 changed files with 135 additions and 120 deletions

View File

@ -1,6 +1,4 @@
buildscript { buildscript {
ext.kotlin_version = '1.3.50'
repositories { repositories {
maven { url "https://mirrors.huaweicloud.com/repository/maven/" } maven { url "https://mirrors.huaweicloud.com/repository/maven/" }
mavenLocal() mavenLocal()
@ -10,8 +8,9 @@ buildscript {
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.6.0-alpha03' classpath 'com.android.tools.build:gradle:3.6.0-alpha03'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicfu_version" classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion"
classpath "org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicFuVersion"
} }
} }
@ -22,6 +21,7 @@ allprojects {
repositories { repositories {
maven { url "https://mirrors.huaweicloud.com/repository/maven/" } maven { url "https://mirrors.huaweicloud.com/repository/maven/" }
mavenLocal() mavenLocal()
mavenCentral()
jcenter() jcenter()
google() google()
maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }

View File

@ -5,14 +5,15 @@ mirai_version=1.0.0
kotlin.incremental.multiplatform=true kotlin.incremental.multiplatform=true
kotlin.parallel.tasks.in.project=true kotlin.parallel.tasks.in.project=true
# kotlin # kotlin
kotlin_version=1.3.50 kotlinVersion=1.3.60
# kotlin libraries # kotlin libraries
serialization_version=0.13.0 serializationVersion=0.13.0
coroutines_version=1.3.2 coroutinesVersion=1.3.2
atomicfu_version=0.13.0 atomicFuVersion=0.13.0
ktor_version=1.2.4 kotlinXIoVersion=0.1.15
ktorio_version=1.3.0-beta-1 coroutinesIoVersion=0.24.0
klock_version=1.7.0
kotlinxio_version=0.1.15
coroutinesio_version=0.24.0
# utility # utility
ktorVersion=1.2.4
klockVersion=1.7.0
# gradle plugin
protobufJavaVersion=3.10.0

View File

@ -23,21 +23,21 @@ kotlin {
sourceSets { sourceSets {
commonMain { commonMain {
dependencies { dependencies {
api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-common', version: kotlin_version api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-common', version: kotlinVersion
api group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_version api group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlinVersion
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core-common', version: coroutines_version api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core-common', version: coroutinesVersion
api group: 'org.jetbrains.kotlinx', name: 'atomicfu-common', version: atomicfu_version api group: 'org.jetbrains.kotlinx', name: 'atomicfu-common', version: atomicFuVersion
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-io', version: kotlinxio_version api group: 'org.jetbrains.kotlinx', name: 'kotlinx-io', version: kotlinXIoVersion
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-io', version: coroutinesio_version api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-io', version: coroutinesIoVersion
implementation "com.soywiz.korlibs.klock:klock:$klock_version" implementation "com.soywiz.korlibs.klock:klock:$klockVersion"
api group: 'io.ktor', name: 'ktor-client-core', version: ktor_version api group: 'io.ktor', name: 'ktor-client-core', version: ktorVersion
api group: 'io.ktor', name: 'ktor-network', version: ktor_version api group: 'io.ktor', name: 'ktor-network', version: ktorVersion
//api group: 'io.ktor', name: 'ktor-client-cio', version: ktor_version //api group: 'io.ktor', name: 'ktor-client-cio', version: ktorVersion
//api group: 'io.ktor', name: 'ktor-client', version: ktor_version //api group: 'io.ktor', name: 'ktor-client', version: ktorVersion
api group: 'io.ktor', name: 'ktor-http', version: ktor_version api group: 'io.ktor', name: 'ktor-http', version: ktorVersion
//api group: 'io.ktor', name: 'ktor-utils', version: ktor_version //api group: 'io.ktor', name: 'ktor-utils', version: ktorVersion
//api group: 'io.ktor', name: 'ktor-io', version: ktorio_version //api group: 'io.ktor', name: 'ktor-io', version: ktorio_version
} }
} }
@ -46,19 +46,19 @@ kotlin {
apply plugin: 'java' apply plugin: 'java'
dependencies { dependencies {
api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: kotlin_version api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: kotlinVersion
api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: kotlin_version api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: kotlinVersion
api group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_version api group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlinVersion
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: coroutines_version api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: coroutinesVersion
api group: 'org.jetbrains.kotlinx', name: 'atomicfu', version: atomicfu_version api group: 'org.jetbrains.kotlinx', name: 'atomicfu', version: atomicFuVersion
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-io', version: kotlinxio_version api group: 'org.jetbrains.kotlinx', name: 'kotlinx-io', version: kotlinXIoVersion
// api group: 'org.jetbrains.kotlinx', name: 'kotlinx-io-jvm', version: kotlinxio_version // api group: 'org.jetbrains.kotlinx', name: 'kotlinx-io-jvm', version: kotlinXIoVersion
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-io', version: coroutinesio_version api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-io', version: coroutinesIoVersion
api group: 'io.ktor', name: 'ktor-http-cio', version: ktor_version api group: 'io.ktor', name: 'ktor-http-cio', version: ktorVersion
api group: 'io.ktor', name: 'ktor-http', version: ktor_version api group: 'io.ktor', name: 'ktor-http', version: ktorVersion
api group: 'io.ktor', name: 'ktor-client-core-jvm', version: ktor_version api group: 'io.ktor', name: 'ktor-client-core-jvm', version: ktorVersion
api group: 'io.ktor', name: 'ktor-client-cio', version: ktor_version api group: 'io.ktor', name: 'ktor-client-cio', version: ktorVersion
implementation 'org.yaml:snakeyaml:1.18' implementation 'org.yaml:snakeyaml:1.18'
implementation 'org.jsoup:jsoup:1.12.1' implementation 'org.jsoup:jsoup:1.12.1'
@ -92,19 +92,19 @@ kotlin {
api 'com.google.android:android:4.1.1.4' api 'com.google.android:android:4.1.1.4'
api 'com.android.support:support-annotations:26.1.0' api 'com.android.support:support-annotations:26.1.0'
api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: kotlin_version api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: kotlinVersion
api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: kotlin_version api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: kotlinVersion
api group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_version api group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlinVersion
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: coroutines_version api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: coroutinesVersion
api group: 'org.jetbrains.kotlinx', name: 'atomicfu', version: atomicfu_version api group: 'org.jetbrains.kotlinx', name: 'atomicfu', version: atomicFuVersion
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-io', version: kotlinxio_version api group: 'org.jetbrains.kotlinx', name: 'kotlinx-io', version: kotlinXIoVersion
// api group: 'org.jetbrains.kotlinx', name: 'kotlinx-io-jvm', version: kotlinxio_version // api group: 'org.jetbrains.kotlinx', name: 'kotlinx-io-jvm', version: kotlinXIoVersion
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-io', version: coroutinesio_version api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-io', version: coroutinesIoVersion
api group: 'io.ktor', name: 'ktor-http-cio', version: ktor_version api group: 'io.ktor', name: 'ktor-http-cio', version: ktorVersion
api group: 'io.ktor', name: 'ktor-http', version: ktor_version api group: 'io.ktor', name: 'ktor-http', version: ktorVersion
api group: 'io.ktor', name: 'ktor-client-core-jvm', version: ktor_version api group: 'io.ktor', name: 'ktor-client-core-jvm', version: ktorVersion
api group: 'io.ktor', name: 'ktor-client-cio', version: ktor_version api group: 'io.ktor', name: 'ktor-client-cio', version: ktorVersion
} }
} }

View File

@ -6,8 +6,9 @@ plugins {
id("kotlinx-atomicfu") id("kotlinx-atomicfu")
kotlin("multiplatform") kotlin("multiplatform")
id("com.android.library") id("com.android.library")
id("kotlinx-serialization")
`maven-publish` `maven-publish`
//id("kotlin-android-extensions")
} }
group = "net.mamoe.mirai" group = "net.mamoe.mirai"
@ -15,14 +16,24 @@ version = "0.1.0"
description = "Mirai core" description = "Mirai core"
val kotlinVersion = rootProject.ext["kotlin_version"].toString() val kotlinVersion: String by rootProject.ext
val atomicFuVersion = rootProject.ext["atomicfu_version"].toString() val atomicFuVersion: String by rootProject.ext
val coroutinesVersion = rootProject.ext["coroutines_version"].toString() val coroutinesVersion: String by rootProject.ext
val kotlinXIoVersion = rootProject.ext["kotlinxio_version"].toString() val kotlinXIoVersion: String by rootProject.ext
val coroutinesIoVersion = rootProject.ext["coroutinesio_version"].toString() val coroutinesIoVersion: String by rootProject.ext
val klockVersion = rootProject.ext["klock_version"].toString() val klockVersion: String by rootProject.ext
val ktorVersion = rootProject.ext["ktor_version"].toString() val ktorVersion: String by rootProject.ext
val serializationVersion: String by rootProject.ext
fun org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler.kotlinx(id: String, version: String) {
implementation("org.jetbrains.kotlinx:$id:$version")
}
fun org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler.ktor(id: String, version: String) {
implementation("io.ktor:$id:$version")
}
kotlin { kotlin {
android("android") { android("android") {
@ -42,7 +53,7 @@ kotlin {
buildTypes { buildTypes {
getByName("release") { getByName("release") {
isMinifyEnabled = false isMinifyEnabled = false
//proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") // proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
} }
} }
@ -58,22 +69,28 @@ kotlin {
// withJava() // withJava()
} }
/*
val proto = sourceSets["proto"].apply {
}*/
val commonMain = sourceSets["commonMain"].apply { val commonMain = sourceSets["commonMain"].apply {
dependencies { dependencies {
kotlin("kotlin-reflect", kotlinVersion) kotlin("kotlin-reflect", kotlinVersion)
//api("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion") //kotlin("kotlin-serialization", kotlinVersion)
implementation("com.soywiz.korlibs.klock:klock:$klockVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutinesVersion")
implementation("io.ktor:ktor-http-cio:$ktorVersion") kotlinx("kotlinx-coroutines-core-common", coroutinesVersion)
implementation("io.ktor:ktor-http:$ktorVersion") kotlinx("kotlinx-serialization-runtime-common", serializationVersion)
implementation("io.ktor:ktor-client-core-jvm:$ktorVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
api("com.soywiz.korlibs.klock:klock:$klockVersion")
ktor("ktor-http-cio", ktorVersion)
ktor("ktor-http", ktorVersion)
ktor("ktor-client-core-jvm", ktorVersion)
ktor("ktor-client-cio", ktorVersion)
ktor("ktor-client-core", ktorVersion)
ktor("ktor-network", ktorVersion)
//implementation("io.ktor:ktor-io:1.3.0-beta-1") //implementation("io.ktor:ktor-io:1.3.0-beta-1")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-network:$ktorVersion")
} }
} }
@ -81,12 +98,12 @@ kotlin {
dependencies { dependencies {
dependsOn(commonMain) dependsOn(commonMain)
api("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion") kotlin("kotlin-reflect", kotlinVersion)
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion") kotlinx("kotlinx-serialization-runtime", serializationVersion)
kotlinx("kotlinx-coroutines-android", coroutinesVersion)
implementation("io.ktor:ktor-client-android:$ktorVersion")
ktor("ktor-client-android", ktorVersion)
} }
} }
@ -94,14 +111,13 @@ kotlin {
dependencies { dependencies {
dependsOn(commonMain) dependsOn(commonMain)
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") kotlin("kotlin-stdlib-jdk8", kotlinVersion)
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7") kotlin("kotlin-stdlib-jdk7", kotlinVersion)
kotlin("kotlin-reflect", kotlinVersion)
api("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
implementation("io.ktor:ktor-client-core-jvm:$ktorVersion")
implementation("org.jetbrains.kotlinx:kotlinx-io-jvm:$kotlinXIoVersion")
ktor("ktor-client-core-jvm", ktorVersion)
kotlinx("kotlinx-io-jvm", kotlinXIoVersion)
kotlinx("kotlinx-serialization-runtime", serializationVersion)
} }
} }
@ -118,11 +134,13 @@ kotlin {
languageSettings.useExperimentalAnnotation("kotlin.Experimental") languageSettings.useExperimentalAnnotation("kotlin.Experimental")
dependencies { dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib") kotlin("kotlin-stdlib", kotlinVersion)
implementation("org.jetbrains.kotlinx:atomicfu:$atomicFuVersion") kotlin("kotlin-serialization", kotlinVersion)
implementation("org.jetbrains.kotlinx:kotlinx-io:$kotlinXIoVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-io:$coroutinesIoVersion") kotlinx("atomicfu", atomicFuVersion)
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion") kotlinx("kotlinx-io", kotlinXIoVersion)
kotlinx("kotlinx-coroutines-io", coroutinesIoVersion)
kotlinx("kotlinx-coroutines-core", coroutinesVersion)
} }
} }
sourceSets { sourceSets {

View File

@ -7,10 +7,8 @@ import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import net.mamoe.mirai.Bot import net.mamoe.mirai.Bot
import net.mamoe.mirai.BotAccount
import net.mamoe.mirai.login import net.mamoe.mirai.login
import net.mamoe.mirai.network.protocol.tim.packet.login.LoginResult import net.mamoe.mirai.network.protocol.tim.packet.login.LoginResult
import net.mamoe.mirai.utils.Console
import java.util.* import java.util.*
/** /**
@ -41,28 +39,25 @@ suspend fun main() {
withContext(GlobalScope.coroutineContext) { withContext(GlobalScope.coroutineContext) {
qqList.split("\n") qqList.split("\n")
.filterNot { it.isEmpty() } .filterNot { it.isEmpty() }
.map { it.split("----") } .map { it.split("----") }
.map { Pair(it[0].toLong(), it[1]) } .map { Pair(it[0].toLong(), it[1]) }
.forEach { (qq, password) -> .forEach { (qq, password) ->
runBlocking { runBlocking {
val bot = Bot( val bot = Bot(
BotAccount( qq.toUInt(),
qq.toUInt(), if (password.endsWith(".")) password.substring(0, password.length - 1) else password
if (password.endsWith(".")) password.substring(0, password.length - 1) else password )
),
Console()
)
withContext(Dispatchers.IO) { withContext(Dispatchers.IO) {
bot.login() bot.login()
}.let { state -> }.let { state ->
if (state == LoginResult.SUCCESS) { if (state == LoginResult.SUCCESS) {
goodBotList.add(bot) goodBotList.add(bot)
}
} }
} }
} }
}
} }
println("Filtering finished") println("Filtering finished")

View File

@ -15,14 +15,14 @@ application {
mainClassName = "Application" mainClassName = "Application"
} }
val kotlinVersion = rootProject.ext["kotlin_version"].toString() val kotlinVersion = rootProject.ext["kotlinVersion"].toString()
val atomicFuVersion = rootProject.ext["atomicfu_version"].toString() val atomicFuVersion = rootProject.ext["atomicFuVersion"].toString()
val coroutinesVersion = rootProject.ext["coroutines_version"].toString() val coroutinesVersion = rootProject.ext["coroutinesVersion"].toString()
val kotlinXIoVersion = rootProject.ext["kotlinxio_version"].toString() val kotlinXIoVersion = rootProject.ext["kotlinXIoVersion"].toString()
val coroutinesIoVersion = rootProject.ext["coroutinesio_version"].toString() val coroutinesIoVersion = rootProject.ext["coroutinesIoVersion"].toString()
val klockVersion = rootProject.ext["klock_version"].toString() val klockVersion = rootProject.ext["klockVersion"].toString()
val ktorVersion = rootProject.ext["ktor_version"].toString() val ktorVersion = rootProject.ext["ktorVersion"].toString()
kotlin { kotlin {
sourceSets { sourceSets {

View File

@ -4,6 +4,6 @@ apply plugin: "java"
dependencies { dependencies {
api project(":mirai-core") api project(":mirai-core")
runtime files("../../mirai-core/build/classes/kotlin/jvm/main") // mpp targeting android limitation runtime files("../../mirai-core/build/classes/kotlin/jvm/main") // mpp targeting android limitation
api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: kotlin_version api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: kotlinVersion
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: coroutines_version api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: coroutinesVersion
} }

View File

@ -30,6 +30,7 @@ android {
exclude 'META-INF/ktor-http-cio.kotlin_module' exclude 'META-INF/ktor-http-cio.kotlin_module'
exclude 'META-INF/ktor-http-cio.kotlin_module' exclude 'META-INF/ktor-http-cio.kotlin_module'
exclude 'META-INF/ktor-client-core.kotlin_module' exclude 'META-INF/ktor-client-core.kotlin_module'
exclude "META-INF/kotlinx-serialization-runtime.kotlin_module"
} }
} }
@ -41,8 +42,8 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib" implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation project(':mirai-core') implementation project(':mirai-core')
api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: kotlin_version implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: kotlinVersion
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: coroutines_version implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: coroutinesVersion
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-android', version: "1.3.2" implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-android', version: "1.3.2"
//implementation 'com.android.support:appcompat-v7:29.1.1'// https://mvnrepository.com/artifact/androidx.appcompat/appcompat //implementation 'com.android.support:appcompat-v7:29.1.1'// https://mvnrepository.com/artifact/androidx.appcompat/appcompat

View File

@ -6,11 +6,11 @@ dependencies {
api project(":mirai-core") api project(":mirai-core")
runtime files("../../mirai-core/build/classes/kotlin/jvm/main") // mpp targeting android limitation runtime files("../../mirai-core/build/classes/kotlin/jvm/main") // mpp targeting android limitation
//runtime files("../../mirai-core/build/classes/atomicfu/jvm/main") // mpp targeting android limitation //runtime files("../../mirai-core/build/classes/atomicfu/jvm/main") // mpp targeting android limitation
api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: kotlin_version api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: kotlinVersion
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: coroutines_version api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: coroutinesVersion
implementation("org.jetbrains.kotlinx:kotlinx-io:$kotlinxio_version") implementation("org.jetbrains.kotlinx:kotlinx-io:$kotlinXIoVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-io:$coroutinesio_version") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-io:$coroutinesIoVersion")
compile group: 'com.alibaba', name: 'fastjson', version: '1.2.62' compile group: 'com.alibaba', name: 'fastjson', version: '1.2.62'
implementation 'org.jsoup:jsoup:1.12.1' implementation 'org.jsoup:jsoup:1.12.1'
} }