-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure_xmlada.py
More file actions
executable file
·81 lines (67 loc) · 2.66 KB
/
configure_xmlada.py
File metadata and controls
executable file
·81 lines (67 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env python3
# ==============================================================================
# configure_xmlada.py - Configure xmlada dependency in Alire cache
# ==============================================================================
# Copyright (c) 2025 Michael Gardner, A Bit of Help, Inc.
# SPDX-License-Identifier: BSD-3-Clause
# See LICENSE file in the project root.
#
# Purpose:
# When Alire pulls xmlada as a transitive dependency (via gnatcoll/libgpr),
# it doesn't run configure, leaving xmlada_shared.gpr missing. This script
# finds xmlada directories in the test crate's Alire cache and runs configure.
#
# Usage:
# python3 scripts/python/makefile/configure_xmlada.py
# python3 scripts/python/makefile/configure_xmlada.py --verbose
# python3 scripts/python/makefile/configure_xmlada.py --project-root /path/to/project
#
# ==============================================================================
import argparse
import sys
from pathlib import Path
# Add parent directory to path for imports
sys.path.insert(0, str(Path(__file__).parent.parent))
from common import configure_xmlada_dependency, print_success, print_error, print_info
def main():
"""Main entry point."""
parser = argparse.ArgumentParser(
description='Configure xmlada dependency in Alire cache',
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""
This script fixes the "xmlada_shared.gpr not found" error that occurs when
Alire pulls xmlada as a transitive dependency. It finds xmlada directories
in test/alire/cache/dependencies/ and runs ./configure in each.
Examples:
%(prog)s # Configure xmlada in current project
%(prog)s --verbose # Show detailed progress
%(prog)s --project-root .. # Specify project root directory
"""
)
parser.add_argument(
'--project-root',
type=Path,
default=Path.cwd(),
help='Project root directory (default: current directory)'
)
parser.add_argument(
'--verbose', '-v',
action='store_true',
help='Show detailed progress'
)
args = parser.parse_args()
project_root = args.project_root.resolve()
if not project_root.exists():
print_error(f"Project root does not exist: {project_root}")
return 1
if args.verbose:
print_info(f"Project root: {project_root}")
success = configure_xmlada_dependency(project_root, verbose=args.verbose)
if success:
print_success("xmlada configuration complete")
return 0
else:
print_error("Some xmlada directories could not be configured")
return 1
if __name__ == '__main__':
sys.exit(main())