diff options
author | Leo Ufimtsev | 2017-04-13 18:52:58 +0000 |
---|---|---|
committer | Leo Ufimtsev | 2017-04-13 18:52:58 +0000 |
commit | 823bbd3e55994b1af2ba1234705ae67b1c781a25 (patch) | |
tree | e9066c9f3b5491d527d6ea65989f574d28e91d79 /bundles/org.eclipse.swt.tools | |
parent | acfc249639aeb4cdc27c34e77bee3133093e064f (diff) | |
download | eclipse.platform.swt-823bbd3e55994b1af2ba1234705ae67b1c781a25.tar.gz eclipse.platform.swt-823bbd3e55994b1af2ba1234705ae67b1c781a25.tar.xz eclipse.platform.swt-823bbd3e55994b1af2ba1234705ae67b1c781a25.zip |
Bug 514509 - [Gtk] Organise swt gtk developer scripts and add build
scripts
Updated script to rename .classpath before build.sh, because if
folders/path was changed, then rename of '.classpath' is not reached
by the script.
Change-Id: I52c1f9d8310eea1fd1249fdd3b905f7c6213cbc8
Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt.tools')
-rwxr-xr-x | bundles/org.eclipse.swt.tools/gtk/rebuild_swt_natives.sh | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/bundles/org.eclipse.swt.tools/gtk/rebuild_swt_natives.sh b/bundles/org.eclipse.swt.tools/gtk/rebuild_swt_natives.sh index 8c2e565cac..0b38d9d978 100755 --- a/bundles/org.eclipse.swt.tools/gtk/rebuild_swt_natives.sh +++ b/bundles/org.eclipse.swt.tools/gtk/rebuild_swt_natives.sh @@ -19,7 +19,7 @@ source common_functions.sh -# 0) Find directory where this script is being executed from. +# Find directory where this script is being executed from. ############################################################# # The method below works even if the script is called from somewhere else, or scrpit is symlinked. # http://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within @@ -30,6 +30,33 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" +cd ${SCRIPT_DIR} + + +# 0) Fix '.classpath' for SWT project and for snippets. +####################################################### +# Sometimes .classpath_gtk is updated in commits, e.g when a class folder is added/removed. +# Because renaming .classpath is done manually, this often leads to errors about missing source folders. +# Fix: re-copy the .classpath on every lib rebuild. +func_echo_info "\n[Step 0] Copying .classpath_gtk files to .classpath in SWT project & Snippets" +# Navigate to /git/eclipse.platform.swt/bundles/org.eclipse.swt +cd ../../org.eclipse.swt +if [ -e .classpath_gtk ] && cat META-INF/MANIFEST.MF | grep "Bundle-SymbolicName: org.eclipse.swt" ; then + (set -x ; cp .classpath_gtk .classpath) +else + func_echo_error "[Step 0] I was expecting to be in:\n/git/eclipse.platform.swt/bundles/org.eclipse.swt\nBut I'm in $(pwd)" + exit 1 # failed +fi + +# Navigate to snippets. +cd ../../examples/org.eclipse.swt.snippets/ +if [ -e .classpath_gtk ] && cat META-INF/MANIFEST.MF | grep "Bundle-SymbolicName: org.eclipse.swt.snippets"; then + (set -x ; cp .classpath_gtk .classpath) +else + func_echo_error "[Step 0] I was expecting to be in snippet repository: /examples/org.eclipse.swt.snippets/ , but I'm in $(pwd)" + error 1 #failed +fi +cd ${SCRIPT_DIR} # 1) Find SWT's build.sh script @@ -43,7 +70,7 @@ if [ ! -e "$BUILD_SH_DIR/build.sh" ]; then func_echo_info "[Step 1] ** build.sh directory found via hardcoded path" BUILD_SH_DIR="$HARD_CODED_PATH" else - func_echo_error "[Step 1] Could not find 'build.sh' neither in: \n$BUILD_SH_DIR\nnor in:\n$HARD_CODED_PATH\nYou probably didn't build swt project." + func_echo_error "[Step 1] Could not find 'build.sh' neither in: \n$BUILD_SH_DIR\nnor in:\n$HARD_CODED_PATH\nYou probably need to build swt project." exit 1; fi else @@ -101,7 +128,7 @@ fi export SWT_LIB_DEBUG=1 temp_log_file=$(mktemp) # Keep log so we can count warnings after. # 'script' command logs commands and their output. -# This is used instead of output redirection to preserve make colouring output, +# This is used instead of output redirection to preserve make colouring output, # while at the same time capture log for parsing. script --quiet --return --command " ./build.sh -gtk-all install" $temp_log_file #"script" cmd preserves color coding during logging. if [ "$?" -ne 0 ]; then # Failed @@ -115,29 +142,4 @@ else # Success rm $temp_log_file fi - -# 4) Fix '.classpath' for SWT project and for snippets. -####################################################### -# Sometimes .classpath_gtk is updated in commits, e.g when a class folder is added/removed. -# Because renaming .classpath is done manually, this often leads to errors about missing source folders. -# Fix: re-copy the .classpath on every lib rebuild. -func_echo_info "\n[Step 4] Copying .classpath_gtk files to .classpath in SWT project & Snippets" -# Navigate to /git/eclipse.platform.swt/bundles/org.eclipse.swt -cd ../.. -if [ -e .classpath_gtk ] && cat META-INF/MANIFEST.MF | grep "Bundle-SymbolicName: org.eclipse.swt" ; then - (set -x ; cp .classpath_gtk .classpath) -else - func_echo_error "[Step 4] I was expecting to be in:\n/git/eclipse.platform.swt/bundles/org.eclipse.swt\nBut I'm in $(pwd)" - exit 1 # failed -fi - -# Navigate to snippets. -cd ../../examples/org.eclipse.swt.snippets/ -if [ -e .classpath_gtk ] && cat META-INF/MANIFEST.MF | grep "Bundle-SymbolicName: org.eclipse.swt.snippets"; then - (set -x ; cp .classpath_gtk .classpath) -else - func_echo_error "[Step 4] I was expecting to be in snippet repository: /examples/org.eclipse.swt.snippets/ , but I'm in $(pwd)" - error 1 #failed -fi - func_echo_info "Finished" |