MPNATIVE-7
Submitted By: Joachim Bader Add support for native dependencies and Add support for optional include path (includepath/sysincludepath) git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@116138 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
c3933eb9ff
commit
1fedf1acfc
6 files changed
+149
-1
No files matched your search
+40
-1
@@ -90,6 +90,45 @@
|
||||
<includepath location="${java.home}/../include/${maven.native.include.os}"/>
|
||||
<includepath location="${maven.build.dir}/native/jni"/>
|
||||
</j:if>
|
||||
|
||||
<util:tokenize var="includePathList" delim=" " trim="true">${maven.native.compile.includepath}</util:tokenize>
|
||||
<j:forEach var="includePath" items="${includePathList}">
|
||||
<includepath location="${includePath}"/>
|
||||
</j:forEach>
|
||||
|
||||
<util:tokenize var="sysincludePathList" delim=" " trim="true">${maven.native.compile.sysincludepath}</util:tokenize>
|
||||
<j:forEach var="sysincludePath" items="${sysincludePathList}">
|
||||
<sysincludepath location="${sysincludePath}"/>
|
||||
</j:forEach>
|
||||
|
||||
<!-- add depended libraries -->
|
||||
<j:forEach var="lib" items="${pom.artifacts}">
|
||||
<j:set var="dep" value="${lib.dependency}"/>
|
||||
|
||||
<!-- include sos-->
|
||||
<j:if test="${dep.type=='so'}">
|
||||
<j:set var="delim" value="lib"/>
|
||||
|
||||
<!-- replace ${delim} in the name -->
|
||||
<util:tokenize var="libnameTokenizer" delim="${delim}" trim="true">${dep.artifactId}</util:tokenize>
|
||||
<j:forEach var="libnamePart" items="${libnameTokenizer}" varStatus="index">
|
||||
<j:if test="${index == 0}">
|
||||
<j:set var="libname" value="${libnamePart}"/>
|
||||
</j:if>
|
||||
<j:if test="${index > 0}">
|
||||
<j:set var="libname" value="${libname}${delim}${libnamePart}"/>
|
||||
</j:if>
|
||||
</j:forEach>
|
||||
|
||||
<!-- use syslibst or libset -->
|
||||
<j:if test="${dep.getProperty('native.syslib') != 'true'}">
|
||||
<libset dir="${lib.file.parent}" libs="${libname}-${dep.version}"/>
|
||||
</j:if>
|
||||
<j:if test="${dep.getProperty('native.syslib') == 'true'}">
|
||||
<syslibset dir="${lib.file.parent}" libs="${libname}-${dep.version}"/>
|
||||
</j:if>
|
||||
</j:if>
|
||||
</j:forEach>
|
||||
</cc>
|
||||
|
||||
<!-- just copy the file don't move because we don't want the compiler to compile if for no reason -->
|
||||
@@ -112,7 +151,7 @@
|
||||
artifactDirectory = '${pom.artifactDirectory}'
|
||||
</ant:echo>
|
||||
|
||||
<ant:property name="libdir__" value="${maven.repo.local}/${pom.artifactDirectory}/so"/>
|
||||
<ant:property name="libdir__" value="${maven.repo.local}/${pom.artifactDirectory}/sos"/>
|
||||
<ant:mkdir dir="${libdir__}"/>
|
||||
<ant:copy file="${maven.build.dir}/native/lib${pom.artifactId}-${pom.currentVersion}.so" tofile="${libdir__}/lib${pom.artifactId}-${pom.currentVersion}.so" overwrite="true"/>
|
||||
</goal>
|
||||
|
||||
Reference in new issue
Block a user