Commit ac619f5d authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: eclipse_setup/setup.sh: install templates (initial / --force with attic/ backup)

Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
parent 21719764
......@@ -8,8 +8,8 @@ each machine owns its own copies. This directory holds the tracked templates.
## After a fresh clone
```bash
cp -r eclipse_setup/.project eclipse_setup/.cproject \
eclipse_setup/.settings eclipse_setup/.externalToolBuilders .
eclipse_setup/setup.sh # initial setup (refuses to overwrite)
eclipse_setup/setup.sh --force # replace existing (backs up to attic/, close Eclipse first)
```
then import the project into Eclipse. From that point the live copies and the
......
#!/usr/bin/env bash
# Install the tracked Eclipse project templates into the repo root.
# By Claude on 07/11/2026.
#
# The live .project/.cproject/.settings/.externalToolBuilders are gitignored
# (machine-local); this copies the eclipse_setup/ templates up one level.
#
# Usage: eclipse_setup/setup.sh initial setup (refuses to overwrite)
# eclipse_setup/setup.sh --force replace existing (backup to attic/)
#
# Close Eclipse before running with --force: Eclipse rewrites these files on
# exit and would clobber the fresh copies.
set -e
cd "$(dirname "$0")/.." # repo root
ITEMS=".project .cproject .settings .externalToolBuilders"
FORCE=""
case "${1:-}" in
-f|--force) FORCE=1 ;;
"") ;;
*) echo "usage: $0 [--force]"; exit 1 ;;
esac
if pgrep -f 'eclipse|nsight' >/dev/null 2>&1; then
echo "WARNING: an eclipse/nsight process appears to be running." >&2
echo " It rewrites project files on exit - close it first." >&2
fi
existing=""
for i in $ITEMS; do
[ -e "$i" ] && existing="$existing $i"
done
if [ -n "$existing" ]; then
if [ -z "$FORCE" ]; then
echo "Existing:$existing"
echo "Refusing to overwrite - rerun with --force (backs up to attic/)."
exit 1
fi
backup="attic/eclipse_backup_$(date +%Y%m%d_%H%M%S)" # attic/ is gitignored
mkdir -p "$backup"
for i in $existing; do
mv "$i" "$backup/"
done
echo "Backed up:$existing -> $backup/"
fi
for i in $ITEMS; do
cp -r "eclipse_setup/$i" .
echo "Installed: $i"
done
echo "Done. Open/refresh the project in Eclipse."
echo "Per-machine steps that templates cannot carry (see eclipse_setup/README.md):"
echo " - Window > Preferences > CUDA: toolkit path (managed build only)"
echo " - Debug configs: cuda-gdb = /usr/local/cuda-12.8/bin/cuda-gdb (sm_120)"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment