2022-11-04 08:23:02 +01:00
|
|
|
/*
|
2023-01-10 09:09:25 +01:00
|
|
|
* Copyright 2003-2023 The IdeaVim authors
|
2022-11-04 08:23:02 +01:00
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style
|
|
|
|
* license that can be found in the LICENSE.txt file or at
|
|
|
|
* https://opensource.org/licenses/MIT.
|
|
|
|
*/
|
|
|
|
|
2022-07-01 11:18:53 +02:00
|
|
|
plugins {
|
|
|
|
java
|
|
|
|
kotlin("jvm")
|
2023-03-31 10:22:32 +02:00
|
|
|
// id("org.jlleitschuh.gradle.ktlint")
|
2024-02-07 08:29:15 +01:00
|
|
|
id("com.google.devtools.ksp") version "1.9.22-1.0.17"
|
2024-02-09 13:26:24 +01:00
|
|
|
kotlin("plugin.serialization") version "1.9.22"
|
2023-07-21 16:22:32 +02:00
|
|
|
`maven-publish`
|
|
|
|
antlr
|
2022-07-01 11:18:53 +02:00
|
|
|
}
|
|
|
|
|
2023-08-11 22:13:01 +02:00
|
|
|
val kotlinVersion: String by project
|
2023-12-01 10:19:18 +01:00
|
|
|
val kotlinxSerializationVersion: String by project
|
2023-08-11 22:13:01 +02:00
|
|
|
|
2022-07-08 08:14:43 +02:00
|
|
|
// group 'org.jetbrains.ideavim'
|
|
|
|
// version 'SNAPSHOT'
|
2022-07-01 11:18:53 +02:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
|
2023-05-05 08:56:31 +02:00
|
|
|
ksp {
|
2023-11-10 13:48:58 +01:00
|
|
|
arg("generated_directory", "$projectDir/src/main/resources/ksp-generated")
|
2023-06-06 01:49:16 +02:00
|
|
|
arg("vimscript_functions_file", "engine_vimscript_functions.json")
|
|
|
|
arg("ex_commands_file", "engine_ex_commands.json")
|
2023-09-30 03:05:54 +02:00
|
|
|
arg("commands_file", "engine_commands.json")
|
2023-05-05 08:56:31 +02:00
|
|
|
}
|
|
|
|
|
2023-08-11 22:13:01 +02:00
|
|
|
afterEvaluate {
|
2023-07-21 16:22:32 +02:00
|
|
|
tasks.named("kspKotlin").configure { dependsOn("generateGrammarSource") }
|
|
|
|
tasks.named("kspTestKotlin").configure { enabled = false }
|
2023-08-11 22:13:01 +02:00
|
|
|
}
|
|
|
|
|
2022-07-01 11:18:53 +02:00
|
|
|
dependencies {
|
2024-02-23 09:03:30 +01:00
|
|
|
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.2")
|
|
|
|
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.2")
|
2023-08-11 22:13:01 +02:00
|
|
|
|
|
|
|
// https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-test
|
|
|
|
testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlinVersion")
|
|
|
|
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
|
2022-07-01 11:18:53 +02:00
|
|
|
|
2023-11-22 16:08:20 +01:00
|
|
|
compileOnly("org.jetbrains:annotations:24.1.0")
|
2023-05-05 08:56:31 +02:00
|
|
|
|
2024-02-21 16:28:28 +01:00
|
|
|
runtimeOnly("org.antlr:antlr4-runtime:4.13.1")
|
|
|
|
antlr("org.antlr:antlr4:4.13.1")
|
2023-07-21 16:22:32 +02:00
|
|
|
|
2023-05-05 08:56:31 +02:00
|
|
|
ksp(project(":annotation-processors"))
|
2024-02-09 13:26:24 +01:00
|
|
|
compileOnly(project(":annotation-processors"))
|
2023-12-01 10:19:18 +01:00
|
|
|
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:$kotlinxSerializationVersion")
|
2023-08-07 17:14:56 +02:00
|
|
|
|
2024-02-28 16:39:16 +01:00
|
|
|
testImplementation("org.mockito.kotlin:mockito-kotlin:5.2.1")
|
2022-07-01 11:18:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks {
|
|
|
|
val test by getting(Test::class) {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
|
|
|
|
2023-07-21 16:22:32 +02:00
|
|
|
generateGrammarSource {
|
|
|
|
maxHeapSize = "128m"
|
|
|
|
arguments.addAll(listOf("-package", "com.maddyhome.idea.vim.regexp.parser.generated", "-visitor"))
|
2023-08-31 16:26:46 +02:00
|
|
|
outputDirectory = file("src/main/java/com/maddyhome/idea/vim/regexp/parser/generated")
|
2023-07-21 16:22:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
named("compileKotlin") {
|
|
|
|
dependsOn("generateGrammarSource")
|
|
|
|
}
|
|
|
|
named("compileTestKotlin") {
|
|
|
|
dependsOn("generateTestGrammarSource")
|
|
|
|
}
|
|
|
|
|
2022-07-01 11:18:53 +02:00
|
|
|
compileKotlin {
|
|
|
|
kotlinOptions {
|
2024-02-07 08:29:15 +01:00
|
|
|
apiVersion = "1.9"
|
2022-07-01 11:18:53 +02:00
|
|
|
freeCompilerArgs = listOf("-Xjvm-default=all-compatibility")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-07-08 08:14:43 +02:00
|
|
|
|
|
|
|
// --- Linting
|
|
|
|
|
2023-03-31 10:22:32 +02:00
|
|
|
//ktlint {
|
|
|
|
// version.set("0.48.2")
|
|
|
|
//}
|
2023-03-10 12:23:24 +01:00
|
|
|
|
|
|
|
kotlin {
|
2023-03-13 10:44:02 +01:00
|
|
|
explicitApi()
|
2023-03-10 18:03:35 +01:00
|
|
|
}
|
2023-07-20 15:50:05 +02:00
|
|
|
|
2024-02-01 10:07:28 +01:00
|
|
|
java {
|
|
|
|
withSourcesJar()
|
|
|
|
withJavadocJar()
|
|
|
|
}
|
|
|
|
|
2023-07-20 15:50:05 +02:00
|
|
|
val spaceUsername: String by project
|
|
|
|
val spacePassword: String by project
|
|
|
|
val engineVersion: String by project
|
|
|
|
val uploadUrl: String by project
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
create<MavenPublication>("maven") {
|
|
|
|
groupId = "com.maddyhome.idea.vim"
|
|
|
|
artifactId = "vim-engine"
|
|
|
|
version = engineVersion
|
|
|
|
from(components["java"])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
url = uri(uploadUrl)
|
|
|
|
credentials {
|
|
|
|
username = spaceUsername
|
|
|
|
password = spacePassword
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|