Initial commit: reorganized source tree

- backend/: 13 Maven modules (cw-elevator-application, cloudwalk-cloud, intelligent-cwoscomponent, ninca-crk, etc.)
- frontend/: 4 Vue projects (elevator-front, cwos-portal, alarm-front, front_acs) + decompiled + scripts
- scripts/: build, test-env, tools (Docker Compose, service templates, API parity)
- docs/: AGENTS.md, superpowers specs, architecture docs
- .gitignore: standard Java/Maven exclusions

Moved from legacy maven-*/ root layout to backend/ organized structure.
This commit is contained in:
hpd840321
2026-05-09 09:00:12 +08:00
commit 7b2bd307f1
7260 changed files with 612980 additions and 0 deletions
+96
View File
@@ -0,0 +1,96 @@
#!/usr/bin/env python3
"""
Remove JD-Core decompiler noise from Java sources under maven-*:
- Line prefix comments: /* */ and /* N */ / /* N */ (line numbers; spaces around N vary)
- Trailing metadata block: /* Location: ... JD-Core Version: ... */
Does not strip normal Javadoc /** ... */ or arbitrary block comments.
"""
from __future__ import annotations
import argparse
import re
import sys
from pathlib import Path
RE_LINE_EMPTY_PREFIX = re.compile(r"^/\* +\*/\s*")
# JD-Core often emits "/* 90 */" (extra spaces after /* and/or before */)
RE_LINE_NUM_PREFIX = re.compile(r"^/\* *\d+ *\*/\s*")
# Ends with line like " */" (space + */) after "* JD-Core Version: ..."
RE_TAIL_META = re.compile(
r"(?:^|\n)/\* Location:.*?\n\s*\*/\s*",
re.DOTALL,
)
def strip_content(text: str) -> str:
text = text.replace("\r\n", "\n").replace("\r", "\n")
lines = text.split("\n")
stripped = []
for line in lines:
line = RE_LINE_EMPTY_PREFIX.sub("", line)
line = RE_LINE_NUM_PREFIX.sub("", line)
stripped.append(line)
joined = "\n".join(stripped)
joined = RE_TAIL_META.sub("\n", joined)
if joined and not joined.endswith("\n"):
joined += "\n"
return joined
def process_file(path: Path, dry_run: bool) -> bool:
raw = path.read_text(encoding="utf-8", errors="replace")
new = strip_content(raw)
raw_norm = raw.replace("\r\n", "\n").replace("\r", "\n")
if raw_norm and not raw_norm.endswith("\n"):
raw_norm += "\n"
if new == raw_norm:
return False
if not dry_run:
path.write_text(new, encoding="utf-8", newline="\n")
return True
def main() -> int:
ap = argparse.ArgumentParser(description=__doc__)
ap.add_argument(
"roots",
nargs="*",
type=Path,
help="Optional roots (default: all maven-* under repo root next to scripts/)",
)
ap.add_argument("--dry-run", action="store_true", help="Report only, do not write")
args = ap.parse_args()
script_dir = Path(__file__).resolve().parent
repo = script_dir.parent
if args.roots:
roots = [Path(p).resolve() for p in args.roots]
else:
roots = sorted(repo.glob("maven-*"))
roots = [p for p in roots if p.is_dir()]
changed = 0
scanned = 0
for root in roots:
if not root.exists():
print(f"skip missing: {root}", file=sys.stderr)
continue
for path in root.rglob("*.java"):
if "/target/" in str(path).replace("\\", "/"):
continue
scanned += 1
if process_file(path, args.dry_run):
changed += 1
if args.dry_run:
print(f"would update: {path}")
print(f"Scanned: {scanned} Java files under {len(roots)} root(s)")
print(f"{'Would change' if args.dry_run else 'Changed'}: {changed} file(s)")
return 0
if __name__ == "__main__":
sys.exit(main())