Skip to content

Commit

Permalink
Merge pull request #380 from maven-nar/feature/default-binding
Browse files Browse the repository at this point in the history
Feature default binding supporting multiple bindings static/shared
  • Loading branch information
GregDomjan authored Aug 6, 2021
2 parents 7c33238 + 05994c1 commit b1bcfcf
Show file tree
Hide file tree
Showing 15 changed files with 593 additions and 6 deletions.
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@

<properties>
<invoker.debug>false</invoker.debug>
<invoker.workspace>${project.build.directory}/it</invoker.workspace>
<its.to.skip>dummy</its.to.skip>
<mavenVersion>3.0.4</mavenVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -541,6 +542,7 @@
<artifactId>maven-invoker-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<cloneProjectsTo>${invoker.workspace}</cloneProjectsTo>
<properties>
<jna.nosys>true</jna.nosys>
</properties>
Expand Down
28 changes: 28 additions & 0 deletions src/it/it-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,33 @@
</plugins>
</build>
</profile>
<profile>
<id>java-10+</id>
<activation>
<jdk>[10,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<configuration>
<javah>
<skip>true</skip>
</javah>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArguments>
<h>${project.build.directory}/nar/javah-include</h>
</compilerArguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
75 changes: 75 additions & 0 deletions src/it/it0040-multi-libtype/it0040-dep-lib-default/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
Native ARchive plugin for Maven
%%
Copyright (C) 2002 - 2014 NAR Maven Plugin developers.
%%
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#L%
-->

<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.github.maven-nar.its.nar</groupId>
<artifactId>it0040-pom</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>it0040-dep-lib-default</artifactId>
<packaging>nar</packaging>

<name>NAR Executable and default Library</name>
<version>1.0-SNAPSHOT</version>
<description>
Executable depending on a library from a mixed type with default linkage.
</description>

<properties>
<skipTests>true</skipTests>
</properties>

<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>nar-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<c>
<defines>
<define>LIB_IMPORTS</define>
</defines>
</c>
<libraries>
<library>
<type>executable</type>
<!-- <linkCPP>false</linkCPP> -->
</library>
</libraries>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>com.github.maven-nar.its.nar</groupId>
<artifactId>it0040-lib-sharedstatic</artifactId>
<version>1.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* #%L
* Native ARchive plugin for Maven
* %%
* Copyright (C) 2002 - 2014 NAR Maven Plugin developers.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
#include <stdio.h>
#include "HelloWorldLib.h"

int main(int argc, char *argv[]) {
printf("%s\n", HelloWorldLib_sayHello());
return 0;
}


78 changes: 78 additions & 0 deletions src/it/it0040-multi-libtype/it0040-dep-lib-shared/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
Native ARchive plugin for Maven
%%
Copyright (C) 2002 - 2014 NAR Maven Plugin developers.
%%
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#L%
-->

<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.github.maven-nar.its.nar</groupId>
<artifactId>it0040-pom</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>it0040-dep-lib-shared</artifactId>
<packaging>nar</packaging>

<name>NAR Executable and Shared Library</name>
<version>1.0-SNAPSHOT</version>
<description>
Executable depending on a shared library from a mixed type.
</description>

<properties>
<skipTests>true</skipTests>
</properties>

<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>nar-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<c>
<defines>
<define>LIB_IMPORTS</define>
</defines>
</c>
<libraries>
<library>
<type>executable</type>
<!-- <linkCPP>false</linkCPP> -->
<dependencyBindings>
<dependencyBinding>it0040-lib-sharedstatic:shared</dependencyBinding>
</dependencyBindings>
</library>
</libraries>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>com.github.maven-nar.its.nar</groupId>
<artifactId>it0040-lib-sharedstatic</artifactId>
<version>1.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* #%L
* Native ARchive plugin for Maven
* %%
* Copyright (C) 2002 - 2014 NAR Maven Plugin developers.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
#include <stdio.h>
#include "HelloWorldLib.h"

int main(int argc, char *argv[]) {
printf("%s\n", HelloWorldLib_sayHello());
return 0;
}


73 changes: 73 additions & 0 deletions src/it/it0040-multi-libtype/it0040-dep-lib-static/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
Native ARchive plugin for Maven
%%
Copyright (C) 2002 - 2014 NAR Maven Plugin developers.
%%
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#L%
-->

<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.github.maven-nar.its.nar</groupId>
<artifactId>it0040-pom</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>it0040-dep-lib-static</artifactId>
<packaging>nar</packaging>

<name>NAR Executable and Static Library</name>
<version>1.0-SNAPSHOT</version>
<description>
Executable depending on a static library from a mixed type.
</description>

<properties>
<skipTests>true</skipTests>
</properties>

<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>nar-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<libraries>
<library>
<type>executable</type>
<!-- <linkCPP>false</linkCPP> -->
<dependencyBindings>
<dependencyBinding>it0040-lib-sharedstatic:static</dependencyBinding>
</dependencyBindings>
</library>
</libraries>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>com.github.maven-nar.its.nar</groupId>
<artifactId>it0040-lib-sharedstatic</artifactId>
<version>1.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* #%L
* Native ARchive plugin for Maven
* %%
* Copyright (C) 2002 - 2014 NAR Maven Plugin developers.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
#include <stdio.h>
#include "HelloWorldLib.h"

int main(int argc, char *argv[]) {
printf("%s\n", HelloWorldLib_sayHello());
return 0;
}


Loading

0 comments on commit b1bcfcf

Please sign in to comment.