build.gradle 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import org.elasticsearch.gradle.info.BuildParams
  2. /*
  3. * Licensed to Elasticsearch under one or more contributor
  4. * license agreements. See the NOTICE file distributed with
  5. * this work for additional information regarding copyright
  6. * ownership. Elasticsearch licenses this file to you under
  7. * the Apache License, Version 2.0 (the "License"); you may
  8. * not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing,
  14. * software distributed under the License is distributed on an
  15. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. * KIND, either express or implied. See the License for the
  17. * specific language governing permissions and limitations
  18. * under the License.
  19. */
  20. apply plugin: 'elasticsearch.testclusters'
  21. apply plugin: 'elasticsearch.esplugin'
  22. esplugin {
  23. name 'rest-handler'
  24. description 'An example plugin showing how to register a REST handler'
  25. classname 'org.elasticsearch.example.resthandler.ExampleRestHandlerPlugin'
  26. licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
  27. noticeFile rootProject.file('NOTICE.txt')
  28. }
  29. // No unit tests in this example
  30. test.enabled = false
  31. tasks.register("exampleFixture", org.elasticsearch.gradle.test.AntFixture) {
  32. dependsOn testClasses
  33. env 'CLASSPATH', "${-> project.sourceSets.test.runtimeClasspath.asPath}"
  34. executable = "${BuildParams.runtimeJavaHome}/bin/java"
  35. args 'org.elasticsearch.example.resthandler.ExampleFixture', baseDir, 'TEST'
  36. }
  37. integTest {
  38. dependsOn exampleFixture
  39. runner {
  40. nonInputProperties.systemProperty 'external.address', "${-> exampleFixture.addressAndPort}"
  41. }
  42. }
  43. testingConventions.naming {
  44. IT {
  45. baseClass 'org.elasticsearch.test.ESTestCase'
  46. }
  47. }