|
1 | 1 | # This source file is part of the Swift.org open source project
|
2 | 2 | #
|
3 |
| -# Copyright (c) 2024 Apple Inc. and the Swift project authors |
| 3 | +# Copyright (c) 2024–2025 Apple Inc. and the Swift project authors |
4 | 4 | # Licensed under Apache License v2.0 with Runtime Library Exception
|
5 | 5 | #
|
6 | 6 | # See http://swift.org/LICENSE.txt for license information
|
7 | 7 | # See http://swift.org/CONTRIBUTORS.txt for Swift project authors
|
8 | 8 |
|
9 |
| -# The current version of the Swift Testing release. For release branches, |
10 |
| -# remember to remove -dev. |
11 |
| -set(SWT_TESTING_LIBRARY_VERSION "6.3-dev") |
12 |
| - |
13 |
| -find_package(Git QUIET) |
14 |
| -if(Git_FOUND) |
15 |
| - # Get the commit hash corresponding to the current build. Limit length to 15 |
16 |
| - # to match `swift --version` output format. |
17 |
| - execute_process( |
18 |
| - COMMAND ${GIT_EXECUTABLE} rev-parse --short=15 --verify HEAD |
19 |
| - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} |
20 |
| - OUTPUT_VARIABLE GIT_VERSION |
21 |
| - OUTPUT_STRIP_TRAILING_WHITESPACE |
22 |
| - ERROR_QUIET) |
23 |
| - |
24 |
| - # Check if there are local changes. |
25 |
| - execute_process( |
26 |
| - COMMAND ${GIT_EXECUTABLE} status -s |
27 |
| - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} |
28 |
| - OUTPUT_VARIABLE GIT_STATUS |
29 |
| - OUTPUT_STRIP_TRAILING_WHITESPACE) |
30 |
| - if(GIT_STATUS) |
31 |
| - set(GIT_VERSION "${GIT_VERSION} - modified") |
32 |
| - endif() |
33 |
| -endif() |
34 |
| - |
35 |
| -# Combine the hard-coded Swift version with available Git information. |
36 |
| -if(GIT_VERSION) |
37 |
| -set(SWT_TESTING_LIBRARY_VERSION "${SWT_TESTING_LIBRARY_VERSION} (${GIT_VERSION})") |
38 |
| -endif() |
39 |
| - |
40 |
| -# All done! |
41 |
| -message(STATUS "Swift Testing version: ${SWT_TESTING_LIBRARY_VERSION}") |
42 |
| -add_compile_definitions( |
43 |
| - "$<$<COMPILE_LANGUAGE:CXX>:SWT_TESTING_LIBRARY_VERSION=\"${SWT_TESTING_LIBRARY_VERSION}\">") |
| 9 | +# The library version is now tracked in version.txt at the root directory of the |
| 10 | +# repository. This file will be removed in a future commit. |
0 commit comments