mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Bug 521515: Generate JNI header files as part of build
Change-Id: Ia92da44f964e1934b2c32d2536f3ec27c03d5d59
This commit is contained in:
parent
ba24afc3a4
commit
7120731766
19 changed files with 66 additions and 63 deletions
|
@ -76,6 +76,11 @@ mvn generate-resources -DuseSimrelRepo -f build/org.eclipse.cdt.meson.docs -Preg
|
||||||
mvn generate-resources -DuseSimrelRepo -f build/org.eclipse.cdt.autotools.docs -PregenHelp
|
mvn generate-resources -DuseSimrelRepo -f build/org.eclipse.cdt.autotools.docs -PregenHelp
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### jniheaders
|
||||||
|
|
||||||
|
The `jniheaders` profile can be used on the core/org.eclipse.cdt.core.native to rebuild the
|
||||||
|
header files for JNI natives. See also `native` property below.
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
There are a number of properties (-D to mvn) to control the behaviour of the build. Refer to the
|
There are a number of properties (-D to mvn) to control the behaviour of the build. Refer to the
|
||||||
|
@ -145,3 +150,5 @@ An additional tip is to set the following in `.gitconfig` to allow you to diff `
|
||||||
textconv = objdump -x
|
textconv = objdump -x
|
||||||
binary = true
|
binary = true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
See also `jniheaders` profile above.
|
||||||
|
|
|
@ -26,10 +26,10 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_change_1window_1size
|
||||||
/*
|
/*
|
||||||
* Class: org_eclipse_cdt_utils_pty_PTY
|
* Class: org_eclipse_cdt_utils_pty_PTY
|
||||||
* Method: exec2
|
* Method: exec2
|
||||||
* Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[ILjava/lang/String;IZ)I
|
* Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Lorg/eclipse/cdt/utils/spawner/Spawner/IChannel;Ljava/lang/String;IZ)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_exec2
|
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_exec2
|
||||||
(JNIEnv *, jobject, jobjectArray, jobjectArray, jstring, jintArray, jstring, jint, jboolean);
|
(JNIEnv *, jobject, jobjectArray, jobjectArray, jstring, jobjectArray, jstring, jint, jboolean);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: org_eclipse_cdt_utils_pty_PTY
|
* Class: org_eclipse_cdt_utils_pty_PTY
|
|
@ -9,6 +9,10 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
#undef org_eclipse_cdt_utils_pty_PTYInputStream_MAX_SKIP_BUFFER_SIZE
|
#undef org_eclipse_cdt_utils_pty_PTYInputStream_MAX_SKIP_BUFFER_SIZE
|
||||||
#define org_eclipse_cdt_utils_pty_PTYInputStream_MAX_SKIP_BUFFER_SIZE 2048L
|
#define org_eclipse_cdt_utils_pty_PTYInputStream_MAX_SKIP_BUFFER_SIZE 2048L
|
||||||
|
#undef org_eclipse_cdt_utils_pty_PTYInputStream_DEFAULT_BUFFER_SIZE
|
||||||
|
#define org_eclipse_cdt_utils_pty_PTYInputStream_DEFAULT_BUFFER_SIZE 8192L
|
||||||
|
#undef org_eclipse_cdt_utils_pty_PTYInputStream_MAX_BUFFER_SIZE
|
||||||
|
#define org_eclipse_cdt_utils_pty_PTYInputStream_MAX_BUFFER_SIZE 2147483639L
|
||||||
/*
|
/*
|
||||||
* Class: org_eclipse_cdt_utils_pty_PTYInputStream
|
* Class: org_eclipse_cdt_utils_pty_PTYInputStream
|
||||||
* Method: read0
|
* Method: read0
|
|
@ -7,6 +7,8 @@
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
#undef org_eclipse_cdt_utils_pty_PTYOutputStream_EOT
|
||||||
|
#define org_eclipse_cdt_utils_pty_PTYOutputStream_EOT 4L
|
||||||
/*
|
/*
|
||||||
* Class: org_eclipse_cdt_utils_pty_PTYOutputStream
|
* Class: org_eclipse_cdt_utils_pty_PTYOutputStream
|
||||||
* Method: write0
|
* Method: write0
|
|
@ -1,20 +1,3 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2002, 2020 QNX Software Systems and others.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License 2.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* https://www.eclipse.org/legal/epl-2.0/
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: EPL-2.0
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* QNX Software Systems - initial API and implementation
|
|
||||||
*
|
|
||||||
* Spawner.h
|
|
||||||
*
|
|
||||||
* This is a part of JNI implementation of spawner
|
|
||||||
*******************************************************************************/
|
|
||||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
/* Header for class org_eclipse_cdt_utils_spawner_Spawner */
|
/* Header for class org_eclipse_cdt_utils_spawner_Spawner */
|
|
@ -1,20 +1,3 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2002, 2020 QNX Software Systems and others.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License 2.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* https://www.eclipse.org/legal/epl-2.0/
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: EPL-2.0
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* QNX Software Systems - initial API and implementation
|
|
||||||
*
|
|
||||||
* SpawnerInputStream.h
|
|
||||||
*
|
|
||||||
* This is a part of JNI implementation of spawner
|
|
||||||
*******************************************************************************/
|
|
||||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
/* Header for class org_eclipse_cdt_utils_spawner_SpawnerInputStream */
|
/* Header for class org_eclipse_cdt_utils_spawner_SpawnerInputStream */
|
||||||
|
@ -26,6 +9,10 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
#undef org_eclipse_cdt_utils_spawner_SpawnerInputStream_MAX_SKIP_BUFFER_SIZE
|
#undef org_eclipse_cdt_utils_spawner_SpawnerInputStream_MAX_SKIP_BUFFER_SIZE
|
||||||
#define org_eclipse_cdt_utils_spawner_SpawnerInputStream_MAX_SKIP_BUFFER_SIZE 2048L
|
#define org_eclipse_cdt_utils_spawner_SpawnerInputStream_MAX_SKIP_BUFFER_SIZE 2048L
|
||||||
|
#undef org_eclipse_cdt_utils_spawner_SpawnerInputStream_DEFAULT_BUFFER_SIZE
|
||||||
|
#define org_eclipse_cdt_utils_spawner_SpawnerInputStream_DEFAULT_BUFFER_SIZE 8192L
|
||||||
|
#undef org_eclipse_cdt_utils_spawner_SpawnerInputStream_MAX_BUFFER_SIZE
|
||||||
|
#define org_eclipse_cdt_utils_spawner_SpawnerInputStream_MAX_BUFFER_SIZE 2147483639L
|
||||||
/*
|
/*
|
||||||
* Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream
|
* Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream
|
||||||
* Method: read0
|
* Method: read0
|
|
@ -1,20 +1,3 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2002, 2020 QNX Software Systems and others.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License 2.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* https://www.eclipse.org/legal/epl-2.0/
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: EPL-2.0
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* QNX Software Systems - initial API and implementation
|
|
||||||
*
|
|
||||||
* SpawnerOutputStream.h
|
|
||||||
*
|
|
||||||
* This is a part of JNI implementation of spawner
|
|
||||||
*******************************************************************************/
|
|
||||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
/* Header for class org_eclipse_cdt_utils_spawner_SpawnerOutputStream */
|
/* Header for class org_eclipse_cdt_utils_spawner_SpawnerOutputStream */
|
|
@ -14,8 +14,8 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <SpawnerInputStream.h>
|
#include <org_eclipse_cdt_utils_spawner_SpawnerInputStream.h>
|
||||||
#include <SpawnerOutputStream.h>
|
#include <org_eclipse_cdt_utils_spawner_SpawnerOutputStream.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
/* Header for class _org_eclipse_cdt_utils_spawner_SpawnerInputStream */
|
/* Header for class _org_eclipse_cdt_utils_spawner_SpawnerInputStream */
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* Wind River Systems, Inc.
|
* Wind River Systems, Inc.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include "PTY.h"
|
#include "org_eclipse_cdt_utils_pty_PTY.h"
|
||||||
#include "openpty.h"
|
#include "openpty.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <PTYInputStream.h>
|
#include <org_eclipse_cdt_utils_pty_PTYInputStream.h>
|
||||||
#include <PTYOutputStream.h>
|
#include <org_eclipse_cdt_utils_pty_PTYOutputStream.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
/* Header for class _org_eclipse_cdt_utils_pty_PTYInputStream */
|
/* Header for class _org_eclipse_cdt_utils_pty_PTYInputStream */
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
|
|
||||||
#include "exec0.h"
|
#include "exec0.h"
|
||||||
#include <Spawner.h>
|
#include <org_eclipse_cdt_utils_spawner_Spawner.h>
|
||||||
|
|
||||||
|
|
||||||
#define DEBUGIT 0
|
#define DEBUGIT 0
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
|
|
||||||
#include "Spawner.h"
|
#include "org_eclipse_cdt_utils_spawner_Spawner.h"
|
||||||
|
|
||||||
#define PIPE_SIZE 512 // Size of pipe buffer
|
#define PIPE_SIZE 512 // Size of pipe buffer
|
||||||
#define MAX_CMD_SIZE 2049 // Initial size of command line
|
#define MAX_CMD_SIZE 2049 // Initial size of command line
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#include "Spawner.h"
|
#include "org_eclipse_cdt_utils_spawner_Spawner.h"
|
||||||
|
|
||||||
//#define READ_REPORT
|
//#define READ_REPORT
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#include "Spawner.h"
|
#include "org_eclipse_cdt_utils_spawner_Spawner.h"
|
||||||
|
|
||||||
extern void JNICALL ThrowByName(JNIEnv *env, const char *name, const char *msg);
|
extern void JNICALL ThrowByName(JNIEnv *env, const char *name, const char *msg);
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#include "Spawner.h"
|
#include "org_eclipse_cdt_utils_spawner_Spawner.h"
|
||||||
|
|
||||||
CRITICAL_SECTION cs;
|
CRITICAL_SECTION cs;
|
||||||
|
|
||||||
|
|
|
@ -104,5 +104,34 @@
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</profile>
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>jniheaders</id>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>headers</id>
|
||||||
|
<phase>process-resources</phase>
|
||||||
|
<configuration>
|
||||||
|
<compilerArgs>
|
||||||
|
<arg>-h</arg>
|
||||||
|
<arg>${project.basedir}/native_src/include</arg>
|
||||||
|
</compilerArgs>
|
||||||
|
<source>11</source>
|
||||||
|
<target>11</target>
|
||||||
|
<encoding>UTF-8</encoding>
|
||||||
|
</configuration>
|
||||||
|
<goals>
|
||||||
|
<goal>compile</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
</project>
|
</project>
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -105,6 +105,14 @@ done
|
||||||
##
|
##
|
||||||
# Make sure that natives are up to date
|
# Make sure that natives are up to date
|
||||||
##
|
##
|
||||||
|
|
||||||
|
echo "Rebuilding JNI headers to make sure they match source"
|
||||||
|
logfile=jni-header.log
|
||||||
|
if ! ${MVN:-mvn} -B -V process-resources -DuseSimrelRepo -P jniheaders -f core/org.eclipse.cdt.core.native >${logfile} 2>&1; then
|
||||||
|
echo "Rebuilding of JNI headers failed. The log (${logfile}) is part of the artifacts of the build"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
for p in native/org.eclipse.cdt.native.serial/native_src core/org.eclipse.cdt.core.native/native_src; do
|
for p in native/org.eclipse.cdt.native.serial/native_src core/org.eclipse.cdt.core.native/native_src; do
|
||||||
echo "Rebuilding $p natives to make sure they match source"
|
echo "Rebuilding $p natives to make sure they match source"
|
||||||
logfile=make-natives-${p//\//-}.log
|
logfile=make-natives-${p//\//-}.log
|
||||||
|
|
Loading…
Add table
Reference in a new issue