Skip to content

Commit 86a7d12

Browse files
SUPPORTED_PLATFORMS
1 parent 0800fda commit 86a7d12

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

dist/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57997,7 +57997,7 @@ const core = __nccwpck_require__(2186);
5799757997
const xcodebuild = '/usr/bin/xcodebuild';
5799857998
const xcrun = '/usr/bin/xcrun';
5799957999
const WORKSPACE = process.env.GITHUB_WORKSPACE || process.cwd();
58000-
const platforms = {
58000+
const platformMap = {
5800158001
'iphoneos': 'iOS',
5800258002
'macosx': 'macOS',
5800358003
'appletvos': 'tvOS',
@@ -58100,15 +58100,15 @@ async function parseBuildSettings(projectPath) {
5810058100
core.debug(`.pbxproj file path: ${projectFilePath}`);
5810158101
await fs.promises.access(projectFilePath, fs.constants.R_OK);
5810258102
const content = await fs.promises.readFile(projectFilePath, 'utf8');
58103-
const platformName = core.getInput('platform') || matchRegexPattern(content, /\s+SDK_ROOT = (?<platform>\w+)/, 'platform');
58104-
if (!platformName) {
58103+
const platform = core.getInput('platform') || matchRegexPattern(content, /\s+SUPPORTED_PLATFORMS = (?<platform>\w+)/, 'platform');
58104+
if (!platform) {
5810558105
throw new Error('Unable to determine the platform name from the build settings');
5810658106
}
5810758107
const bundleId = core.getInput('bundle-id') || matchRegexPattern(content, /\s+PRODUCT_BUNDLE_IDENTIFIER = (?<bundleId>[\w.-]+)/, 'bundleId');
5810858108
if (!bundleId || bundleId === 'NO') {
5810958109
throw new Error('Unable to determine the bundle ID from the build settings');
5811058110
}
58111-
return [platforms[platformName], bundleId];
58111+
return [platformMap[platform], bundleId];
5811258112
}
5811358113
async function getPlatformSdkVersion(projectPath, scheme, platform) {
5811458114
let buildSettingsOutput = '';
@@ -58133,8 +58133,8 @@ async function getPlatformSdkVersion(projectPath, scheme, platform) {
5813358133
if (!platformSdkVersion) {
5813458134
platformSdkVersion = matchRegexPattern(buildSettingsOutput, /\s+SDK_VERSION = (?<sdkVersion>[\d.]+)/, 'sdkVersion') || null;
5813558135
}
58136-
if (platforms[platform] !== 'macOS') {
58137-
await downloadPlatformSdkIfMissing(platforms[platform], platformSdkVersion);
58136+
if (platformMap[platform] !== 'macOS') {
58137+
await downloadPlatformSdkIfMissing(platformMap[platform], platformSdkVersion);
5813858138
}
5813958139
}
5814058140
function matchRegexPattern(string, pattern, group) {

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/xcode.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { SemVer } from 'semver';
2020
const xcodebuild = '/usr/bin/xcodebuild';
2121
const xcrun = '/usr/bin/xcrun';
2222
const WORKSPACE = process.env.GITHUB_WORKSPACE || process.cwd();
23-
const platforms = {
23+
const platformMap = {
2424
'iphoneos': 'iOS',
2525
'macosx': 'macOS',
2626
'appletvos': 'tvOS',
@@ -132,15 +132,15 @@ async function parseBuildSettings(projectPath: string): Promise<[string, string]
132132
core.debug(`.pbxproj file path: ${projectFilePath}`);
133133
await fs.promises.access(projectFilePath, fs.constants.R_OK);
134134
const content = await fs.promises.readFile(projectFilePath, 'utf8');
135-
const platformName = core.getInput('platform') || matchRegexPattern(content, /\s+SDK_ROOT = (?<platform>\w+)/, 'platform');
136-
if (!platformName) {
135+
const platform = core.getInput('platform') || matchRegexPattern(content, /\s+SUPPORTED_PLATFORMS = (?<platform>\w+)/, 'platform');
136+
if (!platform) {
137137
throw new Error('Unable to determine the platform name from the build settings');
138138
}
139139
const bundleId = core.getInput('bundle-id') || matchRegexPattern(content, /\s+PRODUCT_BUNDLE_IDENTIFIER = (?<bundleId>[\w.-]+)/, 'bundleId');
140140
if (!bundleId || bundleId === 'NO') {
141141
throw new Error('Unable to determine the bundle ID from the build settings');
142142
}
143-
return [platforms[platformName], bundleId];
143+
return [platformMap[platform], bundleId];
144144
}
145145

146146
async function getPlatformSdkVersion(projectPath: string, scheme: string, platform: string) {
@@ -166,8 +166,8 @@ async function getPlatformSdkVersion(projectPath: string, scheme: string, platfo
166166
if (!platformSdkVersion) {
167167
platformSdkVersion = matchRegexPattern(buildSettingsOutput, /\s+SDK_VERSION = (?<sdkVersion>[\d.]+)/, 'sdkVersion') || null;
168168
}
169-
if (platforms[platform] !== 'macOS') {
170-
await downloadPlatformSdkIfMissing(platforms[platform], platformSdkVersion);
169+
if (platformMap[platform] !== 'macOS') {
170+
await downloadPlatformSdkIfMissing(platformMap[platform], platformSdkVersion);
171171
}
172172
}
173173

0 commit comments

Comments
 (0)