From c68628f5261646340e3f90c4dd67d0f5fa96123e Mon Sep 17 00:00:00 2001 From: Him188 <Him188@mamoe.net> Date: Mon, 23 Dec 2019 19:31:13 +0800 Subject: [PATCH] Create mirai-core-qqandroid --- mirai-core-qqandroid/README.md | 5 ++ mirai-core-qqandroid/build.gradle.kts | 111 ++++++++++++++++++++++++++ settings.gradle | 1 + 3 files changed, 117 insertions(+) create mode 100644 mirai-core-qqandroid/README.md create mode 100644 mirai-core-qqandroid/build.gradle.kts diff --git a/mirai-core-qqandroid/README.md b/mirai-core-qqandroid/README.md new file mode 100644 index 000000000..5245f1263 --- /dev/null +++ b/mirai-core-qqandroid/README.md @@ -0,0 +1,5 @@ +# mirai-core-qqandroid + +Protocol support for QQ for Android for Mirai. + +Not yet available to work. \ No newline at end of file diff --git a/mirai-core-qqandroid/build.gradle.kts b/mirai-core-qqandroid/build.gradle.kts new file mode 100644 index 000000000..c06f791ca --- /dev/null +++ b/mirai-core-qqandroid/build.gradle.kts @@ -0,0 +1,111 @@ +@file:Suppress("UNUSED_VARIABLE") + +plugins { + kotlin("multiplatform") + id("kotlinx-atomicfu") + id("com.android.library") + id("kotlinx-serialization") + `maven-publish` + id("com.jfrog.bintray") version "1.8.4-jetbrains-3" // DO NOT CHANGE THIS VERSION UNLESS YOU WANT TO WASTE YOUR TIME +} + +apply(from = rootProject.file("gradle/publish.gradle")) + +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 klockVersion: 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" +version = rootProject.ext.get("mirai_version")!!.toString() + +kotlin { + android("android") { + publishAllLibraryVariants() + project.android { + compileSdkVersion(29) + + defaultConfig { + minSdkVersion(15) + } + + // sourceSets.filterIsInstance(com.android.build.gradle.api.AndroidSourceSet::class.java).forEach { + // it.manifest.srcFile("src/androidMain/res/AndroidManifest.xml") + // it.res.srcDirs(file("src/androidMain/res")) + // } + //(sourceSets["main"] as AndroidSourceSet).java.srcDirs(file("src/androidMain/kotlin")) + } + } + + jvm("jvm") { + } + + sourceSets { + all { + languageSettings.enableLanguageFeature("InlineClasses") + languageSettings.useExperimentalAnnotation("kotlin.Experimental") + + dependencies { + api(project(":mirai-core")) + + api(kotlin("stdlib", kotlinVersion)) + api(kotlin("serialization", kotlinVersion)) + + api("org.jetbrains.kotlinx:atomicfu:$atomicFuVersion") + api(kotlinx("io", kotlinXIoVersion)) + api(kotlinx("coroutines-io", coroutinesIoVersion)) + api(kotlinx("coroutines-core", coroutinesVersion)) + } + } + commonMain { + dependencies { + } + } + commonTest { + dependencies { + api(kotlin("test-annotations-common")) + api(kotlin("test-common")) + } + } + + val androidMain by getting { + dependencies { + } + } + + val androidTest by getting { + dependencies { + api(kotlin("test", kotlinVersion)) + api(kotlin("test-junit", kotlinVersion)) + api(kotlin("test-annotations-common")) + api(kotlin("test-common")) + } + } + + val jvmMain by getting { + dependencies { + } + } + + val jvmTest by getting { + dependencies { + api(kotlin("test", kotlinVersion)) + api(kotlin("test-junit", kotlinVersion)) + implementation("org.pcap4j:pcap4j-distribution:1.8.2") + + //runtimeOnly(files("build/classes/kotlin/jvm/test")) // classpath is not properly set by IDE + } + } + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index e01862775..50bb2ac4e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -23,6 +23,7 @@ rootProject.name = 'mirai' include(':mirai-core') include(':mirai-core-timpc') +include(':mirai-core-qqandroid') include(':mirai-console') //include(':mirai-api')