mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-17 05:05:43 +02:00
[releng] Split up check_code_cleanliness script
As more checks have been added it has gotten a little unweildy. The new script "do_all_code_cleanups.sh" now does most of the code formatting checks. Change-Id: I65fd888c88e1d7e470ed5621cee18ff3bf6680b4
This commit is contained in:
parent
0cb1f7482a
commit
6233337560
7 changed files with 192 additions and 153 deletions
|
@ -8,161 +8,11 @@ set -e
|
||||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
${DIR}/check_features.sh
|
${DIR}/check_features.sh
|
||||||
|
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# This script is reused by other projects, if so, COREPROJECT should be set
|
# The next set of scripts automatically apply formatting and other rules
|
||||||
# to the project to use a basis for project settings
|
# to CDT. At the end of this, git repo is checked for no diffs.
|
||||||
##
|
##
|
||||||
: ${COREPROJECT:=core/org.eclipse.cdt.core}
|
${DIR}/do_all_code_cleanups.sh
|
||||||
|
|
||||||
##
|
|
||||||
# Format code
|
|
||||||
##
|
|
||||||
: ${ECLIPSE:=~/buildtools/eclipse-SDK-4.13/eclipse}
|
|
||||||
test ! -e check_code_cleanliness_workspace
|
|
||||||
${ECLIPSE} \
|
|
||||||
-consolelog -nosplash -application org.eclipse.jdt.core.JavaCodeFormatter \
|
|
||||||
-config $PWD/$COREPROJECT/.settings/org.eclipse.jdt.core.prefs \
|
|
||||||
$PWD -data check_code_cleanliness_workspace
|
|
||||||
rm -rf check_code_cleanliness_workspace
|
|
||||||
|
|
||||||
##
|
|
||||||
# Remove trailing whitespace.
|
|
||||||
# The .gitattributes is used as a filter to identify files to check. Patters with
|
|
||||||
# this "# check trailing whitespace" on the line before are checked
|
|
||||||
##
|
|
||||||
awk '/# remove trailing whitespace/{getline; print $1}' .gitattributes |
|
|
||||||
while read i ; do
|
|
||||||
echo "Removing trailing whitespace on $i files"
|
|
||||||
git ls-files -- "$i" | xargs --no-run-if-empty sed -i 's/[ \t]*$//'
|
|
||||||
done
|
|
||||||
|
|
||||||
##
|
|
||||||
# Add all file types to .gitattributes
|
|
||||||
##
|
|
||||||
git ls-files | sed -E '-es@^.*/([^/]+)$@\1@' '-es@.+\.@\\\*\\.@' | sort -u | while read i ; do
|
|
||||||
if ! grep "^$i " .gitattributes > /dev/null
|
|
||||||
then
|
|
||||||
echo "MISSING $i in .gitattributes, adding as text, check if that is correct"
|
|
||||||
echo "$i text # automatically added - please verify" >> .gitattributes
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
##
|
|
||||||
# Setup Eclipse Core Preferences
|
|
||||||
##
|
|
||||||
git ls-files -- \*\*/.project | while read i ; do
|
|
||||||
d=`dirname $i`;
|
|
||||||
mkdir -p $d/.settings
|
|
||||||
if ! test -e $d/.settings/org.eclipse.core.resources.prefs; then
|
|
||||||
echo 'eclipse.preferences.version=1' > $d/.settings/org.eclipse.core.resources.prefs
|
|
||||||
echo 'encoding/<project>=UTF-8' >> $d/.settings/org.eclipse.core.resources.prefs
|
|
||||||
fi
|
|
||||||
if ! grep 'encoding/<project>=UTF-8' $d/.settings/org.eclipse.core.resources.prefs > /dev/null; then
|
|
||||||
echo 'encoding/<project>=UTF-8' >> $d/.settings/org.eclipse.core.resources.prefs
|
|
||||||
fi
|
|
||||||
if ! grep 'eclipse.preferences.version=1' $d/.settings/org.eclipse.core.resources.prefs > /dev/null; then
|
|
||||||
echo 'eclipse.preferences.version=1' >> $d/.settings/org.eclipse.core.resources.prefs
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
##
|
|
||||||
# Copy JDT/PDE preferences
|
|
||||||
##
|
|
||||||
git ls-files -- \*\*/.project ":!$COREPROJECT/.project" | while read i ; do
|
|
||||||
d=`dirname $i`;
|
|
||||||
natures=$(xmllint --xpath 'string(//projectDescription/natures)' $i)
|
|
||||||
mkdir -p $d/.settings
|
|
||||||
|
|
||||||
# JDT
|
|
||||||
if [[ $natures == *"org.eclipse.jdt.core.javanature"* ]]; then
|
|
||||||
cp $COREPROJECT/.settings/org.eclipse.jdt.* $d/.settings
|
|
||||||
# For test plug-ins we are more lenient so don't warn on some items
|
|
||||||
if echo $i | grep -E '\.tests?[/\.]' > /dev/null; then
|
|
||||||
sed -i \
|
|
||||||
'-es@org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning@org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore@' \
|
|
||||||
'-es@org.eclipse.jdt.core.compiler.problem.discouragedReference=warning@org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore@' \
|
|
||||||
'-es@org.eclipse.jdt.core.compiler.problem.deprecation=warning@org.eclipse.jdt.core.compiler.problem.deprecation=ignore@' \
|
|
||||||
'-es@org.eclipse.jdt.core.compiler.problem.discouragedReference=warning@org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore@' \
|
|
||||||
'-es@org.eclipse.jdt.core.compiler.problem.emptyStatement=warning@org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore@' \
|
|
||||||
'-es@org.eclipse.jdt.core.compiler.problem.fieldHiding=warning@org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore@' \
|
|
||||||
'-es@org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning@org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore@' \
|
|
||||||
'-es@org.eclipse.jdt.core.compiler.problem.forbiddenReference=error@org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning@' \
|
|
||||||
'-es@org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning@org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore@' \
|
|
||||||
'-es@org.eclipse.jdt.core.compiler.problem.unusedLocal=warning@org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore@' \
|
|
||||||
'-es@org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning@org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore@' \
|
|
||||||
'-es@org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning@org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore@' \
|
|
||||||
'-es@org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning@org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore@' \
|
|
||||||
'-es@org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning@org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore@' \
|
|
||||||
$d/.settings/org.eclipse.jdt.core.prefs
|
|
||||||
fi
|
|
||||||
if echo $i | grep 'org.eclipse.cdt.examples.dsf' > /dev/null; then
|
|
||||||
sed -i \
|
|
||||||
'-es@org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning@org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore@' \
|
|
||||||
$d/.settings/org.eclipse.jdt.core.prefs
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
rm -f $d/.settings/org.eclipse.jdt*.prefs
|
|
||||||
fi
|
|
||||||
|
|
||||||
# PDE
|
|
||||||
if [[ $natures == *"org.eclipse.pde.PluginNature"* ]]; then
|
|
||||||
cp $COREPROJECT/.settings/org.eclipse.pde.prefs $d/.settings
|
|
||||||
cp $COREPROJECT/.settings/org.eclipse.pde.api.tools.prefs $d/.settings
|
|
||||||
if echo $i | grep -E '\.tests?[/\.]' > /dev/null; then
|
|
||||||
sed -i \
|
|
||||||
'-es@compilers.p.not-externalized-att=1@compilers.p.not-externalized-att=2@' \
|
|
||||||
$d/.settings/org.eclipse.pde.prefs
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
rm -f $d/.settings/org.eclipse.pde*.prefs
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
##
|
|
||||||
# Verify API Tooling is enabled for all non-test/example bundles
|
|
||||||
##
|
|
||||||
git ls-files -- \*\*/.project | while read i ; do
|
|
||||||
d=`dirname $i`;
|
|
||||||
natures=$(xmllint --xpath 'string(//projectDescription/natures)' $i)
|
|
||||||
if [[ $natures == *"org.eclipse.pde.PluginNature"* ]] && [[ $natures == *"org.eclipse.jdt.core.javanature"* ]]; then
|
|
||||||
if [[ $natures != *"org.eclipse.pde.api.tools.apiAnalysisNature"* ]]; then
|
|
||||||
if ! echo $i | grep -E '\.tests?[/\.]' > /dev/null && ! echo $i | grep -E '\.examples?[/\.]' > /dev/null; then
|
|
||||||
echo "$d is missing API Tools Nature - Turn it on in Eclipse by 1) Right-click project 2) Plug-in tools -> API Tools Setup"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
##
|
|
||||||
# Make sure that natives are up to date
|
|
||||||
##
|
|
||||||
for p in native/org.eclipse.cdt.native.serial core/org.eclipse.cdt.core.native; do
|
|
||||||
echo "Rebuilding $p JNI headers to make sure they match source"
|
|
||||||
logfile=jni-headers-${p//\//-}.log
|
|
||||||
if ! ${MVN:-mvn} -B -V process-resources -DuseSimrelRepo -P jniheaders -f $p >${logfile} 2>&1; then
|
|
||||||
echo "Rebuilding of $p JNI headers failed. The log (${logfile}) is part of the artifacts of the build"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Rebuilding $p natives to make sure they match source"
|
|
||||||
logfile=make-natives-${p//\//-}.log
|
|
||||||
if ! make -C $p/native_src rebuild >${logfile} 2>&1; then
|
|
||||||
echo "Rebuilding of $p natives failed. The log (${logfile}) is part of the artifacts of the build"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
##
|
|
||||||
# Mark Windows binaries as executable
|
|
||||||
##
|
|
||||||
echo "Marking Windows binaries as executable"
|
|
||||||
git ls-files -- \*.exe \*.dll | while read line; do
|
|
||||||
chmod +x "$line"
|
|
||||||
done
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Check that none of the above caused any changes
|
# Check that none of the above caused any changes
|
||||||
|
|
14
releng/scripts/do_add_all_file_types_to_gitattributes.sh
Executable file
14
releng/scripts/do_add_all_file_types_to_gitattributes.sh
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
##
|
||||||
|
# Add all file types to .gitattributes
|
||||||
|
##
|
||||||
|
git ls-files | sed -E '-es@^.*/([^/]+)$@\1@' '-es@.+\.@\\\*\\.@' | sort -u | while read i ; do
|
||||||
|
if ! grep "^$i " .gitattributes > /dev/null
|
||||||
|
then
|
||||||
|
echo "MISSING $i in .gitattributes, adding as text, check if that is correct"
|
||||||
|
echo "$i text # automatically added - please verify" >> .gitattributes
|
||||||
|
fi
|
||||||
|
done
|
10
releng/scripts/do_all_code_cleanups.sh
Executable file
10
releng/scripts/do_all_code_cleanups.sh
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
|
${DIR}/do_format_code.sh
|
||||||
|
${DIR}/do_remove_trailing_whitespace.sh
|
||||||
|
${DIR}/do_add_all_file_types_to_gitattributes.sh
|
||||||
|
${DIR}/do_project_settings.sh
|
||||||
|
${DIR}/do_rebuild_natives.sh
|
23
releng/scripts/do_format_code.sh
Executable file
23
releng/scripts/do_format_code.sh
Executable file
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
##
|
||||||
|
# This script is reused by other projects, if so, COREPROJECT should be set
|
||||||
|
# to the project to use a basis for project settings
|
||||||
|
##
|
||||||
|
: ${COREPROJECT:=core/org.eclipse.cdt.core}
|
||||||
|
|
||||||
|
##
|
||||||
|
# Format code
|
||||||
|
##
|
||||||
|
: ${ECLIPSE:=~/buildtools/eclipse-SDK-4.13/eclipse}
|
||||||
|
if test -e check_code_cleanliness_workspace; then
|
||||||
|
echo check_code_cleanliness_workspace needs to be deleted
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
${ECLIPSE} \
|
||||||
|
-consolelog -nosplash -application org.eclipse.jdt.core.JavaCodeFormatter \
|
||||||
|
-config $PWD/$COREPROJECT/.settings/org.eclipse.jdt.core.prefs \
|
||||||
|
$PWD -data check_code_cleanliness_workspace
|
||||||
|
rm -rf check_code_cleanliness_workspace
|
98
releng/scripts/do_project_settings.sh
Executable file
98
releng/scripts/do_project_settings.sh
Executable file
|
@ -0,0 +1,98 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
|
||||||
|
##
|
||||||
|
# This script is reused by other projects, if so, COREPROJECT should be set
|
||||||
|
# to the project to use a basis for project settings
|
||||||
|
##
|
||||||
|
: ${COREPROJECT:=core/org.eclipse.cdt.core}
|
||||||
|
|
||||||
|
##
|
||||||
|
# Setup Eclipse Core Preferences
|
||||||
|
##
|
||||||
|
git ls-files -- \*\*/.project | while read i ; do
|
||||||
|
d=`dirname $i`;
|
||||||
|
mkdir -p $d/.settings
|
||||||
|
if ! test -e $d/.settings/org.eclipse.core.resources.prefs; then
|
||||||
|
echo 'eclipse.preferences.version=1' > $d/.settings/org.eclipse.core.resources.prefs
|
||||||
|
echo 'encoding/<project>=UTF-8' >> $d/.settings/org.eclipse.core.resources.prefs
|
||||||
|
fi
|
||||||
|
if ! grep 'encoding/<project>=UTF-8' $d/.settings/org.eclipse.core.resources.prefs > /dev/null; then
|
||||||
|
echo 'encoding/<project>=UTF-8' >> $d/.settings/org.eclipse.core.resources.prefs
|
||||||
|
fi
|
||||||
|
if ! grep 'eclipse.preferences.version=1' $d/.settings/org.eclipse.core.resources.prefs > /dev/null; then
|
||||||
|
echo 'eclipse.preferences.version=1' >> $d/.settings/org.eclipse.core.resources.prefs
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
##
|
||||||
|
# Copy JDT/PDE preferences
|
||||||
|
##
|
||||||
|
git ls-files -- \*\*/.project ":!$COREPROJECT/.project" | while read i ; do
|
||||||
|
d=`dirname $i`;
|
||||||
|
natures=$(xmllint --xpath 'string(//projectDescription/natures)' $i)
|
||||||
|
mkdir -p $d/.settings
|
||||||
|
|
||||||
|
# JDT
|
||||||
|
if [[ $natures == *"org.eclipse.jdt.core.javanature"* ]]; then
|
||||||
|
cp $COREPROJECT/.settings/org.eclipse.jdt.* $d/.settings
|
||||||
|
# For test plug-ins we are more lenient so don't warn on some items
|
||||||
|
if echo $i | grep -E '\.tests?[/\.]' > /dev/null; then
|
||||||
|
sed -i \
|
||||||
|
'-es@org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning@org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore@' \
|
||||||
|
'-es@org.eclipse.jdt.core.compiler.problem.discouragedReference=warning@org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore@' \
|
||||||
|
'-es@org.eclipse.jdt.core.compiler.problem.deprecation=warning@org.eclipse.jdt.core.compiler.problem.deprecation=ignore@' \
|
||||||
|
'-es@org.eclipse.jdt.core.compiler.problem.discouragedReference=warning@org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore@' \
|
||||||
|
'-es@org.eclipse.jdt.core.compiler.problem.emptyStatement=warning@org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore@' \
|
||||||
|
'-es@org.eclipse.jdt.core.compiler.problem.fieldHiding=warning@org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore@' \
|
||||||
|
'-es@org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning@org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore@' \
|
||||||
|
'-es@org.eclipse.jdt.core.compiler.problem.forbiddenReference=error@org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning@' \
|
||||||
|
'-es@org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning@org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore@' \
|
||||||
|
'-es@org.eclipse.jdt.core.compiler.problem.unusedLocal=warning@org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore@' \
|
||||||
|
'-es@org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning@org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore@' \
|
||||||
|
'-es@org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning@org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore@' \
|
||||||
|
'-es@org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning@org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore@' \
|
||||||
|
'-es@org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning@org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore@' \
|
||||||
|
$d/.settings/org.eclipse.jdt.core.prefs
|
||||||
|
fi
|
||||||
|
if echo $i | grep 'org.eclipse.cdt.examples.dsf' > /dev/null; then
|
||||||
|
sed -i \
|
||||||
|
'-es@org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning@org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore@' \
|
||||||
|
$d/.settings/org.eclipse.jdt.core.prefs
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
rm -f $d/.settings/org.eclipse.jdt*.prefs
|
||||||
|
fi
|
||||||
|
|
||||||
|
# PDE
|
||||||
|
if [[ $natures == *"org.eclipse.pde.PluginNature"* ]]; then
|
||||||
|
cp $COREPROJECT/.settings/org.eclipse.pde.prefs $d/.settings
|
||||||
|
cp $COREPROJECT/.settings/org.eclipse.pde.api.tools.prefs $d/.settings
|
||||||
|
if echo $i | grep -E '\.tests?[/\.]' > /dev/null; then
|
||||||
|
sed -i \
|
||||||
|
'-es@compilers.p.not-externalized-att=1@compilers.p.not-externalized-att=2@' \
|
||||||
|
$d/.settings/org.eclipse.pde.prefs
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
rm -f $d/.settings/org.eclipse.pde*.prefs
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
##
|
||||||
|
# Verify API Tooling is enabled for all non-test/example bundles
|
||||||
|
##
|
||||||
|
git ls-files -- \*\*/.project | while read i ; do
|
||||||
|
d=`dirname $i`;
|
||||||
|
natures=$(xmllint --xpath 'string(//projectDescription/natures)' $i)
|
||||||
|
if [[ $natures == *"org.eclipse.pde.PluginNature"* ]] && [[ $natures == *"org.eclipse.jdt.core.javanature"* ]]; then
|
||||||
|
if [[ $natures != *"org.eclipse.pde.api.tools.apiAnalysisNature"* ]]; then
|
||||||
|
if ! echo $i | grep -E '\.tests?[/\.]' > /dev/null && ! echo $i | grep -E '\.examples?[/\.]' > /dev/null; then
|
||||||
|
echo "$d is missing API Tools Nature - Turn it on in Eclipse by 1) Right-click project 2) Plug-in tools -> API Tools Setup"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
30
releng/scripts/do_rebuild_natives.sh
Executable file
30
releng/scripts/do_rebuild_natives.sh
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
##
|
||||||
|
# Make sure that natives are up to date
|
||||||
|
##
|
||||||
|
for p in native/org.eclipse.cdt.native.serial core/org.eclipse.cdt.core.native; do
|
||||||
|
echo "Rebuilding $p JNI headers to make sure they match source"
|
||||||
|
logfile=jni-headers-${p//\//-}.log
|
||||||
|
if ! ${MVN:-mvn} -B -V process-resources -DuseSimrelRepo -P jniheaders -f $p >${logfile} 2>&1; then
|
||||||
|
echo "Rebuilding of $p JNI headers failed. The log (${logfile}) is part of the artifacts of the build"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Rebuilding $p natives to make sure they match source"
|
||||||
|
logfile=make-natives-${p//\//-}.log
|
||||||
|
if ! make -C $p/native_src rebuild >${logfile} 2>&1; then
|
||||||
|
echo "Rebuilding of $p natives failed. The log (${logfile}) is part of the artifacts of the build"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
##
|
||||||
|
# Mark Windows binaries as executable
|
||||||
|
##
|
||||||
|
echo "Marking Windows binaries as executable"
|
||||||
|
git ls-files -- \*.exe \*.dll | while read line; do
|
||||||
|
chmod +x "$line"
|
||||||
|
done
|
14
releng/scripts/do_remove_trailing_whitespace.sh
Executable file
14
releng/scripts/do_remove_trailing_whitespace.sh
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
##
|
||||||
|
# Remove trailing whitespace.
|
||||||
|
# The .gitattributes is used as a filter to identify files to check. Patters with
|
||||||
|
# this "# check trailing whitespace" on the line before are checked
|
||||||
|
##
|
||||||
|
awk '/# remove trailing whitespace/{getline; print $1}' .gitattributes |
|
||||||
|
while read i ; do
|
||||||
|
echo "Removing trailing whitespace on $i files"
|
||||||
|
git ls-files -- "$i" | xargs --no-run-if-empty sed -i 's/[ \t]*$//'
|
||||||
|
done
|
Loading…
Add table
Reference in a new issue