You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
script "revDeployLibrary"////////////////////////////////////////////////////////////////////////////////-- A stack can be configured to be deployable to any number of different platforms.-- This presents a usability problem when switching between stacks configured for-- different platforms.-- To resolve this, we keep track of the last selected target for each platform and the-- order in which other platforms were last selected.-- The 'Test Target' menu disables all targets for which the current stack is not-- configured for.-- The current 'Test Target' is determined to be the first platform in the platform choice-- history for which the stack is configured. This is then used to pick the last chosen-- target for this platform.constant kSupportedPlatforms = "iOS Android"-- The mapping from deploy target to platformlocal sDeployTargetPlatforms-- The currently chosen deploy target for each platformlocal sDeployTargets-- The ordered list of platforms, in order of last choicelocal sDeployPlatforms-- Used to stop DeployAction being executed inside itselflocal sDeployActionInProgress-- This method is invoked by the menu bar when the user elects to test the-- current stack.command revIDEDeployAction if sDeployActionInProgress then exit revIDEDeployAction end if -- Get the stack we are dealing with local tStack put the mainStack of the topStack into tStack -- Make sure we save the stack if it needs it set the defaultStack to tStack if not revSaveCheck(tStack) then exit revIDEDeployAction end if -- Get the target local tTarget put revIDEDeployGetTarget() into tTarget -- Get the target platform local tPlatform put sDeployTargetPlatforms[tTarget] into tPlatform put true into sDeployActionInProgress -- Invoke the action in the appropriate platform-specific library local tError if there is a button tPlatform of me then dispatch "deployDo" to button tPlatform of me with tStack, tTarget put the result into tError else put "Unknown deployment platform - " & tPlatform into tError end if -- Report an error if one occured if tError is not empty then if revTestEnvironment() then return tError else answer error tError end if end if put false into sDeployActionInProgressend revIDEDeployAction-- This method is invoked (currently) by the standalone builder to deploy a mobile-- platform (not currently used as more work is needed to extricate standalone-- building from the standalone settings main stack).command revIDEDeployBuild pPlatform, pTargetStack, pOutputFolder -- Make sure we are dealing with main stack put the mainStack of stack pTargetStack into pTargetStack -- Dispatch the action to the platform-specific library dispatch "deployBuild" to button pPlatform of me with pTargetStack, pOutputFolderend revIDEDeployBuild-- This method is invoked by the menu bar to construct the current list of targets.-- It returns an array, one element per platform; each element consisting of the list-- of possible targets.function revIDEDeployListTargets local tTargets repeat for each word tPlatform in kSupportedPlatforms dispatch function "deployListTargets" to button tPlatform of me if it is "handled" and the result is not empty then put the result into tTargets[tPlatform] end if end repeat return tTargetsend revIDEDeployListTargets-- This method is invoked by the menu bar when the user selects a different deploy-- target.command revIDEDeploySetTarget pTarget local tPlatform put sDeployTargetPlatforms[pTarget] into tPlatform delete item itemOffset(tPlatform, sDeployPlatforms) of sDeployPlatforms put tPlatform, sDeployPlatforms into sDeployPlatforms put pTarget into sDeployTargets[tPlatform] set the cDeployPlatforms of stack "revPreferences" to sDeployPlatforms set the cDeployTargets of stack "revPreferences" to sDeployTargets revIDEDeployUpdateend revIDEDeploySetTarget-- This method returns the current target of the 'Deploy' action.function revIDEDeployGetTarget if the mode of the topStack is 1 then local tStack put the mainStack of the topStack into tStack repeat for each item tPlatform in sDeployPlatforms if the cRevStandaloneSettings[tPlatform] of stack tStack then return sDeployTargets[tPlatform] end if end repeat end if return emptyend revIDEDeployGetTarget-- This method returns true if deployment is possible with the given platform to the-- current top stackfunction revIDEDeployIsPossible pPlatform if the mode of the topStack is not 1 then return false end if local tStack put the mainStack of the topStack into tStack return the cRevStandaloneSettings[pPlatform] of stack tStackend revIDEDeployIsPossible-- This method updates the enable state of the 'Test' button on the menubar based on-- the current topStack.command revIDEDeployUpdate -- Enable the deploy button appropriately set the enabled of button "Deploy" of stack "revMenuBar" to revIDEDeployGetTarget() is not emptyend revIDEDeployUpdate-- This method is called on startup to initialize the deployment library. This includes-- attempting to auto-configure any SDKs and such if necessary.command revIDEDeployInitialize repeat for each word tPlatform in kSupportedPlatforms dispatch command "deployInitialize" to button tPlatform of me end repeat local tDeployPlatforms, tDeployTargets put the cDeployPlatforms of stack "revPreferences" into tDeployPlatforms put the cDeployTargets of stack "revPreferences" into tDeployTargets if tDeployPlatforms is not empty then put tDeployPlatforms into sDeployPlatforms put tDeployTargets into sDeployTargets else if the cSimulatorFamily of stack "revPreferences" is not empty then put "ios," into sDeployPlatforms put the cSimulatorFamily of stack "revPreferences" && "Simulator" && the cSimulatorVersion of stack "revPreferences" into sDeployTargets["ios"] end ifend revIDEDeployInitializeon revIDEDeployTargetsChanged put empty into sDeployTargetPlatforms repeat for each word tPlatform in kSupportedPlatforms dispatch function "deployListTargets" to button tPlatform of me if it is "handled" and the result is not empty then repeat for each line tTarget in the result put tPlatform into sDeployTargetPlatforms[tTarget] end repeat end if end repeatend revIDEDeployTargetsChanged//////////////////////////////////////////////////////////////////////////////////// Preferences require access to various specific aspects of deployment config, so these// calls provide this in a sane manner.//function revIDEDeployIOSIsValidSDK pVersion, pPath dispatch function "deployIsValidSDK" to button "iOS" of me with pVersion, pPath return the resultend revIDEDeployIOSIsValidSDKfunction revIDEDeployIOSGetSimulatorVersions dispatch function "deployGetSimulatorVersions" to button "iOS" of me return the resultend revIDEDeployIOSGetSimulatorVersionsfunction revIDEDeployIOSGetSDKVersions dispatch function "deployGetSDKVersions" to button "iOS" of me return the resultend revIDEDeployIOSGetSDKVersionscommand revIDEDeployIOSUpdateSimulators dispatch "deployUpdateSimulators" to button "iOS" of meend revIDEDeployIOSUpdateSimulatorscommand revIDEDeployIOSUpdateSDKs dispatch "deployUpdateSDKs" to button "iOS" of meend revIDEDeployIOSUpdateSDKsfunction revIDEDeployIOSGetDeviceSDK pVersion dispatch function "deployGetDeviceSDK" to button "iOS" of me with pVersion return the resultend revIDEDeployIOSGetDeviceSDK//////////////////////////////////////////////////////////////////////////////////// Preferences require access to various specific aspects of deployment config, so these// calls provide this in a sane manner.//function revIDEDeployAndroidIsValidSDK pPath dispatch function "deployIsValidSDK" to button "Android" of me with pPath return the resultend revIDEDeployAndroidIsValidSDKfunction revIDEDeployAndroidIsValidJDK pPath dispatch function "deployIsValidJDK" to button "Android" of me with pPath return the resultend revIDEDeployAndroidIsValidJDKfunction revIDEDeployAndroidGetJDK dispatch function "deployGetJDK" to button "Android" of me return the resultend revIDEDeployAndroidGetJDKcommand revIDEDeployAndroidInitialize dispatch "deployInitialize" to button "Android" of meend revIDEDeployAndroidInitialize////////////////////////////////////////////////////////////////////////////////
0 commit comments