From e578a662451c9c387ac2d168fc0d7475657646ee Mon Sep 17 00:00:00 2001 From: Mark Donszelmann Date: Mon, 5 Oct 2009 15:00:00 +0200 Subject: Added it0011-executable-dep-lib-static test; Fixed reference to parent in it0008-executable-dep-lib-shared --- .../executable-dep-lib-shared/pom.xml | 2 +- .../executable-dep-lib-static/pom.xml | 69 ++++++++++++++++++++ .../src/main/c/HelloWorldExe.c | 9 +++ .../lib-static/pom.xml | 74 ++++++++++++++++++++++ .../lib-static/src/main/c/HelloWorldLib.c | 7 ++ .../lib-static/src/main/include/HelloWorldLib.h | 6 ++ .../lib-static/src/test/c/HelloWorldTest.c | 9 +++ src/it/it0011-executable-dep-lib-static/pom.xml | 49 ++++++++++++++ src/site/apt/HelloWorld.apt | 10 +-- 9 files changed, 229 insertions(+), 6 deletions(-) create mode 100644 src/it/it0011-executable-dep-lib-static/executable-dep-lib-static/pom.xml create mode 100644 src/it/it0011-executable-dep-lib-static/executable-dep-lib-static/src/main/c/HelloWorldExe.c create mode 100644 src/it/it0011-executable-dep-lib-static/lib-static/pom.xml create mode 100644 src/it/it0011-executable-dep-lib-static/lib-static/src/main/c/HelloWorldLib.c create mode 100644 src/it/it0011-executable-dep-lib-static/lib-static/src/main/include/HelloWorldLib.h create mode 100644 src/it/it0011-executable-dep-lib-static/lib-static/src/test/c/HelloWorldTest.c create mode 100644 src/it/it0011-executable-dep-lib-static/pom.xml diff --git a/src/it/it0008-executable-dep-lib-shared/executable-dep-lib-shared/pom.xml b/src/it/it0008-executable-dep-lib-shared/executable-dep-lib-shared/pom.xml index b1ab9ab..aa3498b 100644 --- a/src/it/it0008-executable-dep-lib-shared/executable-dep-lib-shared/pom.xml +++ b/src/it/it0008-executable-dep-lib-shared/executable-dep-lib-shared/pom.xml @@ -24,7 +24,7 @@ under the License. org.apache.maven.its.nar - it0004-pom + it0008-pom 1.0-SNAPSHOT diff --git a/src/it/it0011-executable-dep-lib-static/executable-dep-lib-static/pom.xml b/src/it/it0011-executable-dep-lib-static/executable-dep-lib-static/pom.xml new file mode 100644 index 0000000..85e7d82 --- /dev/null +++ b/src/it/it0011-executable-dep-lib-static/executable-dep-lib-static/pom.xml @@ -0,0 +1,69 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.nar + it0011-pom + 1.0-SNAPSHOT + + + it0011-executable-dep-lib-static + nar + Maven NAR Executable + 1.0-SNAPSHOT + + Executable + + + + integration-test + + + maven-nar-plugin + true + + + + executable + true + + + + + + maven-surefire-plugin + + true + + + + + + + org.apache.maven.its.nar + it0011-lib-static + 1.0-SNAPSHOT + + + diff --git a/src/it/it0011-executable-dep-lib-static/executable-dep-lib-static/src/main/c/HelloWorldExe.c b/src/it/it0011-executable-dep-lib-static/executable-dep-lib-static/src/main/c/HelloWorldExe.c new file mode 100644 index 0000000..4aa35d8 --- /dev/null +++ b/src/it/it0011-executable-dep-lib-static/executable-dep-lib-static/src/main/c/HelloWorldExe.c @@ -0,0 +1,9 @@ +#include +#include "HelloWorldLib.h" + +int main(int argc, char *argv[]) { + printf("%s\n", HelloWorldLib_sayHello()); + return 0; +} + + diff --git a/src/it/it0011-executable-dep-lib-static/lib-static/pom.xml b/src/it/it0011-executable-dep-lib-static/lib-static/pom.xml new file mode 100644 index 0000000..3ef44a4 --- /dev/null +++ b/src/it/it0011-executable-dep-lib-static/lib-static/pom.xml @@ -0,0 +1,74 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.nar + it0011-pom + 1.0-SNAPSHOT + + + it0011-lib-static + nar + + Maven NAR Static Library + 1.0-SNAPSHOT + + Simple static library and test file + + http://maven.apache.org/ + + + + install + + + maven-nar-plugin + true + + + + static + + + + + HelloWorldTest + static + + + + + + maven-surefire-plugin + + true + + + + + diff --git a/src/it/it0011-executable-dep-lib-static/lib-static/src/main/c/HelloWorldLib.c b/src/it/it0011-executable-dep-lib-static/lib-static/src/main/c/HelloWorldLib.c new file mode 100644 index 0000000..9f65143 --- /dev/null +++ b/src/it/it0011-executable-dep-lib-static/lib-static/src/main/c/HelloWorldLib.c @@ -0,0 +1,7 @@ +#include +#include "HelloWorldLib.h" + +char* HelloWorldLib_sayHello() { + return "Hello NAR LIB World!"; +} + diff --git a/src/it/it0011-executable-dep-lib-static/lib-static/src/main/include/HelloWorldLib.h b/src/it/it0011-executable-dep-lib-static/lib-static/src/main/include/HelloWorldLib.h new file mode 100644 index 0000000..8c50dfb --- /dev/null +++ b/src/it/it0011-executable-dep-lib-static/lib-static/src/main/include/HelloWorldLib.h @@ -0,0 +1,6 @@ +#ifndef HelloWorldLib_H +#define HelloWorldLib_H + +extern char* HelloWorldLib_sayHello(); + +#endif diff --git a/src/it/it0011-executable-dep-lib-static/lib-static/src/test/c/HelloWorldTest.c b/src/it/it0011-executable-dep-lib-static/lib-static/src/test/c/HelloWorldTest.c new file mode 100644 index 0000000..4aa35d8 --- /dev/null +++ b/src/it/it0011-executable-dep-lib-static/lib-static/src/test/c/HelloWorldTest.c @@ -0,0 +1,9 @@ +#include +#include "HelloWorldLib.h" + +int main(int argc, char *argv[]) { + printf("%s\n", HelloWorldLib_sayHello()); + return 0; +} + + diff --git a/src/it/it0011-executable-dep-lib-static/pom.xml b/src/it/it0011-executable-dep-lib-static/pom.xml new file mode 100644 index 0000000..34142a2 --- /dev/null +++ b/src/it/it0011-executable-dep-lib-static/pom.xml @@ -0,0 +1,49 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.nar + it-parent + 1.0-SNAPSHOT + ../it-parent/pom.xml + + + it0011-pom + pom + + Maven NAR Executable and Static Library + 1.0-SNAPSHOT + + Executable depending on a static library. + + + + install + + + + executable-dep-lib-static + lib-static + + diff --git a/src/site/apt/HelloWorld.apt b/src/site/apt/HelloWorld.apt index 2f970f4..3b5fa4d 100644 --- a/src/site/apt/HelloWorld.apt +++ b/src/site/apt/HelloWorld.apt @@ -39,25 +39,25 @@ There are also some unit test which are run and call the same method. [it0007-lib-shared] A C routine which gets archived into a shared library. A C test executable is created. - [it0008-executable-dep-lib-shared] A C executable which depends on "helloworldsharedlib" and links dynamically + [it0008-executable-dep-lib-shared] A C executable which depends on "lib-shared" and links dynamically with it. The executable is created and run. [helloworldsharedlibjni] A C routine called from Java, which depends on - "helloworldsharedlib" and links dynamically with it. + "lib-shared" and links dynamically with it. [] [it0010-lib-static] A C routine which gets archived into a static library. A C test executable is created. - [helloworldstaticlibexe] A C executable which depends on "helloworldstaticlib" and links statically + [it0011-executable-dep-lib-static] A C executable which depends on "lib-static" and links statically with it. The executabe is created and run. [helloworldstaticlibjni] A C routine called from Java, which depends on - "helloworldstaticlib" and links statically with it. A Java unit test is provided. + "lib-static" and links statically with it. A Java unit test is provided. [] - These examples are now all run as integration tests when you try to run maven on the maven-nar-plugin from its top-level directory with the profile "run-its". + These examples are now all run as integration tests by running maven on the maven-nar-plugin from its top-level directory with the profile "run-its". -- cgit v1.2.3