Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build all macOS platforms at the same time #211

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 44 additions & 2 deletions packager/packager.livecodescript
Expand Up @@ -126,6 +126,7 @@ command packagerPackageApplication pStandaloneStackFilename, pBuildProfile, pSim
local tPlatform, tArchitecture, tBuildPlatform
local tAppA, tWorkingOutputFolder, tExecutableOutputFolder
local tCertName
local tBuiltForMacOS = false

repeat for each item tBuildPlatform in tStandaloneBuilderPlatforms
put _buildPlatformToLevurePlatform(tBuildPlatform) into tPlatform
Expand All @@ -135,6 +136,12 @@ command packagerPackageApplication pStandaloneStackFilename, pBuildProfile, pSim
if tPlatform is "macos" and the platform is not "macos" then next repeat
if not _shouldBuildForPlatform(tPlatform, tPlatformFilter) then next repeat

# MacOS builds universal binaries so only build once for the platform.
if tPlatform is "macos" then
if tBuiltForMacOS then next repeat
put true into tBuiltForMacOS
end if

# Create folder for copy files
log "packaging for platform:" && tPlatform

Expand Down Expand Up @@ -316,6 +323,30 @@ command packagerPackageApplication pStandaloneStackFilename, pBuildProfile, pSim
end packagerPackageApplication


# The mac standalone builder lumps all platforms together
private function _platformsToBuildFor pStandaloneStackFilename, pBuildForPlatform
local tPlatform

put _buildPlatformToLevurePlatform(pBuildForPlatform) into tPlatform

if tPlatform is "macos" then
local tMacPlatforms, tMacPlatform, tPlatforms

put "MacOSX x86-32,MacOSX x86-64,MacOSX arm64" into tMacPlatforms

repeat for each item tMacPlatform in tMacPlatforms
if the cRevStandaloneSettings[tMacPlatform] of stack pStandaloneStackFilename then
put tMacPlatform & "," after tPlatforms
end if
end repeat
delete the last char of tPlatforms
return tPlatforms
else
return pBuildForPlatform
end if
end _platformsToBuildFor


private command _determineSigningCertificate pBuildProfile, pPlatform, @xAppA
local tKey, tCert

Expand Down Expand Up @@ -529,8 +560,9 @@ end _dispatchPackagingComplete


command packagerBuildStandaloneForTesting pStandaloneStackFilename
local tError, tOutputFolder, tHideConsole
local tError, tOutputFolder, tHideConsole, tBuildPlatform, tPlatform
local tBuildProfile = "test"
local tBuiltForMacOS = false

put the hideConsoleWindows into tHideConsole
set the hideConsoleWindows to true
Expand All @@ -553,6 +585,13 @@ command packagerBuildStandaloneForTesting pStandaloneStackFilename
if tBuildPlatform is among the items of kPlatformsThatCantTest \
OR not the cRevStandaloneSettings[tBuildPlatform] of stack pStandaloneStackFilename then next repeat

# MacOS builds universal binaries so only build once for the platform.
put _buildPlatformToLevurePlatform(tBuildPlatform) into tPlatform
if tPlatform is "macos" then
if tBuiltForMacOS then next repeat
put true into tBuiltForMacOS
end if

packagerBuildStandalones pStandaloneStackFilename, tBuildPlatform, tBuildProfile, empty, sAppA
put the result into tError

Expand Down Expand Up @@ -753,8 +792,11 @@ command packagerBuildStandalones pStandaloneStackFilename, pBuildForPlatform, pB
end if

# Only build for target platform
local tPlatform, tPlatformsToBuildFor
put _platformsToBuildFor(tTempStandaloneStack, pBuildForPlatform) into tPlatformsToBuildFor

repeat for each item tPlatform in kStandaloneBuilderPlatforms
set the cRevStandaloneSettings[tPlatform] of stack tTempStandaloneStack to tPlatform is pBuildForPlatform
set the cRevStandaloneSettings[tPlatform] of stack tTempStandaloneStack to tPlatform is in tPlatformsToBuildFor
end repeat

set the cRevStandaloneSettings["files"] of stack tTempStandaloneStack to pCopyFiles
Expand Down