-
-
Notifications
You must be signed in to change notification settings - Fork 45
Upgrade to Elasticsearch 9.1.4 #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
1459ea9
0ddb019
2b42f49
2cb948b
6dd1813
addb438
4a1b634
da2b0c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,9 +2,9 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget | |
|
|
||
| plugins { | ||
| id 'java-library' | ||
| id 'org.jetbrains.kotlin.jvm' version '1.8.0' | ||
| id "org.jetbrains.kotlin.plugin.serialization" version "1.8.0" | ||
| id 'com.diffplug.spotless' version '6.16.0' | ||
| id 'org.jetbrains.kotlin.jvm' version '2.0.0' | ||
| id "org.jetbrains.kotlin.plugin.serialization" version '2.0.0' | ||
| id 'com.diffplug.spotless' version '6.25.0' | ||
| id 'org.sonarqube' version '4.0.0.2929' | ||
| id("org.jetbrains.kotlinx.kover") version "0.7.0" | ||
| id 'com.worksap.nlp.sudachi.esc' | ||
|
|
@@ -13,15 +13,20 @@ plugins { | |
| } | ||
|
|
||
| group = 'com.worksap.nlp' | ||
| archivesBaseName = 'analysis-sudachi' | ||
| base.archivesName.set('analysis-sudachi') | ||
| version = properties["pluginVersion"] | ||
|
|
||
| java { | ||
| sourceCompatibility = JavaVersion.VERSION_21 | ||
| targetCompatibility = JavaVersion.VERSION_21 | ||
| } | ||
|
|
||
| compileKotlin { | ||
| compilerOptions.jvmTarget.set(JvmTarget.JVM_11) | ||
| compilerOptions.jvmTarget.set(JvmTarget.JVM_21) | ||
| } | ||
|
|
||
| compileTestKotlin { | ||
| compilerOptions.jvmTarget.set(JvmTarget.JVM_11) | ||
| compilerOptions.jvmTarget.set(JvmTarget.JVM_21) | ||
| } | ||
|
|
||
| configurations { | ||
|
|
@@ -39,7 +44,9 @@ sourceSets { | |
| } | ||
|
|
||
| dependencies { | ||
| spi(project(':spi')) | ||
| implementation(project(':spi')) | ||
| implementation('com.worksap.nlp:sudachi:0.7.4') | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is required to load the sudachi jar in ES9. We can't use the previous dynamic loading anymore due to |
||
|
|
||
| testImplementation(project(':testlib')) | ||
| testImplementation('org.apache.logging.log4j:log4j-core:2.17.2') | ||
| testImplementation('org.jetbrains.kotlin:kotlin-test-junit') { | ||
|
|
@@ -52,13 +59,16 @@ dependencies { | |
|
|
||
| def embedVersion = tasks.register('embedVersion', Copy) { | ||
| var esKind = sudachiEs.kind.get() | ||
| from 'src/main/extras/plugin-descriptor.properties' | ||
| from('src/main/extras/plugin-descriptor.properties') { | ||
| expand([ | ||
| version: version, | ||
| engineVersion: esKind.version, | ||
| engineKind: esKind.engine.kind | ||
| ]) | ||
| } | ||
| // Include entitlement policy for Elasticsearch 9+ | ||
| from('src/main/extras/entitlement-policy.yaml') | ||
| into "build/package/${version}/${esKind.engine.kind}-${esKind.version}" | ||
| expand([ | ||
| version: version, | ||
| engineVersion: esKind.version, | ||
| engineKind: esKind.engine.kind | ||
| ]) | ||
| inputs.property("version", version) | ||
| inputs.property("elasticSearchVersion", esKind.version) | ||
| } | ||
|
|
@@ -74,17 +84,13 @@ def packageJars = tasks.register('packageJars', Copy) { | |
| def packageSpiJars = tasks.register('packageSpiJars', Copy) { | ||
| from configurations.spi | ||
| var esKind = sudachiEs.kind.get() | ||
| if (sudachiEs.hasPluginSpiSupport()) { | ||
| into "build/package/${version}/${esKind.engine.kind}-${esKind.version}/spi" | ||
| } else { | ||
| into "build/package/${version}/${esKind.engine.kind}-${esKind.version}" | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above, we can't do dynamic loading due to |
||
| into "build/package/${version}/${esKind.engine.kind}-${esKind.version}" | ||
| } | ||
|
|
||
| def distZip = tasks.register('distZip', Zip) { | ||
| var esKind = sudachiEs.kind.get() | ||
| dependsOn embedVersion, packageJars, packageSpiJars | ||
| archiveBaseName.set("${esKind.engine.kind}-${esKind.version}-$archivesBaseName") | ||
| archiveBaseName.set("${esKind.engine.kind}-${esKind.version}-${base.archivesName.get()}") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a deprecation fix in gradle |
||
| from("build/package/${version}/${esKind.engine.kind}-${esKind.version}", 'LICENSE', 'README.md') | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,14 +24,18 @@ import java.util.zip.ZipFile | |
|
|
||
| class EsTestEnvExtension { | ||
| Path bundlePath = null | ||
| Path systemDic = null | ||
| Path configFile = null | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are now handled by |
||
| List<Path> additionalJars = new ArrayList<>() | ||
| List<PluginDescriptor> additionalPlugins = new ArrayList<>() | ||
| List<ConfigFileDescriptor> configFiles = new ArrayList<>() | ||
|
|
||
| void addPlugin(String name, Object value) { | ||
| additionalPlugins.add(new PluginDescriptor(name: name, value: value)) | ||
| } | ||
|
|
||
| void addConfigFile(Path sourcePath, String targetName = null) { | ||
| def target = targetName ?: sourcePath.fileName.toString() | ||
| configFiles.add(new ConfigFileDescriptor(source: sourcePath, target: target)) | ||
| } | ||
| } | ||
|
|
||
| class PluginDescriptor { | ||
|
|
@@ -49,6 +53,11 @@ class PluginDescriptor { | |
| } | ||
| } | ||
|
|
||
| class ConfigFileDescriptor { | ||
| Path source | ||
| String target | ||
| } | ||
|
|
||
| class StringProvider implements Provider<String>, Serializable { | ||
| private static final long serialVersionUID = 42L | ||
| String value | ||
|
|
@@ -103,6 +112,10 @@ class StringProvider implements Provider<String>, Serializable { | |
| throw new IllegalStateException("not implemented") | ||
| } | ||
|
|
||
| @Override | ||
| Provider<String> filter(org.gradle.api.specs.Spec<? super String> spec) { | ||
| throw new IllegalStateException("not implemented") | ||
| } | ||
|
|
||
| @Override | ||
| String toString() { | ||
|
|
@@ -153,9 +166,10 @@ class EsTestEnvPlugin implements Plugin<Project> { | |
| target.gradle.taskGraph.whenReady { | ||
| boolean shouldRun = false | ||
| if (target.plugins.findPlugin(EsSudachiPlugin.class) != null) { | ||
| shouldRun = shouldTestsRun(target.extensions.getByType(EsExtension).kind.get()) | ||
| def kind = target.extensions.getByType(EsExtension).kind.get() | ||
| shouldRun = shouldTestsRun(kind) | ||
| } | ||
| target.tasks.findAll().forEach { Task task -> | ||
| target.tasks.withType(Test).forEach { Test task -> | ||
| task.onlyIf { shouldRun } | ||
| } | ||
| } | ||
|
|
@@ -202,8 +216,9 @@ class EsTestEnvPlugin implements Plugin<Project> { | |
|
|
||
| def sudachiConfigDir = configPath.resolve("sudachi") | ||
| Files.createDirectories(sudachiConfigDir) | ||
| Files.copy(ext.systemDic, sudachiConfigDir.resolve("system_core.dic")) | ||
| Files.copy(ext.configFile, sudachiConfigDir.resolve("sudachi.json")) | ||
| for (ConfigFileDescriptor config in ext.configFiles) { | ||
| Files.copy(config.source, sudachiConfigDir.resolve(config.target)) | ||
| } | ||
|
|
||
| return rootPath | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip | ||
| networkTimeout=10000 | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JVM 21 is required by ES9