Skip to content

Commit 3eb8af8

Browse files
committed
add xcode_version(), platform_tell()
1 parent 81a68b6 commit 3eb8af8

File tree

3 files changed

+54
-12
lines changed

3 files changed

+54
-12
lines changed

+stdlib/platform_tell.m

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
%% PLATFORM_TELL - Display information about the platform and environment
2+
3+
function platform_tell()
4+
5+
r = matlabRelease();
6+
fprintf('Matlab: %s %s %s\n', r.Release, computer('arch'), stdlib.cpu_arch());
7+
8+
if stdlib.has_java()
9+
fprintf('Java: %s %s Home: %s\n', stdlib.java_vendor(), stdlib.java_version(), stdlib.java_home());
10+
end
11+
12+
if stdlib.has_dotnet()
13+
fprintf('.NET: %s\n', stdlib.dotnet_version());
14+
end
15+
16+
if stdlib.has_python()
17+
fprintf('Python: %s Home: %s\n', stdlib.python_version(), stdlib.python_home());
18+
end
19+
20+
if ismac()
21+
fprintf('Xcode CLT: %s\n', stdlib.xcode_version());
22+
end
23+
24+
for lang = ["C", "C++", "Fortran"]
25+
co = mex.getCompilerConfigurations(lang);
26+
if ~isempty(co)
27+
fprintf('%s compiler: %s %s\n', lang, co.ShortName, co.Version)
28+
end
29+
end
30+
31+
end

+stdlib/xcode_version.m

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
%% XCODE_VERSION on macOS, tell the Xcode Command Line Tools version
2+
3+
function v = xcode_version()
4+
5+
v = '';
6+
7+
if ~ismac(), return, end
8+
9+
[s, m] = system('pkgutil --pkg-info com.apple.pkg.CLTools_Executables');
10+
11+
if s ~= 0, return, end
12+
13+
v = regexp(m, 'version: (\d+\.\d+(\.\d+)+)', 'tokens', 'once');
14+
15+
if isempty(v)
16+
v = '';
17+
else
18+
v = v{1};
19+
end
20+
21+
end

.github/workflows/ci.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,10 @@ jobs:
6464
if: ${{ matrix.release >= 'R2023a' && matrix.release < 'R2025a' }}
6565
run: matlab_jenv ${JAVA_HOME_11_X64}
6666

67-
- name: Matlab tell Java Version
67+
- name: Matlab tell External Language Interface versions
6868
uses: matlab-actions/run-command@v2
6969
with:
70-
command: "disp(stdlib.java_vendor()), disp(stdlib.java_version())"
71-
72-
- name: Matlab tell .NET version
73-
uses: matlab-actions/run-command@v2
74-
with:
75-
command: "disp(stdlib.dotnet_version())"
76-
77-
- name: Matlab tell Python version
78-
uses: matlab-actions/run-command@v2
79-
with:
80-
command: "disp(stdlib.python_version())"
70+
command: stdlib.platform_tell()
8171

8272
- name: Non-MEX tests
8373
uses: ./.github/workflows/composite-nomex

0 commit comments

Comments
 (0)