diff options
author | Matthew Woehlke <matthew.woehlke@kitware.com> | 2016-05-31 14:51:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-06-07 12:50:36 (GMT) |
commit | 95d84369b802473e22bcb662a86175621bba54c6 (patch) | |
tree | 2ed6f3f24884298ee77fdae27d32f57d6dfc1699 /Tests/JavaExportImport/Import | |
parent | 5341c0d84af50c2ac5e4041885ab96f8d157ddfe (diff) | |
download | CMake-95d84369b802473e22bcb662a86175621bba54c6.zip CMake-95d84369b802473e22bcb662a86175621bba54c6.tar.gz CMake-95d84369b802473e22bcb662a86175621bba54c6.tar.bz2 |
Tests: Add test for exported JARs
Add a unit test to test the new functions to export JAR targets. The
test builds three sub-projects: two that generate and export a JAR (one
does a build-directory-only export, one an install-only export), and a
third that consumes the first two as imported targets.
Diffstat (limited to 'Tests/JavaExportImport/Import')
-rw-r--r-- | Tests/JavaExportImport/Import/CMakeLists.txt | 14 | ||||
-rw-r--r-- | Tests/JavaExportImport/Import/Import.java | 10 |
2 files changed, 24 insertions, 0 deletions
diff --git a/Tests/JavaExportImport/Import/CMakeLists.txt b/Tests/JavaExportImport/Import/CMakeLists.txt new file mode 100644 index 0000000..79a1447 --- /dev/null +++ b/Tests/JavaExportImport/Import/CMakeLists.txt @@ -0,0 +1,14 @@ +project(import Java) + +cmake_minimum_required (VERSION 3.5) +set(CMAKE_VERBOSE_MAKEFILE 1) + +find_package(Java COMPONENTS Development) +include(UseJava) + +find_package(JavaBuildExportTest REQUIRED) +find_package(JavaInstallExportTest REQUIRED) + +add_jar(${PROJECT_NAME} + SOURCES Import.java + INCLUDE_JARS foo bar) diff --git a/Tests/JavaExportImport/Import/Import.java b/Tests/JavaExportImport/Import/Import.java new file mode 100644 index 0000000..08eb03f --- /dev/null +++ b/Tests/JavaExportImport/Import/Import.java @@ -0,0 +1,10 @@ +class Import +{ + public static void main(String args[]) + { + Foo foo = new Foo(); + Bar bar = new Bar(); + foo.printName(); + bar.printName(); + } +} |