From 69acfe4819bcde20d20598ede0be1a6d33a560e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Svensson?= Date: Thu, 6 Aug 2020 10:09:33 +0200 Subject: [PATCH] Bug 521515: Align directory name of native source code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- README.md | 2 +- .../build.properties | 2 +- .../{jni => native_src}/.gitignore | 0 .../{jni => native_src}/Makefile | 0 .../{jni => native_src}/Readme.md | 0 .../{jni => native_src}/serial.c | 0 .../os/win32/x86_64/serial.dll | Bin 381152 -> 381152 bytes native/org.eclipse.cdt.native.serial/pom.xml | 14 +++++++------- releng/scripts/check_code_cleanliness.sh | 4 ++-- 9 files changed, 11 insertions(+), 11 deletions(-) rename native/org.eclipse.cdt.native.serial/{jni => native_src}/.gitignore (100%) rename native/org.eclipse.cdt.native.serial/{jni => native_src}/Makefile (100%) rename native/org.eclipse.cdt.native.serial/{jni => native_src}/Readme.md (100%) rename native/org.eclipse.cdt.native.serial/{jni => native_src}/serial.c (100%) diff --git a/README.md b/README.md index f471b002e08..07ded6fd42f 100644 --- a/README.md +++ b/README.md @@ -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` diff --git a/native/org.eclipse.cdt.native.serial/build.properties b/native/org.eclipse.cdt.native.serial/build.properties index 22cb27bb991..8d185293761 100644 --- a/native/org.eclipse.cdt.native.serial/build.properties +++ b/native/org.eclipse.cdt.native.serial/build.properties @@ -5,5 +5,5 @@ bin.includes = META-INF/,\ os/,\ about.html,\ cdt_logo_icon32.png -src.includes = jni/,\ +src.includes = native_src/,\ about.html diff --git a/native/org.eclipse.cdt.native.serial/jni/.gitignore b/native/org.eclipse.cdt.native.serial/native_src/.gitignore similarity index 100% rename from native/org.eclipse.cdt.native.serial/jni/.gitignore rename to native/org.eclipse.cdt.native.serial/native_src/.gitignore diff --git a/native/org.eclipse.cdt.native.serial/jni/Makefile b/native/org.eclipse.cdt.native.serial/native_src/Makefile similarity index 100% rename from native/org.eclipse.cdt.native.serial/jni/Makefile rename to native/org.eclipse.cdt.native.serial/native_src/Makefile diff --git a/native/org.eclipse.cdt.native.serial/jni/Readme.md b/native/org.eclipse.cdt.native.serial/native_src/Readme.md similarity index 100% rename from native/org.eclipse.cdt.native.serial/jni/Readme.md rename to native/org.eclipse.cdt.native.serial/native_src/Readme.md diff --git a/native/org.eclipse.cdt.native.serial/jni/serial.c b/native/org.eclipse.cdt.native.serial/native_src/serial.c similarity index 100% rename from native/org.eclipse.cdt.native.serial/jni/serial.c rename to native/org.eclipse.cdt.native.serial/native_src/serial.c diff --git a/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll b/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll index 2b1a6fab52096c2d87a0c0ed8d77784ce7621f1c..e88734adb7c89ec70d359a5aa6682bee3c44c9ba 100755 GIT binary patch delta 54 zcmaE`Q2fC{@d+I)+process-resources - + @@ -79,7 +79,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -122,7 +122,7 @@ process-resources - + @@ -136,7 +136,7 @@ clean - + @@ -169,7 +169,7 @@ process-resources - + @@ -183,7 +183,7 @@ clean - + diff --git a/releng/scripts/check_code_cleanliness.sh b/releng/scripts/check_code_cleanliness.sh index 8d5e3a8d792..de61112323f 100755 --- a/releng/scripts/check_code_cleanliness.sh +++ b/releng/scripts/check_code_cleanliness.sh @@ -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