Skip to content

Commit

Permalink
[releng] Make it easier to run cleanup scripts out of tree
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahgraham committed Feb 16, 2023
1 parent 78f437d commit cb367f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion releng/scripts/do_format_code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ 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
##
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
CDTDIR=${DIR}/../..
: ${COREPROJECT:=core/org.eclipse.cdt.core}

##
Expand All @@ -37,6 +39,6 @@ if test -e check_code_cleanliness_workspace; then
fi
${ECLIPSE} \
-consolelog -nosplash -application org.eclipse.jdt.core.JavaCodeFormatter \
-config $PWD/$COREPROJECT/.settings/org.eclipse.jdt.core.prefs \
-config $CDTDIR/$COREPROJECT/.settings/org.eclipse.jdt.core.prefs \
$PWD -data check_code_cleanliness_workspace
rm -rf check_code_cleanliness_workspace
8 changes: 5 additions & 3 deletions releng/scripts/do_project_settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ 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
##
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
CDTDIR=${DIR}/../..
: ${COREPROJECT:=core/org.eclipse.cdt.core}

##
Expand Down Expand Up @@ -47,7 +49,7 @@ git ls-files -- \*\*/.project ":!$COREPROJECT/.project" | while read i ; do

# JDT
if [[ $natures == *"org.eclipse.jdt.core.javanature"* ]]; then
cp $COREPROJECT/.settings/org.eclipse.jdt.* $d/.settings
cp $CDTDIR/$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 \
Expand Down Expand Up @@ -78,8 +80,8 @@ git ls-files -- \*\*/.project ":!$COREPROJECT/.project" | while read i ; do

# 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
cp $CDTDIR/$COREPROJECT/.settings/org.eclipse.pde.prefs $d/.settings
cp $CDTDIR/$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@' \
Expand Down

0 comments on commit cb367f0

Please sign in to comment.