mirror of
https://github.com/mamoe/mirai.git
synced 2025-05-06 05:52:33 +08:00
Adjust build.gradle
This commit is contained in:
parent
7adacdbc6a
commit
bda54781e6
5
.gitignore
vendored
5
.gitignore
vendored
@ -37,4 +37,7 @@ mirai.iml
|
||||
.gradle/
|
||||
|
||||
|
||||
local.properties
|
||||
local.properties
|
||||
|
||||
# Maven publishing credits
|
||||
mirai-core/credits.properties
|
@ -2,10 +2,10 @@ buildscript {
|
||||
ext.kotlin_version = '1.3.50'
|
||||
|
||||
repositories {
|
||||
maven { url "https://mirrors.huaweicloud.com/repository/maven/" }
|
||||
mavenLocal()
|
||||
jcenter()
|
||||
google()
|
||||
maven { url "https://mirrors.huaweicloud.com/repository/maven/" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@ -20,9 +20,11 @@ allprojects {
|
||||
version = getProperty("mirai_version")
|
||||
|
||||
repositories {
|
||||
maven { url "https://mirrors.huaweicloud.com/repository/maven/" }
|
||||
mavenLocal()
|
||||
jcenter()
|
||||
google()
|
||||
maven { url "https://mirrors.huaweicloud.com/repository/maven/" }
|
||||
maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
|
||||
maven { url "https://dl.bintray.com/kotlin/kotlin-dev" }
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ kotlin {
|
||||
binaries {
|
||||
executable {
|
||||
// Change to specify fully qualified name of your application's entry point:
|
||||
entryPoint = 'main'
|
||||
entryPoint = 'hex.main'
|
||||
// Specify command-line arguments, if necessary:
|
||||
runTask?.args('')
|
||||
}
|
||||
|
@ -1,12 +1,20 @@
|
||||
@file:Suppress("UNUSED_VARIABLE")
|
||||
|
||||
import com.android.build.gradle.api.AndroidSourceSet
|
||||
|
||||
plugins {
|
||||
id("kotlinx-atomicfu")
|
||||
kotlin("multiplatform")
|
||||
id("com.android.library")
|
||||
`maven-publish`
|
||||
//id("kotlin-android-extensions")
|
||||
}
|
||||
|
||||
group = "net.mamoe.mirai"
|
||||
version = "0.1.0"
|
||||
|
||||
description = "Mirai core"
|
||||
|
||||
val kotlinVersion = rootProject.ext["kotlin_version"].toString()
|
||||
val atomicFuVersion = rootProject.ext["atomicfu_version"].toString()
|
||||
val coroutinesVersion = rootProject.ext["coroutines_version"].toString()
|
||||
@ -19,7 +27,7 @@ val ktorVersion = rootProject.ext["ktor_version"].toString()
|
||||
kotlin {
|
||||
android("android") {
|
||||
project.plugins.apply("com.android.library")
|
||||
|
||||
publishLibraryVariants("release", "debug")
|
||||
project.android {
|
||||
compileSdkVersion(29)
|
||||
buildToolsVersion("29.0.2")
|
||||
@ -46,18 +54,24 @@ kotlin {
|
||||
(sourceSets["main"] as AndroidSourceSet).java.srcDirs(file("src/androidMain/kotlin"))
|
||||
}
|
||||
}
|
||||
jvm("jvm")
|
||||
jvm("jvm") {
|
||||
// withJava()
|
||||
}
|
||||
|
||||
val commonMain = sourceSets["commonMain"].apply {
|
||||
dependencies {
|
||||
api("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
|
||||
kotlin("kotlin-reflect", kotlinVersion)
|
||||
//api("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
|
||||
implementation("com.soywiz.korlibs.klock:klock:$klockVersion")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutinesVersion")
|
||||
|
||||
implementation("io.ktor:ktor-http-cio:$ktorVersion")
|
||||
implementation("io.ktor:ktor-http:$ktorVersion")
|
||||
implementation("io.ktor:ktor-client-core-jvm:$ktorVersion")
|
||||
implementation("io.ktor:ktor-client-cio:$ktorVersion")
|
||||
|
||||
//implementation("io.ktor:ktor-io:1.3.0-beta-1")
|
||||
|
||||
implementation("io.ktor:ktor-client-core:$ktorVersion")
|
||||
implementation("io.ktor:ktor-network:$ktorVersion")
|
||||
}
|
||||
@ -111,4 +125,38 @@ kotlin {
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
|
||||
}
|
||||
}
|
||||
sourceSets {
|
||||
getByName("commonMain") {
|
||||
dependencies {
|
||||
implementation(kotlin("reflect"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications.withType<MavenPublication>().apply {
|
||||
val jvm by getting {}
|
||||
val metadata by getting { }
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
name = "GitHubPackages"
|
||||
url = uri("https://maven.pkg.github.com/mamoe/mirai")
|
||||
credentials {
|
||||
|
||||
val local = loadProperties("local.properties")
|
||||
username = local["miraiCorePublicationUsername"]?.toString()?:error("Cannot find miraiCorePublicationUsername")
|
||||
password = local["miraiCorePublicationKey"].toString()?:error("Cannot find miraiCorePublicationKey")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun loadProperties(filename: String): Properties = Properties().apply { load(DataInputStream(rootProject.file(filename).inputStream())) }
|
||||
*/
|
@ -41,7 +41,7 @@ dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib"
|
||||
implementation project(':mirai-core')
|
||||
|
||||
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: kotlin_version
|
||||
api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: kotlin_version
|
||||
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: coroutines_version
|
||||
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-android', version: "1.3.2"
|
||||
|
||||
|
@ -13,4 +13,9 @@ dependencies {
|
||||
implementation 'org.jsoup:jsoup:1.12.1'
|
||||
}
|
||||
|
||||
mainClassName = "demo.gentleman.MainKt"
|
||||
mainClassName = "demo.gentleman.MainKt"
|
||||
compileKotlin {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = ["-XXLanguage:+InlineClasses"]
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user