Skip to content

Commit b1bcfcf

Browse files
authored
Merge pull request #380 from maven-nar/feature/default-binding
Feature default binding supporting multiple bindings static/shared
2 parents 7c33238 + 05994c1 commit b1bcfcf

File tree

15 files changed

+593
-6
lines changed

15 files changed

+593
-6
lines changed

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116

117117
<properties>
118118
<invoker.debug>false</invoker.debug>
119+
<invoker.workspace>${project.build.directory}/it</invoker.workspace>
119120
<its.to.skip>dummy</its.to.skip>
120121
<mavenVersion>3.0.4</mavenVersion>
121122
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -541,6 +542,7 @@
541542
<artifactId>maven-invoker-plugin</artifactId>
542543
<version>3.2.0</version>
543544
<configuration>
545+
<cloneProjectsTo>${invoker.workspace}</cloneProjectsTo>
544546
<properties>
545547
<jna.nosys>true</jna.nosys>
546548
</properties>

src/it/it-parent/pom.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,33 @@
8888
</plugins>
8989
</build>
9090
</profile>
91+
<profile>
92+
<id>java-10+</id>
93+
<activation>
94+
<jdk>[10,)</jdk>
95+
</activation>
96+
<build>
97+
<plugins>
98+
<plugin>
99+
<groupId>com.github.maven-nar</groupId>
100+
<artifactId>nar-maven-plugin</artifactId>
101+
<configuration>
102+
<javah>
103+
<skip>true</skip>
104+
</javah>
105+
</configuration>
106+
</plugin>
107+
<plugin>
108+
<groupId>org.apache.maven.plugins</groupId>
109+
<artifactId>maven-compiler-plugin</artifactId>
110+
<configuration>
111+
<compilerArguments>
112+
<h>${project.build.directory}/nar/javah-include</h>
113+
</compilerArguments>
114+
</configuration>
115+
</plugin>
116+
</plugins>
117+
</build>
118+
</profile>
91119
</profiles>
92120
</project>
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
#%L
4+
Native ARchive plugin for Maven
5+
%%
6+
Copyright (C) 2002 - 2014 NAR Maven Plugin developers.
7+
%%
8+
Licensed under the Apache License, Version 2.0 (the "License");
9+
you may not use this file except in compliance with the License.
10+
You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing, software
15+
distributed under the License is distributed on an "AS IS" BASIS,
16+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
See the License for the specific language governing permissions and
18+
limitations under the License.
19+
#L%
20+
-->
21+
22+
<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">
23+
<modelVersion>4.0.0</modelVersion>
24+
25+
<parent>
26+
<groupId>com.github.maven-nar.its.nar</groupId>
27+
<artifactId>it0040-pom</artifactId>
28+
<version>1.0-SNAPSHOT</version>
29+
</parent>
30+
31+
<artifactId>it0040-dep-lib-default</artifactId>
32+
<packaging>nar</packaging>
33+
34+
<name>NAR Executable and default Library</name>
35+
<version>1.0-SNAPSHOT</version>
36+
<description>
37+
Executable depending on a library from a mixed type with default linkage.
38+
</description>
39+
40+
<properties>
41+
<skipTests>true</skipTests>
42+
</properties>
43+
44+
<build>
45+
<plugins>
46+
<plugin>
47+
<groupId>@project.groupId@</groupId>
48+
<artifactId>nar-maven-plugin</artifactId>
49+
<extensions>true</extensions>
50+
<configuration>
51+
<c>
52+
<defines>
53+
<define>LIB_IMPORTS</define>
54+
</defines>
55+
</c>
56+
<libraries>
57+
<library>
58+
<type>executable</type>
59+
<!-- <linkCPP>false</linkCPP> -->
60+
</library>
61+
</libraries>
62+
</configuration>
63+
</plugin>
64+
</plugins>
65+
</build>
66+
67+
<dependencies>
68+
<dependency>
69+
<groupId>com.github.maven-nar.its.nar</groupId>
70+
<artifactId>it0040-lib-sharedstatic</artifactId>
71+
<version>1.0-SNAPSHOT</version>
72+
<type>nar</type>
73+
</dependency>
74+
</dependencies>
75+
</project>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* #%L
3+
* Native ARchive plugin for Maven
4+
* %%
5+
* Copyright (C) 2002 - 2014 NAR Maven Plugin developers.
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
#include <stdio.h>
21+
#include "HelloWorldLib.h"
22+
23+
int main(int argc, char *argv[]) {
24+
printf("%s\n", HelloWorldLib_sayHello());
25+
return 0;
26+
}
27+
28+
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
#%L
4+
Native ARchive plugin for Maven
5+
%%
6+
Copyright (C) 2002 - 2014 NAR Maven Plugin developers.
7+
%%
8+
Licensed under the Apache License, Version 2.0 (the "License");
9+
you may not use this file except in compliance with the License.
10+
You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing, software
15+
distributed under the License is distributed on an "AS IS" BASIS,
16+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
See the License for the specific language governing permissions and
18+
limitations under the License.
19+
#L%
20+
-->
21+
22+
<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">
23+
<modelVersion>4.0.0</modelVersion>
24+
25+
<parent>
26+
<groupId>com.github.maven-nar.its.nar</groupId>
27+
<artifactId>it0040-pom</artifactId>
28+
<version>1.0-SNAPSHOT</version>
29+
</parent>
30+
31+
<artifactId>it0040-dep-lib-shared</artifactId>
32+
<packaging>nar</packaging>
33+
34+
<name>NAR Executable and Shared Library</name>
35+
<version>1.0-SNAPSHOT</version>
36+
<description>
37+
Executable depending on a shared library from a mixed type.
38+
</description>
39+
40+
<properties>
41+
<skipTests>true</skipTests>
42+
</properties>
43+
44+
<build>
45+
<plugins>
46+
<plugin>
47+
<groupId>@project.groupId@</groupId>
48+
<artifactId>nar-maven-plugin</artifactId>
49+
<extensions>true</extensions>
50+
<configuration>
51+
<c>
52+
<defines>
53+
<define>LIB_IMPORTS</define>
54+
</defines>
55+
</c>
56+
<libraries>
57+
<library>
58+
<type>executable</type>
59+
<!-- <linkCPP>false</linkCPP> -->
60+
<dependencyBindings>
61+
<dependencyBinding>it0040-lib-sharedstatic:shared</dependencyBinding>
62+
</dependencyBindings>
63+
</library>
64+
</libraries>
65+
</configuration>
66+
</plugin>
67+
</plugins>
68+
</build>
69+
70+
<dependencies>
71+
<dependency>
72+
<groupId>com.github.maven-nar.its.nar</groupId>
73+
<artifactId>it0040-lib-sharedstatic</artifactId>
74+
<version>1.0-SNAPSHOT</version>
75+
<type>nar</type>
76+
</dependency>
77+
</dependencies>
78+
</project>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* #%L
3+
* Native ARchive plugin for Maven
4+
* %%
5+
* Copyright (C) 2002 - 2014 NAR Maven Plugin developers.
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
#include <stdio.h>
21+
#include "HelloWorldLib.h"
22+
23+
int main(int argc, char *argv[]) {
24+
printf("%s\n", HelloWorldLib_sayHello());
25+
return 0;
26+
}
27+
28+
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
#%L
4+
Native ARchive plugin for Maven
5+
%%
6+
Copyright (C) 2002 - 2014 NAR Maven Plugin developers.
7+
%%
8+
Licensed under the Apache License, Version 2.0 (the "License");
9+
you may not use this file except in compliance with the License.
10+
You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing, software
15+
distributed under the License is distributed on an "AS IS" BASIS,
16+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
See the License for the specific language governing permissions and
18+
limitations under the License.
19+
#L%
20+
-->
21+
22+
<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">
23+
<modelVersion>4.0.0</modelVersion>
24+
25+
<parent>
26+
<groupId>com.github.maven-nar.its.nar</groupId>
27+
<artifactId>it0040-pom</artifactId>
28+
<version>1.0-SNAPSHOT</version>
29+
</parent>
30+
31+
<artifactId>it0040-dep-lib-static</artifactId>
32+
<packaging>nar</packaging>
33+
34+
<name>NAR Executable and Static Library</name>
35+
<version>1.0-SNAPSHOT</version>
36+
<description>
37+
Executable depending on a static library from a mixed type.
38+
</description>
39+
40+
<properties>
41+
<skipTests>true</skipTests>
42+
</properties>
43+
44+
<build>
45+
<plugins>
46+
<plugin>
47+
<groupId>@project.groupId@</groupId>
48+
<artifactId>nar-maven-plugin</artifactId>
49+
<extensions>true</extensions>
50+
<configuration>
51+
<libraries>
52+
<library>
53+
<type>executable</type>
54+
<!-- <linkCPP>false</linkCPP> -->
55+
<dependencyBindings>
56+
<dependencyBinding>it0040-lib-sharedstatic:static</dependencyBinding>
57+
</dependencyBindings>
58+
</library>
59+
</libraries>
60+
</configuration>
61+
</plugin>
62+
</plugins>
63+
</build>
64+
65+
<dependencies>
66+
<dependency>
67+
<groupId>com.github.maven-nar.its.nar</groupId>
68+
<artifactId>it0040-lib-sharedstatic</artifactId>
69+
<version>1.0-SNAPSHOT</version>
70+
<type>nar</type>
71+
</dependency>
72+
</dependencies>
73+
</project>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* #%L
3+
* Native ARchive plugin for Maven
4+
* %%
5+
* Copyright (C) 2002 - 2014 NAR Maven Plugin developers.
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
#include <stdio.h>
21+
#include "HelloWorldLib.h"
22+
23+
int main(int argc, char *argv[]) {
24+
printf("%s\n", HelloWorldLib_sayHello());
25+
return 0;
26+
}
27+
28+

0 commit comments

Comments
 (0)