Skip to content

Commit

Permalink
Xcode 16: allow to download iOSD platform
Browse files Browse the repository at this point in the history
Simple way to do it ie. interface is waiting result and block
  • Loading branch information
e-marchand committed Sep 13, 2024
1 parent ad1a085 commit 047e8b0
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Project/Sources/Classes/Xcode.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,18 @@ Function showDevicesWindow

LAUNCH EXTERNAL PROCESS:C811("open xcdevice://showDevicesWindow")

//====================================================================
Function downloadIOSPlatform() : Object
var $in; $out; $err : Text
LAUNCH EXTERNAL PROCESS:C811("xcodebuild -downloadPlatform iOS"; $in; $out; $err)
return New object:C1471("message"; $out; "error"; $err)

//====================================================================
Function downloadAllPlatform() : Object
var $in; $out; $err : Text
LAUNCH EXTERNAL PROCESS:C811("xcodebuild -downloadAllPlatforms"; $in; $out; $err)
return New object:C1471("message"; $out; "error"; $err)

//====================================================================
Function isCancelled()->$is : Boolean

Expand Down
10 changes: 10 additions & 0 deletions Project/Sources/Methods/RIBBON_SIMULATOR.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Case of
$menu.line()

$menu.append($tab+Get localized string:C991("openTheXcodeSimulatorsManager"); "XcodeDeviceManager")
$menu.append($tab+Get localized string:C991("downloadIOSPlatform"); "downloadIOSPlatform")

Else

Expand Down Expand Up @@ -207,6 +208,15 @@ Case of

cs:C1710.Xcode.new().showDevicesWindow()

//______________________________________________________
: ($menu.choice="downloadIOSPlatform")

// TODO: launch asynchronously (to not block), and maybe show message from command that download % of it
var $resultDl : Object
$resultDl:=(Shift down:C543) ? cs:C1710.Xcode.new().downloadAllPlatform() : cs:C1710.Xcode.new().downloadIOSPlatform()

ALERT:C41($resultDl.message+$resultDl.error)

//______________________________________________________
: ($menu.choice="createAVD")

Expand Down
4 changes: 4 additions & 0 deletions Resources/en.lproj/Main.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,10 @@ Make sure the device is connected to your computer with a USB cable.</target>
<source>Open the Xcode Simulators manager...</source>
<target>Open the Xcode Simulators manager...</target>
</trans-unit>
<trans-unit id="OEvOjjzmAnsaAYWrPucY/A" resname="downloadIOSPlatform">
<source>Download iOS platform for Xcode...</source>
<target>Download iOS platform for Xcode...</target>
</trans-unit>
</group>
<group resname="ERRORS">
<trans-unit id="bED/fpei/FAE7MlOk9WbZA" resname="ERR_MOBL_1">
Expand Down
4 changes: 4 additions & 0 deletions Resources/fr.lproj/Main.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,10 @@ Assurez-vous que le périphérique est connecté à votre ordinateur à l'aide d
<source>Open the Xcode Simulators manager...</source>
<target>Ouvrir le gestionnaire des simulateurs Xcode…</target>
</trans-unit>
<trans-unit id="OEvOjjzmAnsaAYWrPucY/A" resname="downloadIOSPlatform">
<source>Download iOS platform for Xcode...</source>
<target>Télécharger la platform iOS pour Xcode...</target>
</trans-unit>
</group>
<group resname="ERRORS">
<trans-unit id="bED/fpei/FAE7MlOk9WbZA" resname="ERR_MOBL_1">
Expand Down

0 comments on commit 047e8b0

Please sign in to comment.