@@ -13,22 +13,33 @@ plugins {
1313
1414version = properties[" pluginVersion" ]
1515
16+ java {
17+ sourceCompatibility = JavaVersion . VERSION_21
18+ targetCompatibility = JavaVersion . VERSION_21
19+ }
20+
1621compileKotlin {
17- compilerOptions. jvmTarget. set(JvmTarget . JVM_11 )
22+ compilerOptions. jvmTarget. set(JvmTarget . JVM_21 )
1823}
1924
2025compileTestKotlin {
21- compilerOptions. jvmTarget. set(JvmTarget . JVM_11 )
26+ compilerOptions. jvmTarget. set(JvmTarget . JVM_21 )
2227}
2328
2429configurations { buildSudachiDict }
2530
2631dependencies {
2732 buildSudachiDict (project(' :spi' ))
28- compileOnly(project(' :' ))
29- compileOnly(project(' :spi' ))
30- testCompileOnly(project(' :testlib' ))
31- testCompileOnly(project(' :subplugin' ))
33+ testImplementation(project(' :' ))
34+ testImplementation(project(' :spi' ))
35+ testImplementation(project(' :testlib' ))
36+ testImplementation(project(' :subplugin' ))
37+ // Add ICU plugin JARs for ES 9.x dynamic loading
38+ testRuntimeOnly files({
39+ fileTree(dir : new File (project. buildDir, " cache/icu-plugin-extracted" ), include : ' **/*.jar' )
40+ }) {
41+ builtBy ' extractIcuPlugin'
42+ }
3243 testImplementation(' junit:junit:4.13.1' ) {
3344 transitive = false
3445 }
@@ -65,6 +76,12 @@ def downloadIcuPlugin = tasks.register('downloadIcuPlugin', Download.class) {
6576 overwrite(false )
6677}
6778
79+ def extractIcuPlugin = tasks. register(' extractIcuPlugin' , Copy ) {
80+ dependsOn downloadIcuPlugin
81+ from zipTree(downloadIcuPlugin. get(). dest)
82+ into new File (project. buildDir, " cache/icu-plugin-extracted" )
83+ }
84+
6885esTestEnv {
6986 def esKind = sudachiEs. kind. get()
7087 def packageDir = rootDir. toPath(). resolve(" build/package/${ version} /${ esKind.engine.kind} -${ esKind.version} " )
@@ -77,7 +94,6 @@ esTestEnv {
7794}
7895
7996test {
80- onlyIf { ! (sudachiEs. isEs() && sudachiEs. kind. get(). parsedVersion(). ge(8 , 9 )) }
8197 dependsOn(
8298 ' :packageJars' ,
8399 ' :packageSpiJars' ,
@@ -86,6 +102,7 @@ test {
86102 compileSystemDictionary,
87103 ' :testlib:jar' ,
88104 downloadIcuPlugin,
105+ extractIcuPlugin,
89106 ' :subplugin:distZip'
90107 )
91108 systemProperty(" tests.security.manager" , true )
@@ -94,7 +111,7 @@ test {
94111
95112def distZip = tasks. register(' distZip' , Zip ) {
96113 var esKind = sudachiEs. kind. get()
97- archiveBaseName. set(" ${ esKind.engine.kind} -${ esKind.version} -$a rchivesBaseName " )
114+ archiveBaseName. set(" ${ esKind.engine.kind} -${ esKind.version} -${ project.name } " )
98115 from(
99116 project(' :subplugin' ). packageJars. outputs. files,
100117 project(' :subplugin' ). embedVersion. outputs. files,
0 commit comments