elasticsearch/plugins/examples/rest-handler/build.gradle

36 lines
1.4 KiB
Groovy

import org.elasticsearch.gradle.info.BuildParams
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
apply plugin: 'elasticsearch.esplugin'
apply plugin: 'elasticsearch.yaml-rest-test'
apply plugin: 'elasticsearch.java-rest-test'
esplugin {
name 'rest-handler'
description 'An example plugin showing how to register a REST handler'
classname 'org.elasticsearch.example.resthandler.ExampleRestHandlerPlugin'
licenseFile rootProject.file('licenses/SSPL-1.0+ELASTIC-LICENSE-2.0.txt')
noticeFile rootProject.file('NOTICE.txt')
}
// No unit tests in this example
tasks.named("test").configure { enabled = false }
def fixture = tasks.register("exampleFixture", org.elasticsearch.gradle.test.AntFixture) {
dependsOn sourceSets.javaRestTest.runtimeClasspath
env 'CLASSPATH', "${-> project.sourceSets.javaRestTest.runtimeClasspath.asPath}"
executable = "${BuildParams.runtimeJavaHome}/bin/java"
args 'org.elasticsearch.example.resthandler.ExampleFixture', baseDir, 'TEST'
}
tasks.named("javaRestTest").configure {
dependsOn fixture
nonInputProperties.systemProperty 'external.address', "${-> fixture.get().addressAndPort}"
}