Skip to content

Instantly share code, notes, and snippets.

@smarr
Created March 15, 2018 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smarr/6803aa169879d18b4779041bac8d9e32 to your computer and use it in GitHub Desktop.
Save smarr/6803aa169879d18b4779041bac8d9e32 to your computer and use it in GitHub Desktop.
Reduce Eclipse Release for to Code Formatting
#!/bin/bash
# Manually remove the product setting from configuration/config.ini
echo Manually remove the product setting from configuration/config.ini
# delete sources jars and other things
find ../eclipse -name "*.source*.jar" -delete
find ../eclipse -name "*.html" -delete
find ../eclipse -name "*.bmp" -delete
rm ../eclipse/icon.xpm
# now try to delete the other things
JARS=`find ../eclipse -name "*.jar"`
while read -r jar; do
mv ${jar} ${jar}-no
OUTPUT=`ant eclipseformat`
if [[ $OUTPUT = *"ERROR"* || $OUTPUT = *"Failed"* || $OUTPUT = *"unable"* || $OUTPUT = *"MESSAGE"* ]]; then
echo "Could not remove ${jar}"
mv ${jar}-no ${jar}
else
rm ${jar}-no
echo "Successfully removed ${jar}"
echo "rm ${jar}" >> ../delete2.sh
fi
done <<< "$JARS"
# create a copy of the eclipse folder (running it creates temp files)
# execute ../delete2.sh
# repackage
# tar -zcvf eclipse.tar.gz eclipse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment