forked from kohsuke/com4j
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpom.xml
More file actions
238 lines (218 loc) · 9.11 KB
/
Copy pathpom.xml
File metadata and controls
238 lines (218 loc) · 9.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<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>
<parent>
<groupId>org.kohsuke</groupId>
<artifactId>pom</artifactId>
<version>6</version>
<relativePath />
</parent>
<groupId>org.jvnet.com4j</groupId>
<artifactId>com4j-parent</artifactId>
<version>2.2-SNAPSHOT</version>
<name>com4j Parent</name>
<packaging>pom</packaging>
<modules>
<module>runtime</module>
<module>tlbimp</module>
<module>maven-com4j-plugin</module>
<module>distribution</module>
</modules>
<description>Type-safe Java/COM bridge</description>
<url>http://com4j.kohsuke.org/</url>
<scm>
<connection>scm:git:git@github.com/kohsuke/com4j.git</connection>
<developerConnection>scm:git:ssh://git@github.com/kohsuke/com4j.git</developerConnection>
<url>http://com4j.kohsuke.org/</url>
<tag>HEAD</tag>
</scm>
<distributionManagement>
<site>
<id>github-pages</id>
<url>gitsite:git@github.com/kohsuke/com4j.git</url>
</site>
</distributionManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Debug or Release; which native build gets copied into the com4j jar -->
<mode>Release</mode>
<cmake.generator>Visual Studio 17 2022</cmake.generator>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<aggregate>true</aggregate>
</configuration>
</plugin>
</plugins>
</reporting>
<licenses>
<license>
<name>MIT</name>
<distribution>repo</distribution>
<comments>The MIT License is used for the maven plugin, and com4j in general.</comments>
</license>
</licenses>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>windows</id>
<activation>
<os>
<family>Windows</family>
</os>
</activation>
<modules>
<module>test</module>
</modules>
<build>
<plugins>
<!--
Rebuilds com4j.dll for both architectures via CMake and drops the
result into the committed, canonical locations that
runtime/pom.xml's resource-copy step reads from:
bin/{x86,x64}/${mode}/com4j.dll.
This is opt-in (-DbuildNative=true) rather than something that
runs on every build: the DLLs themselves are committed to git
(they always have been - see the "we commit *.dll..." note
below), and most builds - including JitPack's, which builds
this project from source on a Linux server with no path to a
Windows/MSVC toolchain at all - are expected to just use those
checked-in binaries rather than rebuild them. Pass
-DbuildNative=true when you've actually changed native/ code
and want to refresh the committed DLLs (then git add/commit the
result). Requires cmake, a Visual Studio C++/ATL/MFC toolset,
and the JDK running this Maven build to have JNI headers
(include/, include/win32) - i.e. a real JDK, not a JRE.
Re-running is fairly fast even though CMake reconfigures every
time (it's a quick no-op once a build directory already matches
the requested settings), since the actual compile step only
recompiles what changed.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>build-native</id>
<phase>generate-resources</phase>
<inherited>false</inherited>
<configuration>
<target if="buildNative">
<!--
Locate a JDK root with include/jni.h. The JAVA_HOME env var
is the conventional way to point at one and, unlike it,
Maven's own ${java.home} isn't reliable for this on JDK 8
(it resolves to the bundled .../jre subfolder there, which
has no include/ - only JDK 9+ removed that split). Falls
back to ${java.home} if JAVA_HOME isn't set.
-->
<property environment="env" />
<condition property="jdk.home" value="${env.JAVA_HOME}">
<isset property="env.JAVA_HOME" />
</condition>
<property name="jdk.home" value="${java.home}" />
<!--
CMake's FindJNI.cmake does its own semicolon-list/string
parsing on this path internally, where a backslash is an
escape character - a plain Windows path (e.g. one with
"\Hotspot_jdk\" in it) can trip that with errors like
"Invalid character escape '\H'". Forward slashes avoid it
and work fine as a Windows path too.
-->
<pathconvert property="jdk.home.cmake" targetos="unix">
<path path="${jdk.home}" />
</pathconvert>
<mkdir dir="${basedir}/native/cmake-build-x64" />
<mkdir dir="${basedir}/native/cmake-build-x86" />
<exec executable="cmake" dir="${basedir}" failonerror="true">
<arg value="-G" />
<arg value="${cmake.generator}" />
<arg value="-A" />
<arg value="x64" />
<arg value="-S" />
<arg value="native" />
<arg value="-B" />
<arg value="native/cmake-build-x64" />
<arg value="-DJAVA_HOME=${jdk.home.cmake}" />
</exec>
<exec executable="cmake" dir="${basedir}" failonerror="true">
<arg value="--build" />
<arg value="native/cmake-build-x64" />
<arg value="--config" />
<arg value="${mode}" />
</exec>
<mkdir dir="${basedir}/bin/x64/${mode}" />
<copy file="${basedir}/native/cmake-build-x64/${mode}/com4j.dll" todir="${basedir}/bin/x64/${mode}" overwrite="true" />
<copy file="${basedir}/native/cmake-build-x64/${mode}/com4j.pdb" todir="${basedir}/bin/x64/${mode}" overwrite="true" failonerror="false" />
<exec executable="cmake" dir="${basedir}" failonerror="true">
<arg value="-G" />
<arg value="${cmake.generator}" />
<arg value="-A" />
<arg value="Win32" />
<arg value="-S" />
<arg value="native" />
<arg value="-B" />
<arg value="native/cmake-build-x86" />
<arg value="-DJAVA_HOME=${jdk.home.cmake}" />
</exec>
<exec executable="cmake" dir="${basedir}" failonerror="true">
<arg value="--build" />
<arg value="native/cmake-build-x86" />
<arg value="--config" />
<arg value="${mode}" />
</exec>
<mkdir dir="${basedir}/bin/x86/${mode}" />
<copy file="${basedir}/native/cmake-build-x86/${mode}/com4j.dll" todir="${basedir}/bin/x86/${mode}" overwrite="true" />
<copy file="${basedir}/native/cmake-build-x86/${mode}/com4j.pdb" todir="${basedir}/bin/x86/${mode}" overwrite="true" failonerror="false" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<issueManagement>
<system>GitHub Issues</system>
<url>https://github.com/kohsuke/com4j/issues</url>
</issueManagement>
</project>