TASKPM/migrate/rebrand-taskpm.sh

107 lines
4.3 KiB
Bash
Raw Normal View History

#!/bin/bash
# LibrePlan → TASKPM Rebrand Script
# Run from /space/work/pkgs/libreplan
#
# Status: PARTIALLY COMPLETE (2026-01-22)
# - UI strings, CSS, configs updated
# - Build shows "TASKPM" in reactor
# - Deferred: package names, directory renames, full i18n verification
set -e
echo "=== LibrePlan → TASKPM Rebrand Script ==="
echo ""
# Phase 1: UI Text - i18n .po files (both msgid AND msgstr)
echo "Phase 1: Updating i18n .po files..."
find libreplan-webapp/src/main/resources/i18n -name "*.po" -exec sed -i \
-e 's/Project-Id-Version: LibrePlan/Project-Id-Version: TASKPM/g' \
-e 's/msgid "LibrePlan:/msgid "TASKPM:/g' \
-e 's/msgstr "LibrePlan:/msgstr "TASKPM:/g' \
-e 's/LibrePlan is funded/TASKPM is funded/g' \
-e 's/without you, LibrePlan/without you, TASKPM/g' \
-e 's/means LibrePlan continues/means TASKPM continues/g' \
-e 's/use with LibrePlan/use with TASKPM/g' \
-e 's/page of LibrePlan/page of TASKPM/g' \
-e 's/LibrePlan role/TASKPM role/g' \
-e 's/new LibrePlan versions/new TASKPM versions/g' \
{} \;
echo " Updated .po files (msgid + msgstr)"
# Phase 2: ZUL pages - visible UI
echo "Phase 2: Updating ZUL page titles and text..."
find libreplan-webapp/src/main/webapp -name "*.zul" -exec sed -i \
-e "s/LibrePlan:/TASKPM:/g" \
-e 's/alt="LibrePlan"/alt="TASKPM"/g' \
-e 's/LibrePlan is funded/TASKPM is funded/g' \
-e 's/without you, LibrePlan/without you, TASKPM/g' \
-e 's/means LibrePlan continues/means TASKPM continues/g' \
-e 's/use with LibrePlan/use with TASKPM/g' \
{} \;
echo " Updated ZUL files"
# Phase 3: CSS file references (not renaming files yet, just references)
echo "Phase 3: Updating CSS references in templates..."
find libreplan-webapp/src/main/webapp -name "*.zul" -exec sed -i \
-e 's/libreplan\.css/taskpm.css/g' \
-e 's/libreplan_zk\.css/taskpm_zk.css/g' \
{} \;
echo " Updated CSS references"
# Phase 4: Rename CSS files
echo "Phase 4: Renaming CSS files..."
if [ -f libreplan-webapp/src/main/webapp/common/css/libreplan.css ]; then
mv libreplan-webapp/src/main/webapp/common/css/libreplan.css \
libreplan-webapp/src/main/webapp/common/css/taskpm.css
echo " Renamed libreplan.css → taskpm.css"
fi
if [ -f libreplan-webapp/src/main/webapp/common/css/libreplan_zk.css ]; then
mv libreplan-webapp/src/main/webapp/common/css/libreplan_zk.css \
libreplan-webapp/src/main/webapp/common/css/taskpm_zk.css
echo " Renamed libreplan_zk.css → taskpm_zk.css"
fi
# Phase 5: Java hardcoded strings
echo "Phase 5: Updating Java hardcoded strings..."
sed -i 's/"LibrePlan"/"TASKPM"/g' \
libreplan-webapp/src/main/java/org/libreplan/web/LoggingConfiguration.java
echo " Updated LoggingConfiguration.java"
# Phase 6: Web.xml display name
echo "Phase 6: Updating web.xml..."
sed -i 's/<display-name>libreplan-webapp<\/display-name>/<display-name>taskpm-webapp<\/display-name>/g' \
libreplan-webapp/src/main/webapp/WEB-INF/web.xml
echo " Updated web.xml display-name"
# Phase 7: Remove libreplan-enterprise.com references (defunct)
echo "Phase 7: Updating external links..."
find libreplan-webapp/src/main/webapp -name "*.zul" -exec sed -i \
-e 's|http://www.libreplan-enterprise.com|https://meansofproduction.biz|g' \
{} \;
echo " Updated enterprise links"
# Phase 8: pom.xml project names (cosmetic, not artifact IDs yet)
echo "Phase 8: Updating pom.xml project names..."
sed -i 's/<name>LibrePlan<\/name>/<name>TASKPM<\/name>/g' pom.xml
sed -i 's/<name>LibrePlan Business Module<\/name>/<name>TASKPM Business Module<\/name>/g' libreplan-business/pom.xml
sed -i 's/<name>LibrePlan Web Client Module<\/name>/<name>TASKPM Web Client Module<\/name>/g' libreplan-webapp/pom.xml
echo " Updated pom.xml names"
# Phase 9: README
echo "Phase 9: Updating README..."
sed -i 's/\*LibrePlan\*/\*TASKPM\*/g' README.rst
sed -i 's/LibrePlan is/TASKPM is/g' README.rst
echo " Updated README.rst"
echo ""
echo "=== Phase 1-9 Complete (UI/Config rebrand) ==="
echo ""
echo "Deferred (requires more invasive changes):"
echo " - Maven artifact IDs (libreplan-* → taskpm-*)"
echo " - Java package names (org.libreplan → org.taskpm)"
echo " - Directory names"
echo " - Database names (libreplandev → taskpmdev)"
echo " - JNDI names"
echo ""
echo "Next: Build and test with 'mvn clean install -DskipTests'"