java: Added automatic pom file generation

Signed-off-by: Stefan Andritoiu <stefan.andritoiu@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Stefan Andritoiu 2016-09-15 18:12:24 +03:00 committed by Mihai Tudor Panu
parent 353788a645
commit b60ecdd559
3 changed files with 52 additions and 1 deletions

View File

@ -10,7 +10,8 @@ find_package (PkgConfig REQUIRED)
# Force a libmraa search and minimum required version every time a config is generated
unset(MRAA_FOUND CACHE)
pkg_check_modules (MRAA REQUIRED mraa>=1.1.1)
set(MRAA_MINIMUM 1.1.1)
pkg_check_modules (MRAA REQUIRED mraa>=${MRAA_MINIMUM})
message (STATUS "found mraa version: ${MRAA_VERSION}")
# Appends the cmake/modules path to MAKE_MODULE_PATH variable.

View File

@ -158,6 +158,9 @@ macro(upm_swig_java)
COMMAND ${JAR} cvf upm_${libname}.jar upm_${libname}
)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/../pom.xml.in
${CMAKE_CURRENT_BINARY_DIR}/upm_${libname}-${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.pom)
endif()
endmacro(upm_swig_java)

47
src/pom.xml.in Normal file
View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.mraa.upm</groupId>
<artifactId>upm_@libname@</artifactId>
<version>@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@</version>
<packaging>jar</packaging>
<name>@libname@</name>
<description>High level repository for sensors that use mraa</description>
<url>http://upm.mraa.io</url>
<licenses>
<license>
<name>MIT License</name>
<url>https://github.com/intel-iot-devkit/upm/blob/master/LICENSE</url>
</license>
</licenses>
<developers>
<developer>
<name>Upm contributors https://github.com/intel-iot-devkit/upm/graphs/contributors</name>
<email>mraa@lists.01.org</email>
<organization>Intel IoT Developer kit</organization>
<organizationUrl>https://github.com/intel-iot-devkit</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/intel-iot-devkit/upm.git</connection>
<developerConnection>scm:git:ssh://github.com:intel-iot-devkit/upm.git</developerConnection>
<url>https://github.com/intel-iot-devkit/upm/tree/master</url>
</scm>
<dependencies>
<dependency>
<groupId>io.mraa</groupId>
<artifactId>mraa</artifactId>
<version>[@MRAA_MINIMUM@, )</version>
<scope>compile</scope>
</dependecy>
</dependencies>
</project>