blob: ca078d25eb4d399e9b38e04486e5f46385ee70fb [file] [log] [blame]
Marc Kupietz4f6ed422024-03-01 07:27:46 +01001plugins {
2 // Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
Marc Kupietzde917592025-10-31 15:44:27 +01003 id 'org.jetbrains.kotlin.jvm' version '2.2.21'
Marc Kupietz4f6ed422024-03-01 07:27:46 +01004
5 // Apply the application plugin to add support for building a CLI application in Java.
6 id 'application'
Marc Kupietz1b595992024-03-01 14:54:30 +01007 id 'com.github.johnrengelman.shadow' version '8.1.1'
Marc Kupietz4f6ed422024-03-01 07:27:46 +01008}
9
Marc Kupietz4f6ed422024-03-01 07:27:46 +010010repositories {
Marc Kupietz4f6ed422024-03-01 07:27:46 +010011 mavenCentral()
Marc Kupietz56a45562024-03-20 20:18:08 +010012 maven { url 'https://jitpack.io' }
Marc Kupietz4f6ed422024-03-01 07:27:46 +010013}
14
Marc Kupietz47b43c32024-03-27 20:43:32 +010015test {
Marc Kupietzfc18d282025-08-31 12:07:46 +020016 minHeapSize = "512m"
17 maxHeapSize = "4096m"
18 jvmArgs '-XX:MaxMetaspaceSize=1024m'
Marc Kupietz47b43c32024-03-27 20:43:32 +010019}
20
Marc Kupietz4f6ed422024-03-01 07:27:46 +010021dependencies {
22 // Align versions of all Kotlin components
23 implementation platform('org.jetbrains.kotlin:kotlin-bom')
24
25 // Use the Kotlin JDK 8 standard library.
26 implementation 'org.jetbrains.kotlin:kotlin-stdlib'
Marc Kupietzfc18d282025-08-31 12:07:46 +020027 implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2'
Marc Kupietz4f6ed422024-03-01 07:27:46 +010028
29 // This dependency is used by the application.
Marc Kupietzde917592025-10-31 15:44:27 +010030 implementation 'com.google.guava:guava:33.5.0-jre'
Marc Kupietz4f6ed422024-03-01 07:27:46 +010031
Marc Kupietz31122362024-03-02 11:13:37 +010032
Marc Kupietzfc18d282025-08-31 12:07:46 +020033 implementation ("info.picocli:picocli:4.7.7")
Marc Kupietz31122362024-03-02 11:13:37 +010034
Marc Kupietz4f6ed422024-03-01 07:27:46 +010035 // Use the Kotlin test library.
36 testImplementation 'org.jetbrains.kotlin:kotlin-test'
37
38 // Use the Kotlin JUnit integration.
39 testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
Marc Kupietzde917592025-10-31 15:44:27 +010040 testImplementation "org.jetbrains.kotlin:kotlin-test:2.2.21"
Marc Kupietz0c6e8772024-03-19 07:03:07 +010041
Marc Kupietz1465ce22024-03-26 09:51:17 +010042 implementation 'com.github.kupietz:cistern:v1.0.4'
Marc Kupietzaf682a42024-03-22 06:51:55 +010043 implementation 'org.maltparser:maltparser:1.9.2'
Marc Kupietzde917592025-10-31 15:44:27 +010044 implementation 'org.apache.opennlp:opennlp-tools:2.5.6'
Marc Kupietzfc18d282025-08-31 12:07:46 +020045 implementation 'org.slf4j:slf4j-simple:2.0.17'
Marc Kupietz916bdfe2024-09-20 09:02:57 +020046 implementation 'org.apache.ant:ant:1.10.15'
Marc Kupietzfc18d282025-08-31 12:07:46 +020047 implementation 'org.apache.commons:commons-compress:1.28.0'
Marc Kupietza92bacb2024-04-06 20:26:05 +020048
Marc Kupietz4f6ed422024-03-01 07:27:46 +010049}
50
Marc Kupietz8d875cc2025-10-31 15:36:33 +010051// Erzwinge JDK 21 Toolchain und Bytecode-Level 21
52java {
53 toolchain {
54 languageVersion = JavaLanguageVersion.of(21)
55 }
56}
Marc Kupietz4f6ed422024-03-01 07:27:46 +010057
Marc Kupietz8d875cc2025-10-31 15:36:33 +010058kotlin {
59 jvmToolchain(21)
60}
61
62// Für evtl. vorhandenen Java-Quellcode
63tasks.withType(JavaCompile).configureEach {
64 options.release = 21
65}
66
67tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
68 kotlinOptions {
69 jvmTarget = "21"
70 // Falls verfügbar, sorgt dies für konsistente API-Targets ähnlich zu Java --release
71 // freeCompilerArgs += ["-Xjdk-release=21"]
72 }
73}
Marc Kupietz9da19db2024-04-01 11:06:51 +020074
Marc Kupietz4f6ed422024-03-01 07:27:46 +010075application {
76 // Define the main class for the application.
Marc Kupietz07c60d32025-01-21 19:32:48 +010077 mainClass = 'de.ids_mannheim.korapxmltools.KorapXmlToolKt'
Marc Kupietz4f6ed422024-03-01 07:27:46 +010078}
79
80jar {
81 // Will include every single one of your dependencies, project or not
Marc Kupietzfb0a2ca2024-03-01 12:38:05 +010082 // def lowerCasedName = baseName.toLowerCase()
83 // def normalizedName = lowerCasedName.substring(0,1).toUpperCase() + lowerCasedName.substring(1)
Marc Kupietz4f6ed422024-03-01 07:27:46 +010084
85 manifest.attributes(
86 'Class-Path': configurations.compileClasspath.collect { it.getName() }.join(' '),
Marc Kupietzde917592025-10-31 15:44:27 +010087 'Main-Class': "de.ids_mannheim.korapxmltools.KorapXmlToolKt",
88 'Implementation-Title': rootProject.name,
89 'Implementation-Version': project.version
Marc Kupietz4f6ed422024-03-01 07:27:46 +010090 )
Marc Kupietz1b595992024-03-01 14:54:30 +010091 shadowJar {
Marc Kupietz07c60d32025-01-21 19:32:48 +010092 archiveBaseName.set('korapxmltool')
Marc Kupietz1b595992024-03-01 14:54:30 +010093 archiveClassifier.set('')
Marc Kupietzde917592025-10-31 15:44:27 +010094 // Version ins Dateinamen aufnehmen
95 archiveVersion.set(project.version.toString())
96 manifest.attributes(
97 'Main-Class': "de.ids_mannheim.korapxmltools.KorapXmlToolKt",
98 'Implementation-Title': rootProject.name,
99 'Implementation-Version': project.version
100 )
Marc Kupietz1b595992024-03-01 14:54:30 +0100101 }
Marc Kupietz4f6ed422024-03-01 07:27:46 +0100102}
103
104
105configurations {
106 runtimeLib.extendsFrom implementation
107}