Skip to content

Commit 5f8ce87

Browse files
committed
move all modules under gemc/ and adopt <gemc/module/header.h> namespaced includes
1 parent 821da1c commit 5f8ce87

467 files changed

Lines changed: 297 additions & 894 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ci/doxygen.sh

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ guts goptions glogging gbase gfactory textProgressBar gtouchable ghit gtranslati
1111
gsystem gstreamer eventDispenser gqtbuttonswidget g4display g4dialog g4system gparticle gphysics gsplash gsd
1212
gfields gdetector dbselect gtree gui actions utilities)
1313

14-
script_dir="${0:A:h}"
1514
pages_dir="pages"
15+
script_dir="${0:A:h}"
16+
repo_root="${script_dir:h}"
17+
cd "$repo_root"
1618

1719
usage() {
1820
cat <<'EOF'
@@ -46,10 +48,13 @@ inplace_sed() {
4648
fi
4749
}
4850

49-
# Find module directory: supports either ./<module>/ or ./modules/<module>/
51+
# Find module directory: supports current ./gemc/<module>/ layout, plus older
52+
# ./<module>/ and ./modules/<module>/ layouts.
5053
module_dir_for() {
5154
local m="$1"
52-
if [[ -d "modules/$m" ]]; then
55+
if [[ -d "gemc/$m" ]]; then
56+
print -- "gemc/$m"
57+
elif [[ -d "modules/$m" ]]; then
5358
print -- "modules/$m"
5459
elif [[ -d "$m" ]]; then
5560
print -- "$m"
@@ -58,6 +63,26 @@ module_dir_for() {
5863
fi
5964
}
6065

66+
pages_rel_for() {
67+
local moddir="$1"
68+
if [[ "$moddir" == */* ]]; then
69+
print -- "../../$pages_dir"
70+
else
71+
print -- "../$pages_dir"
72+
fi
73+
}
74+
75+
set_doxy_key() {
76+
local key="$1"
77+
local value="$2"
78+
local file="$3"
79+
if grep -qE "^${key}[[:space:]]*=" "$file"; then
80+
inplace_sed "s|^${key}[[:space:]]*=.*|${key} = ${value}|g" "$file"
81+
else
82+
print -- "${key} = ${value}" >> "$file"
83+
fi
84+
}
85+
6186
selected=""
6287
while (( $# )); do
6388
case "$1" in
@@ -95,25 +120,25 @@ else
95120
fi
96121

97122
# Copy CSS into each module output after HTML pass; keep source of truth in doc/mydoxygen.css
98-
css_src="doc/mydoxygen.css"
99-
[[ -f "$css_src" ]] || css_src="../doc/mydoxygen.css"
123+
css_src="ci/mydoxygen.css"
100124

101-
# Absolute path to the canonical stylesheet in the repo root
102-
repo_root="${script_dir:h}"
103-
css_abs="$repo_root/doc/mydoxygen.css"
125+
css_abs="$repo_root/$css_src"
104126
[[ -f "$css_abs" ]] || die "Missing stylesheet: $css_abs"
105127

106128
# ---- PASS 1: TAG-only ----
107129
for m in $modules_to_build; do
108130
echo " [PASS 1] Generating TAG for $m"
109131
moddir="$(module_dir_for "$m")" || die "Module dir not found for '$m'"
110132
mkdir -p "$pages_dir/$m"
133+
pages_rel="$(pages_rel_for "$moddir")"
111134

112135
pushd "$moddir" >/dev/null
113136
ln -sf "$css_abs" mydoxygen.css
114137

115138
"$script_dir/create_doxygen.sh" "$m"
116139
[[ -f Doxyfile ]] || die "Missing Doxyfile in '$moddir'"
140+
set_doxy_key "OUTPUT_DIRECTORY" "$pages_rel" Doxyfile
141+
set_doxy_key "GENERATE_TAGFILE" "$pages_rel/$m/$m.tag" Doxyfile
117142

118143
# Ensure TAG pass doesn't emit HTML
119144
if grep -qE '^GENERATE_HTML[[:space:]]*=' Doxyfile; then
@@ -126,7 +151,7 @@ for m in $modules_to_build; do
126151
inplace_sed '/^TAGFILES\b/d' Doxyfile
127152

128153
doxygen Doxyfile
129-
[[ -f "../$pages_dir/$m/$m.tag" ]] || die "Tag file not produced: $pages_dir/$m/$m.tag"
154+
[[ -f "$pages_rel/$m/$m.tag" ]] || die "Tag file not produced: $pages_dir/$m/$m.tag"
130155

131156
popd >/dev/null
132157
echo
@@ -137,12 +162,15 @@ for m in $modules_to_build; do
137162
echo " [PASS 2] Generating HTML for $m (with cross-links)"
138163
moddir="$(module_dir_for "$m")" || die "Module dir not found for '$m'"
139164
mkdir -p "$pages_dir/$m"
165+
pages_rel="$(pages_rel_for "$moddir")"
140166

141167
pushd "$moddir" >/dev/null
142168
ln -sf "$css_abs" mydoxygen.css
143169

144170
"$script_dir/create_doxygen.sh" "$m"
145171
[[ -f Doxyfile ]] || die "Missing Doxyfile in '$moddir'"
172+
set_doxy_key "OUTPUT_DIRECTORY" "$pages_rel" Doxyfile
173+
set_doxy_key "GENERATE_TAGFILE" "$pages_rel/$m/$m.tag" Doxyfile
146174

147175
# Ensure HTML is enabled in pass 2
148176
if grep -qE '^GENERATE_HTML[[:space:]]*=' Doxyfile; then
@@ -156,8 +184,8 @@ for m in $modules_to_build; do
156184

157185
for other in $doc_modules; do
158186
[[ "$other" == "$m" ]] && continue
159-
if [[ -f "../$pages_dir/$other/$other.tag" ]]; then
160-
echo "TAGFILES += ../$pages_dir/$other/$other.tag=../$other" >> Doxyfile
187+
if [[ -f "$pages_rel/$other/$other.tag" ]]; then
188+
echo "TAGFILES += $pages_rel/$other/$other.tag=../$other" >> Doxyfile
161189
fi
162190
done
163191

ci/install_python_env.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,18 @@
2121
print(' > Skipping Python environment installation (GEMC_SKIP_PYTHON_ENV_INSTALL=1)')
2222
sys.exit(0)
2323

24-
prefix = Path(os.environ['MESON_INSTALL_PREFIX'])
24+
prefix = Path(os.environ['MESON_INSTALL_PREFIX'])
2525
pygemc_src = sys.argv[1]
26-
venv_dir = prefix / 'python_env'
26+
venv_dir = prefix / 'python_env'
27+
venv_python = str(venv_dir / 'bin' / 'python3')
28+
29+
if venv_dir.exists():
30+
print(f' > Python environment already exists at {venv_dir}, updating pygemc only')
31+
subprocess.run([venv_python, '-m', 'pip', 'install', pygemc_src], check=True)
32+
sys.exit(0)
2733

2834
print(f' > Installing Python environment at {venv_dir}')
2935
subprocess.run([sys.executable, '-m', 'venv', str(venv_dir)], check=True)
30-
31-
venv_python = str(venv_dir / 'bin' / 'python3')
32-
subprocess.run([venv_python, '-m', 'pip', 'install', '--no-cache-dir',
33-
'--upgrade', 'pip', 'setuptools', 'wheel'], check=True)
34-
subprocess.run([venv_python, '-m', 'pip', 'install', '--no-cache-dir', pygemc_src], check=True)
36+
subprocess.run([venv_python, '-m', 'pip', 'install', '--upgrade',
37+
'pip', 'setuptools', 'wheel'], check=True)
38+
subprocess.run([venv_python, '-m', 'pip', 'install', pygemc_src], check=True)

dbselect/examples/example.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

doc/Doxy_README.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

doc/PrivacyPolicy.txt

Lines changed: 0 additions & 169 deletions
This file was deleted.

doc/gemcDoxy.h

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)