You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.0 KiB
83 lines
2.0 KiB
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
|
import java.net.URI
|
|
|
|
plugins {
|
|
id("org.springframework.boot") version "2.3.1.RELEASE"
|
|
id("io.spring.dependency-management") version "1.0.9.RELEASE"
|
|
kotlin("jvm") version "1.4.0"
|
|
kotlin("plugin.spring") version "1.4.0"
|
|
kotlin("plugin.jpa") version "1.4.0"
|
|
id("distribution")
|
|
}
|
|
|
|
group = "com.pqh"
|
|
version = "0.0.1-SNAPSHOT"
|
|
java.sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
val taskGraph=gradle.getTaskGraph()
|
|
|
|
val junitVersion = "5.0.0"
|
|
|
|
var enabledProcessResources:Boolean? = null
|
|
|
|
val miraiVersion="1.2.2"
|
|
|
|
repositories {
|
|
maven { url=URI("https://maven.aliyun.com/repository/public/") }
|
|
maven { url=URI("https://repo.spring.io/libs-milestone/") }
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
implementation("net.mamoe:mirai-core-qqandroid:${miraiVersion}")
|
|
implementation("com.alibaba:fastjson:1.2.71")
|
|
|
|
// implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
|
implementation("org.springframework.boot:spring-boot-starter-web")
|
|
implementation("org.springframework.boot:spring-boot-starter-data-mongodb")
|
|
|
|
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
|
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
|
|
|
|
|
testImplementation("org.springframework.boot:spring-boot-starter-test") {
|
|
exclude(module = "junit")
|
|
exclude(module = "mockito-core")
|
|
exclude(module = "junit-vintage-engine")
|
|
}
|
|
}
|
|
|
|
|
|
|
|
tasks.register<Copy>("qqbot") {
|
|
dependsOn(tasks.withType<BootJar>())
|
|
from("src/main/resources")
|
|
into("${buildDir}/libs/config")
|
|
doLast{
|
|
println("完成任务,buildDir=${buildDir}")
|
|
}
|
|
}
|
|
|
|
taskGraph.beforeTask {
|
|
if(this.name=="processResources") {
|
|
if (taskGraph.hasTask(":bootJar")) {
|
|
println("不打包资源文件")
|
|
enabled = false
|
|
} else {
|
|
println("打包资源文件")
|
|
enabled = true
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType<Test> {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
tasks.withType<KotlinCompile> {
|
|
kotlinOptions {
|
|
freeCompilerArgs = listOf("-Xjsr305=strict")
|
|
jvmTarget = "1.8"
|
|
}
|
|
}
|
|
|