-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
629 additions
and
547 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
*.iml | ||
\.* | ||
!.travis.yml | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Medcl | ||
Copyright 2012-2021 Medcl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
import java.nio.file.Files | ||
import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask | ||
import org.gradle.api.tasks.Input; | ||
import org.gradle.process.CommandLineArgumentProvider; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
import java.util.function.Supplier; | ||
import java.util.stream.Collectors; | ||
|
||
buildscript { | ||
dependencies { | ||
classpath "org.opensearch.gradle:build-tools:${opensearchVersion}" | ||
} | ||
} | ||
|
||
plugins { | ||
id "co.riiid.gradle" version "0.4.2" | ||
// the old co.riiid.gradle is not gradle 7.0 compatible | ||
// id "com.github.humblerookie.gradle" version "0.4.4" | ||
id "com.github.ben-manes.versions" version '0.36.0' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
group = 'org.opensearch.plugin' | ||
version = "${opensearchVersion}" | ||
|
||
apply plugin: 'java' | ||
apply plugin: 'idea' | ||
apply plugin: 'opensearch.opensearchplugin' | ||
apply plugin: 'opensearch.testclusters' | ||
|
||
opensearchplugin { | ||
name = 'opensearch-analisys-ik' | ||
description = 'IK Analysis for OpenSearch' | ||
classname = 'org.opensearch.plugin.analysis.ik.AnalysisIkPlugin' | ||
licenseFile = rootProject.file('LICENSE.txt') | ||
noticeFile = rootProject.file('NOTICE.txt') | ||
} | ||
|
||
|
||
// In this section you declare the dependencies for your production and test code | ||
dependencies { | ||
|
||
compile 'org.apache.httpcomponents:httpclient:4.5.2' | ||
|
||
runtimeOnly 'org.apache.logging.log4j:log4j-api:2.3' | ||
// testCompile 'org.hamcrest:hamcrest-core:1.3' | ||
// testCompile 'org.hamcrest:hamcrest-library:1.3' | ||
// testCompile 'org.powermock:powermock-module-junit4:1.6.2' | ||
testCompile 'org.powermock:powermock-api-mockito:1.6.2' | ||
testCompile 'nl.jqno.equalsverifier:equalsverifier:1.7.5' | ||
testCompile 'com.openpojo:openpojo:0.8.1' | ||
// testImplementation("org.opensearch.test", "framework", opensearchVersion) | ||
// // testCompile 'junit:junit:4.4' | ||
// testImplementation("junit", "junit" , "4.12") { | ||
// exclude(group = "org.hamcrest") | ||
// } | ||
} | ||
|
||
// ignore javadoc warnings for now | ||
tasks.withType(Javadoc) { | ||
options.addStringOption('Xdoclint:none', '-quiet') | ||
} | ||
|
||
githubRelease.doFirst { | ||
if (!System.getProperty('GITHUB_TOKEN', '')) { | ||
throw new Exception('Missing property GITHUB_TOKEN') | ||
} | ||
|
||
// check if zip file is there | ||
assert file("build/distributions/opensearch-analisys-ik-${version}.zip").exists() | ||
|
||
// rename zip file | ||
def currentVersion = version.replace('-SNAPSHOT', '') | ||
def filename = "build/distributions/opensearch-analisys-ik-${version}.zip" | ||
Files.copy(file("build/distributions/opensearch-analisys-ik-${version}.zip").toPath(), file(filename).toPath()) | ||
|
||
// configuration | ||
github { | ||
owner = 'aparo' | ||
repo = 'opensearch-analisys-ik' | ||
token = System.getProperty('GITHUB_TOKEN') | ||
tagName = currentVersion | ||
assets = [ filename ] | ||
targetCommitish = 'main' | ||
} | ||
} | ||
|
||
test { | ||
|
||
//How to run Gradle test when all tests are UP-TO-DATE? add below line | ||
dependsOn 'cleanTest' | ||
//To enable this fail fast behavior so even a one unit test fail it keeps running | ||
failFast = true | ||
|
||
// Give a different location to the gradle html reports in a folder called gradlehtmlReports | ||
reports.html.enabled = true | ||
reports.html.setDestination(file("$projectDir/gradlehtmlReports")) | ||
} | ||
|
||
// // setup yaml rest tests | ||
// testClusters { | ||
// yamlRestTest | ||
// } | ||
|
||
// sourceSets { | ||
// yamlRestTest | ||
// } | ||
|
||
// configurations { | ||
// yamlRestTestImplementation.extendsFrom testImplementation | ||
// yamlRestTestRuntimeOnly.extendsFrom testRuntimeOnly | ||
// restTestSpecs | ||
// } | ||
|
||
// tasks.register('copyRestTestSpecs', Copy) { | ||
// from zipTree(configurations.restTestSpecs.singleFile) | ||
// into "$buildDir/restResources/restspec" | ||
// } | ||
|
||
// TaskProvider<Zip> bundle = project.getTasks().withType(Zip.class).named("bundlePlugin"); | ||
|
||
// // Register rest resources with source set | ||
// sourceSets.yamlRestTest.getOutput().dir("$buildDir/restResources/restspec"); | ||
|
||
// tasks.register('yamlRestTest', StandaloneRestIntegTestTask) { testTask -> | ||
// testTask.dependsOn(bundle, 'copyRestTestSpecs') | ||
|
||
// def cluster = testClusters.yamlRestTest | ||
// cluster.plugin(bundle.flatMap(AbstractArchiveTask::getArchiveFile)) | ||
// testTask.useCluster(testClusters.yamlRestTest) | ||
|
||
// testTask.mustRunAfter(project.getTasks().named("test")) | ||
// testTask.setTestClassesDirs(sourceSets.yamlRestTest.getOutput().getClassesDirs()) | ||
// testTask.setClasspath(sourceSets.yamlRestTest.getRuntimeClasspath()) | ||
|
||
|
||
// SystemPropertyCommandLineArgumentProvider nonInputProperties = new SystemPropertyCommandLineArgumentProvider() | ||
// nonInputProperties.systemProperty("tests.rest.cluster", "${-> String.join(",", cluster.getAllHttpSocketURI())}") | ||
// nonInputProperties.systemProperty("tests.cluster", "${-> String.join(",", cluster.getAllTransportPortURI())}") | ||
// nonInputProperties.systemProperty("tests.clustername", "${-> cluster.getName()}") | ||
// testTask.getJvmArgumentProviders().add(nonInputProperties) | ||
// testTask.systemProperty("tests.rest.load_packaged", Boolean.FALSE.toString()) | ||
// } | ||
|
||
// // this is a bit of a hack to make sure we run the test tests when releasing... | ||
// check.dependsOn 'yamlRestTest' | ||
|
||
// dependencies { | ||
// yamlRestTestImplementation "org.opensearch.test:framework:$opensearchVersion" | ||
// restTestSpecs "org.opensearch:rest-api-spec:$opensearchVersion" | ||
// } | ||
|
||
// // This will be available in 7.15 in build tools and not manually declared. | ||
// public class SystemPropertyCommandLineArgumentProvider implements CommandLineArgumentProvider { | ||
// private final Map<String, Object> systemProperties = new LinkedHashMap<>(); | ||
|
||
// public void systemProperty(String key, Supplier<String> value) { | ||
// systemProperties.put(key, value); | ||
// } | ||
|
||
// public void systemProperty(String key, Object value) { | ||
// systemProperties.put(key, value); | ||
// } | ||
|
||
// @Override | ||
// public Iterable<String> asArguments() { | ||
// return systemProperties.entrySet() | ||
// .stream() | ||
// .map( | ||
// entry -> "-D" | ||
// + entry.getKey() | ||
// + "=" | ||
// + (entry.getValue() instanceof Supplier ? ((Supplier) entry.getValue()).get() : entry.getValue()) | ||
// ) | ||
// .collect(Collectors.toList()); | ||
// } | ||
|
||
// // Track system property keys as an input so our build cache key will change if we add properties but values are still ignored | ||
// @Input | ||
// public Iterable<String> getPropertyNames() { | ||
// return systemProperties.keySet(); | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
opensearchVersion = 1.1.0 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.