(
source: Path,
target: Path,
framework: Path,
platform: str,
apps: list[Path],
)
| 120 | |
| 121 | |
| 122 | def clone_testbed( |
| 123 | source: Path, |
| 124 | target: Path, |
| 125 | framework: Path, |
| 126 | platform: str, |
| 127 | apps: list[Path], |
| 128 | ) -> None: |
| 129 | if target.exists(): |
| 130 | print(f"{target} already exists; aborting without creating project.") |
| 131 | sys.exit(10) |
| 132 | |
| 133 | if framework is None: |
| 134 | if not ( |
| 135 | source / "Python.xcframework" / TEST_SLICES[platform] / "bin" |
| 136 | ).is_dir(): |
| 137 | print( |
| 138 | f"The testbed being cloned ({source}) does not contain " |
| 139 | "a framework with slices. Re-run with --framework" |
| 140 | ) |
| 141 | sys.exit(11) |
| 142 | else: |
| 143 | if not framework.is_dir(): |
| 144 | print(f"{framework} does not exist.") |
| 145 | sys.exit(12) |
| 146 | elif not ( |
| 147 | framework.suffix == ".xcframework" |
| 148 | or (framework / "Python.framework").is_dir() |
| 149 | ): |
| 150 | print( |
| 151 | f"{framework} is not an XCframework, " |
| 152 | f"or a simulator slice of a framework build." |
| 153 | ) |
| 154 | sys.exit(13) |
| 155 | |
| 156 | print("Cloning testbed project:") |
| 157 | print(f" Cloning {source}...", end="") |
| 158 | # Only copy the files for the platform being cloned plus the files common |
| 159 | # to all platforms. The XCframework will be copied later, if needed. |
| 160 | target.mkdir(parents=True) |
| 161 | |
| 162 | for name in [ |
| 163 | "__main__.py", |
| 164 | "TestbedTests", |
| 165 | "Testbed.lldbinit", |
| 166 | f"{platform}Testbed", |
| 167 | f"{platform}Testbed.xcodeproj", |
| 168 | f"{platform}Testbed.xctestplan", |
| 169 | ]: |
| 170 | copy(source / name, target / name) |
| 171 | |
| 172 | print(" done") |
| 173 | |
| 174 | orig_xc_framework_path = source / "Python.xcframework" |
| 175 | xc_framework_path = target / "Python.xcframework" |
| 176 | test_framework_path = xc_framework_path / TEST_SLICES[platform] |
| 177 | if framework is not None: |
| 178 | if framework.suffix == ".xcframework": |
| 179 | print(" Installing XCFramework...", end="") |
no test coverage detected
searching dependent graphs…