1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-03-28 14:56:28 +01:00

Bug 521515: Align directory name of native source code

The native directory can contain both libraries and utilities. In
Gerrit https://git.eclipse.org/r/c/cdt/org.eclipse.cdt/+/165270,
there is a utility, so the directory name "jni", or even "library" does
not work. In order to support both utilities and libraries, the
suggested name of the directory is "native_src" and thus, this commit
syncs that change in o.e.c.native.serial.

Change-Id: Iafa9ce9ae1dca7ef563ab397e8b3eb0b8642372d
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
This commit is contained in:
Torbjörn Svensson 2020-08-06 10:09:33 +02:00 committed by Jonah Graham
parent 2bd07a89ca
commit 69acfe4819
9 changed files with 11 additions and 11 deletions

View file

@ -120,7 +120,7 @@ The `native` property can be one of the following:
Therefore to build all the natives using docker do `mvn process-resources -Dnative=docker`.
However, the challenge is that dll files on Windows have a timestamp in them. To have reproducible builds, we need to have a reproducible timestamp. Therefore we use the commit time of the commit to derive a timestamp (We use the `SOURCE_DATE_EPOCH` environemnt variable to achieve this, see the [Makefile](native/org.eclipse.cdt.native.serial/jni/Makefile) for more info). Because we want to keep the DLL checked in so that contributors don't need to rebuild it all the time we need a way to have to check in the dll with the same commit time. To do this we use GIT_COMMITTER_DATE. So, after editing and committing your change, you need to rebuild one last time with the commit date and the commit it without changing the commit date again using:
However, the challenge is that dll files on Windows have a timestamp in them. To have reproducible builds, we need to have a reproducible timestamp. Therefore we use the commit time of the commit to derive a timestamp (We use the `SOURCE_DATE_EPOCH` environemnt variable to achieve this, see the [Makefile](native/org.eclipse.cdt.native.serial/native_src/Makefile) for more info). Because we want to keep the DLL checked in so that contributors don't need to rebuild it all the time we need a way to have to check in the dll with the same commit time. To do this we use GIT_COMMITTER_DATE. So, after editing and committing your change, you need to rebuild one last time with the commit date and the commit it without changing the commit date again using:
1. Edit and commit change
2. Set DIR to the name of the directory you are working on, e.g. `DIR=native/org.eclipse.cdt.native.serial`

View file

@ -5,5 +5,5 @@ bin.includes = META-INF/,\
os/,\
about.html,\
cdt_logo_icon32.png
src.includes = jni/,\
src.includes = native_src/,\
about.html

View file

@ -46,7 +46,7 @@
<phase>process-resources</phase>
<configuration>
<target>
<exec executable="make" newenvironment="false" failOnError="true" dir="./jni">
<exec executable="make" newenvironment="false" failOnError="true" dir="./native_src">
<arg value="rebuild" />
</exec>
</target>
@ -79,7 +79,7 @@
<configuration>
<target>
<exec executable="docker" newenvironment="false" failOnError="true">
<!-- docker run -\-rm -t -v $(git rev-parse -\-show-toplevel):/work -w /work/$(git rev-parse -\-show-prefix) quay.io/eclipse-cdt/cdt-infra-eclipse-full:latest make -C jni rebuild -->
<!-- docker run -\-rm -t -v $(git rev-parse -\-show-toplevel):/work -w /work/$(git rev-parse -\-show-prefix) quay.io/eclipse-cdt/cdt-infra-eclipse-full:latest make -C native_src rebuild -->
<arg value="run" />
<arg value="--rm" />
<arg value="-t" />
@ -90,7 +90,7 @@
<arg value="quay.io/eclipse-cdt/cdt-infra-eclipse-full:latest" />
<arg value="make" />
<arg value="-C" />
<arg value="jni" />
<arg value="native_src" />
<arg value="rebuild" />
</exec>
</target>
@ -122,7 +122,7 @@
<phase>process-resources</phase>
<configuration>
<target>
<exec executable="make" newenvironment="false" dir="./jni">
<exec executable="make" newenvironment="false" dir="./native_src">
<arg value="LIBS=../os/linux/x86_64/libserial.so" />
</exec>
</target>
@ -136,7 +136,7 @@
<phase>clean</phase>
<configuration>
<target>
<exec executable="make" newenvironment="false" dir="./jni">
<exec executable="make" newenvironment="false" dir="./native_src">
<arg value="LIBS=../os/linux/x86_64/libserial.so" />
<arg value="clean" />
</exec>
@ -169,7 +169,7 @@
<phase>process-resources</phase>
<configuration>
<target>
<exec executable="make" newenvironment="false" dir="./jni">
<exec executable="make" newenvironment="false" dir="./native_src">
<arg value="LIBS=../os/linux/ppc64le/libserial.so" />
</exec>
</target>
@ -183,7 +183,7 @@
<phase>clean</phase>
<configuration>
<target>
<exec executable="make" newenvironment="false" dir="./jni">
<exec executable="make" newenvironment="false" dir="./native_src">
<arg value="LIBS=../os/linux/ppc64le/libserial.so" />
<arg value="clean" />
</exec>

View file

@ -105,10 +105,10 @@ done
##
# Make sure that natives are up to date
##
if test -e native/org.eclipse.cdt.native.serial/jni; then
if test -e native/org.eclipse.cdt.native.serial/native_src; then
echo "Rebuilding natives to make sure they match source"
logfile=$(mktemp /tmp/make-natives-log.XXXXXX)
if ! make -C native/org.eclipse.cdt.native.serial/jni rebuild >${logfile} 2>&1; then
if ! make -C native/org.eclipse.cdt.native.serial/native_src rebuild >${logfile} 2>&1; then
echo "Rebuilding of natives failed. The log is part of the artifacts of the build"
cp ${logfile} make-natives.log
exit 1