From 9134280940e448b68c03686b3e884d5381dca9b0 Mon Sep 17 00:00:00 2001 From: Christophe Demarey Date: Wed, 30 Aug 2023 12:03:16 +0200 Subject: [PATCH 01/21] Do not open Pharo Launcher UI at startup when in interactive mode --- src/PharoLauncher-Spec2/PhLDeploymentScript.class.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PharoLauncher-Spec2/PhLDeploymentScript.class.st b/src/PharoLauncher-Spec2/PhLDeploymentScript.class.st index ed0d6d59..f48a51df 100644 --- a/src/PharoLauncher-Spec2/PhLDeploymentScript.class.st +++ b/src/PharoLauncher-Spec2/PhLDeploymentScript.class.st @@ -166,7 +166,7 @@ PhLDeploymentScript class >> isDeployed [ { #category : #'system startup' } PhLDeploymentScript class >> launcherStartUp [ - self isDeployed + (self isDeployed and: [ Smalltalk isInteractive not ]) ifTrue: [ self closeWindowsAndOpenLauncher ] ] From a299229aba7d321e7fff32754888ed97de7b7092 Mon Sep 17 00:00:00 2001 From: Christophe Demarey Date: Wed, 30 Aug 2023 17:17:45 +0200 Subject: [PATCH 02/21] Do not initialise Ombu when deployed (uses networks name resolution that is very long) --- src/PharoLauncher-Core/OmSessionStore.extension.st | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/PharoLauncher-Core/OmSessionStore.extension.st diff --git a/src/PharoLauncher-Core/OmSessionStore.extension.st b/src/PharoLauncher-Core/OmSessionStore.extension.st new file mode 100644 index 00000000..0164d245 --- /dev/null +++ b/src/PharoLauncher-Core/OmSessionStore.extension.st @@ -0,0 +1,9 @@ +Extension { #name : #OmSessionStore } + +{ #category : #'*PharoLauncher-Core' } +OmSessionStore class >> startUp [ + + PharoLauncherApplication isDeployed ifTrue: [ ^ self ]. + + registry do: [ :each | each store ] +] From 286d9e5d0df0ae47c51f8aaf9fe0e8619a1796a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Morales=20Durand?= Date: Tue, 19 Sep 2023 20:59:15 +0200 Subject: [PATCH 03/21] Small shell changes from bash linter checks --- build.sh | 9 +++++---- linux/pharo-launcher | 4 ++-- mac/build-dmg.sh | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index 5017ab66..ba792a07 100755 --- a/build.sh +++ b/build.sh @@ -24,7 +24,7 @@ function prepare_image() { esac wget --quiet -O - get.pharo.org/$ARCH_PATH$PHARO | bash wget --quiet -O - get.pharo.org/$ARCH_PATH$VM$PHARO | bash - echo $PHARO > 'pharo.version' + echo "$PHARO" > 'pharo.version' ./pharo Pharo.image save PharoLauncher --delete-old ./pharo PharoLauncher.image --version > version.txt @@ -92,7 +92,8 @@ function package_mac_version() { fetch_current_mac_vm_to $(pwd)/$OUTPUT_PATH VERSION=$VERSION_NUMBER APP_NAME=PharoLauncher SHOULD_SIGN=false ./mac/build-dmg.sh - local generated_dmg=$(echo *.dmg) + local generated_dmg + generated_dmg=$(echo *.dmg) mv "$generated_dmg" "PharoLauncher-$VERSION_NUMBER.dmg" generated_dmg=$(echo *.dmg) md5 "$generated_dmg" > "$generated_dmg.md5sum" @@ -118,7 +119,7 @@ function copy_current_stable_image_to() { local DEST_PATH=${1:-.} # If no argument given, use current working dir local IMAGES_PATH=$DEST_PATH/images mkdir "$IMAGES_PATH" - wget --progress=dot:mega -P $IMAGES_PATH https://files.pharo.org/image/stable/stable-64.zip + wget --progress=dot:mega -P "$IMAGES_PATH" https://files.pharo.org/image/stable/stable-64.zip mv "$IMAGES_PATH/stable-64.zip" "$IMAGES_PATH/pharo-stable.zip" } @@ -212,7 +213,7 @@ linux-package) package_linux_version ;; mac-package) - package_mac_version $SHOULD_SIGN + package_mac_version "$SHOULD_SIGN" ;; *) echo "No valid target specified! Exiting" diff --git a/linux/pharo-launcher b/linux/pharo-launcher index 3db3d9c1..3979a18f 100755 --- a/linux/pharo-launcher +++ b/linux/pharo-launcher @@ -1,8 +1,8 @@ #!/usr/bin/env bash # path -DIR=`readlink -f $0` #resolve symlink -ROOT=`dirname "$DIR"` #obtain dir of the resolved path +DIR=$(readlink -f "$0") #resolve symlink +ROOT=$(dirname "$DIR") #obtain dir of the resolved path LINUX="$ROOT/pharo-vm" RESOURCES="$ROOT/shared" ICONS="$ROOT/icons" diff --git a/mac/build-dmg.sh b/mac/build-dmg.sh index a2e9594c..b1fee87f 100755 --- a/mac/build-dmg.sh +++ b/mac/build-dmg.sh @@ -27,8 +27,8 @@ readonly DMG_FINAL="${VOL_NAME/ /_}.dmg" # final DMG name will be "Super readonly STAGING_DIR="./Install" # we copy all our stuff into this dir check_background_image_DPI_and_convert_it_if_not_72_by_72() { - local _BACKGROUND_IMAGE_DPI_H=`sips -g dpiHeight ${DMG_BACKGROUND_IMG} | grep -Eo '[0-9]+\.[0-9]+'` - local _BACKGROUND_IMAGE_DPI_W=`sips -g dpiWidth ${DMG_BACKGROUND_IMG} | grep -Eo '[0-9]+\.[0-9]+'` + local _BACKGROUND_IMAGE_DPI_H=$(sips -g dpiHeight ${DMG_BACKGROUND_IMG} | grep -Eo '[0-9]+\.[0-9]+') + local _BACKGROUND_IMAGE_DPI_W=$(sips -g dpiWidth ${DMG_BACKGROUND_IMG} | grep -Eo '[0-9]+\.[0-9]+') if [ $(echo " $_BACKGROUND_IMAGE_DPI_H != 72.0 " | bc) -eq 1 -o $(echo " $_BACKGROUND_IMAGE_DPI_W != 72.0 " | bc) -eq 1 ]; then echo "WARNING: The background image's DPI is not 72. This will result in distorted backgrounds on Mac OS X 10.7+." @@ -102,7 +102,7 @@ function sign_mac_app() { # See https://code-examples.net/en/q/1344e6a security set-key-partition-list -S apple-tool:,apple: -s -k ${keychain_password} "${keychain_name}" # debug - echo ${sign_identity} >> "id.txt" + echo "${sign_identity}" >> "id.txt" # Invoke codesign if [[ -d "${app_dir}/Contents/MacOS/Plugins" ]]; then # Pharo.app does not (yet) have its plugins in Resources dir rm -rf "${app_dir}/Contents/MacOS/Plugins/pkgconfig" # Should be fixed in VM build From 2d47ed8e4119ff7eaf58a8cec670107d853f0f8d Mon Sep 17 00:00:00 2001 From: Christophe Demarey Date: Mon, 25 Sep 2023 16:30:52 +0200 Subject: [PATCH 04/21] Do noit terminate Image description updater process if already terminated --- .../PhLImageDescriptionUpdater.class.st | 5 ++++- .../PhLImageDescriptionUpdaterTest.class.st | 12 ++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/PharoLauncher-Core/PhLImageDescriptionUpdater.class.st b/src/PharoLauncher-Core/PhLImageDescriptionUpdater.class.st index 177e2241..a0eb7a28 100644 --- a/src/PharoLauncher-Core/PhLImageDescriptionUpdater.class.st +++ b/src/PharoLauncher-Core/PhLImageDescriptionUpdater.class.st @@ -66,7 +66,10 @@ PhLImageDescriptionUpdater >> newProcess [ { #category : #private } PhLImageDescriptionUpdater >> terminateProcess [ - process ifNotNil: [ process terminate ] + (process isNil or: [ process isTerminated ]) + ifTrue: [ ^ self ]. + + process terminate. ] { #category : #accessing } diff --git a/src/PharoLauncher-Tests-Core/PhLImageDescriptionUpdaterTest.class.st b/src/PharoLauncher-Tests-Core/PhLImageDescriptionUpdaterTest.class.st index fdc288bf..5455eaf6 100644 --- a/src/PharoLauncher-Tests-Core/PhLImageDescriptionUpdaterTest.class.st +++ b/src/PharoLauncher-Tests-Core/PhLImageDescriptionUpdaterTest.class.st @@ -20,8 +20,8 @@ PhLImageDescriptionUpdaterTest >> setUp [ reset; default. rootFs := FileSystem memory root. - image := PhLImage location: rootFs / 'one'. - image2 := PhLImage location: rootFs / 'two' + image := PhLImage location: (((rootFs / 'one') ensureCreateDirectory) / 'one.image') ensureCreateFile. + image2 := PhLImage location: (((rootFs / 'two') ensureCreateDirectory) / 'two.image') ensureCreateFile. ] { #category : #tests } @@ -54,7 +54,8 @@ PhLImageDescriptionUpdaterTest >> testSaveBothImagesWhenUpdatingDescriptionOfTwo updater image: image2 description: 'desc imag2'. self waitUpdate. - self assert: updater nbSave equals: 2 + self assert: updater nbSave equals: 2. + self assert: updater nbProcessKilled equals: 1. ] { #category : #tests } @@ -67,12 +68,15 @@ PhLImageDescriptionUpdaterTest >> testSaveOnceWhenDescriptionChangeOnce [ { #category : #tests } PhLImageDescriptionUpdaterTest >> testSaveOnceWhenDescriptionChangesManyTimesWithDelayShorterThanWaitDelay [ + self assert: updater nbProcessKilled equals: 0. + 3 timesRepeat: [ updater image: image description: 'desc'. (updater waitDelay / 5) wait ]. self waitUpdate. - self assert: updater nbSave equals: 1 + self assert: updater nbSave equals: 1. + self assert: updater nbProcessKilled equals: 2 ] { #category : #tests } From 3caf8e7ab51d85ce26aaa501430f253874b50d53 Mon Sep 17 00:00:00 2001 From: ClotildeToullec Date: Fri, 29 Sep 2023 11:09:05 +0200 Subject: [PATCH 05/21] Removed unavailable Moose images --- sources.list | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/sources.list b/sources.list index 1f6858de..214d9103 100644 --- a/sources.list +++ b/sources.list @@ -53,11 +53,6 @@ OrderedCollection [ #name : 'Moose Suite 11 (development) - Pharo 11', #url : 'https://github.com/moosetechnology/Moose/releases/download/continuous/Moose11-development-Pharo64-11.zip' }, - PhLTemplateSource { - #type : #URL, - #name : 'Moose Suite 11 (development) - Pharo 10', - #url : 'https://github.com/moosetechnology/Moose/releases/download/continuous/Moose11-development-Pharo64-10.zip' - }, PhLTemplateSource { #type : #URL, #name : 'Moose Suite 10 (stable)', @@ -139,32 +134,7 @@ OrderedCollection [ #type : #URL, #name : 'Moose Suite 8.0 (old stable)', #url : 'https://github.com/moosetechnology/Moose/releases/download/v8.x.x/Moose8-old-stable-Pharo64-8.0.zip' - }, - PhLTemplateSource { - #type : #URL, - #name : 'Moose Suite 7.0 (old stable)', - #url : 'https://ci.inria.fr/moose/job/moose-7.0-64bit/lastSuccessfulBuild/artifact/moose-7.0-64bit.zip' - }, - PhLTemplateSource { - #type : #URL, - #name : 'Moose Suite 6.1', - #url : 'https://ci.inria.fr/moose/job/moose-6.1/lastSuccessfulBuild/artifact/moose-6.1.zip' - }, - PhLTemplateSource { - #type : #URL, - #name : 'Moose Suite 6.0', - #url : 'https://ci.inria.fr/moose/job/moose-6.0/lastSuccessfulBuild/artifact/moose-6.0.zip' - }, - PhLTemplateSource { - #type : #URL, - #name : 'Moose Suite 5.1', - #url : 'https://ci.inria.fr/moose/job/moose-5.1/lastSuccessfulBuild/artifact/moose-5.1.zip' - }, - PhLTemplateSource { - #type : #URL, - #name : 'Moose Suite 5.0', - #url : 'https://moosetechnology.org/res/download/moose_image_5_0.zip' - } + } ] }, PhLTemplateSource { From a505f5944671d132ab479a7fc9d05381bd6fd216 Mon Sep 17 00:00:00 2001 From: ClotildeToullec Date: Fri, 29 Sep 2023 11:11:08 +0200 Subject: [PATCH 06/21] Renamed Moose 11 image --- sources.list | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources.list b/sources.list index 214d9103..2f87b591 100644 --- a/sources.list +++ b/sources.list @@ -50,7 +50,7 @@ OrderedCollection [ }, PhLTemplateSource { #type : #URL, - #name : 'Moose Suite 11 (development) - Pharo 11', + #name : 'Moose Suite 11 (development)', #url : 'https://github.com/moosetechnology/Moose/releases/download/continuous/Moose11-development-Pharo64-11.zip' }, PhLTemplateSource { From 3a533063cfd12cdfa02b4781ee0d845e6a969deb Mon Sep 17 00:00:00 2001 From: Christophe Demarey Date: Mon, 16 Oct 2023 12:09:55 +0200 Subject: [PATCH 07/21] cleanup --- .../PharoLauncherCLIConfiguration.class.st | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/PharoLauncher-CLI/PharoLauncherCLIConfiguration.class.st b/src/PharoLauncher-CLI/PharoLauncherCLIConfiguration.class.st index 3207680d..71addbe4 100644 --- a/src/PharoLauncher-CLI/PharoLauncherCLIConfiguration.class.st +++ b/src/PharoLauncher-CLI/PharoLauncherCLIConfiguration.class.st @@ -17,8 +17,8 @@ Class { PharoLauncherCLIConfiguration class >> configFileNotFound: aFile [ PhLNotificationCenter default errorStream nextPutAll: - 'Config file not found, creating a new one at ' - , self preferencesFile fullName; + 'Config file not found, creating a new one at '; + nextPutAll: self preferencesFile fullName; newLine. ^ self createConfigurationFile: aFile ] @@ -119,12 +119,10 @@ PharoLauncherCLIConfiguration >> initScriptsDirectory: aFileReference [ PharoLauncherCLIConfiguration >> initialize [ super initialize. imagesDirectory := PhLDirectoryBasedImageRepository defaultLocation asFileReference . - vmsDirectory := FileLocator launcherUserFilesLocation / 'vms'. - vmsDirectory := vmsDirectory asFileReference. - initScriptsDirectory := PharoLauncherApplication + vmsDirectory := (FileLocator launcherUserFilesLocation / 'vms') asFileReference. + initScriptsDirectory := PharoLauncherApplication defaultInitializationScriptLocation asFileReference. - launchImageFromALoginShell := PhLLaunchConfiguration - launchInALoginShell + launchImageFromALoginShell := PhLLaunchConfiguration launchInALoginShell ] { #category : #accessing } From e6aba68aea43c95de28a3e7271109de17c5d1665 Mon Sep 17 00:00:00 2001 From: Christophe Demarey Date: Mon, 16 Oct 2023 12:12:52 +0200 Subject: [PATCH 08/21] initialize Pharo launcher CLI model from configuration --- .../PhLCliTestClapContext.class.st | 2 +- .../ClapContext.extension.st | 2 +- .../PharoLauncherCLIModel.class.st | 31 ++++++++++++++----- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/PharoLauncher-CLI-Tests/PhLCliTestClapContext.class.st b/src/PharoLauncher-CLI-Tests/PhLCliTestClapContext.class.st index fc0d0737..64000531 100644 --- a/src/PharoLauncher-CLI-Tests/PhLCliTestClapContext.class.st +++ b/src/PharoLauncher-CLI-Tests/PhLCliTestClapContext.class.st @@ -24,7 +24,7 @@ PhLCliTestClapContext >> command [ PhLCliTestClapContext >> initialize [ super initialize. - launcherModel := PharoLauncherCLIModel new. + launcherModel := PharoLauncherCLIModel fromDefaultConfiguration. ] { #category : #accessing } diff --git a/src/PharoLauncher-CLI/ClapContext.extension.st b/src/PharoLauncher-CLI/ClapContext.extension.st index 32db3c6c..75cd82f2 100644 --- a/src/PharoLauncher-CLI/ClapContext.extension.st +++ b/src/PharoLauncher-CLI/ClapContext.extension.st @@ -13,5 +13,5 @@ ClapContext >> initializeLauncherNotificationCenter [ { #category : #'*PharoLauncher-CLI' } ClapContext >> pharoLauncherModel [ - ^ PharoLauncherCLIModel new + ^ PharoLauncherCLIModel fromDefaultConfiguration ] diff --git a/src/PharoLauncher-CLI/PharoLauncherCLIModel.class.st b/src/PharoLauncher-CLI/PharoLauncherCLIModel.class.st index 79c6d82b..cb76c048 100644 --- a/src/PharoLauncher-CLI/PharoLauncherCLIModel.class.st +++ b/src/PharoLauncher-CLI/PharoLauncherCLIModel.class.st @@ -9,17 +9,36 @@ Class { #instVars : [ 'imageRepository', 'templateRepository', - 'vmManager' + 'vmManager', + 'configuration' ], #category : #'PharoLauncher-CLI-Model' } +{ #category : #'instance creation' } +PharoLauncherCLIModel class >> fromConfiguration: aPharoLauncherConfiguration [ + + ^ self new + configuration: aPharoLauncherConfiguration; + yourself +] + +{ #category : #'instance creation' } +PharoLauncherCLIModel class >> fromDefaultConfiguration [ + + ^ self fromConfiguration: PharoLauncherCLIConfiguration defaultConfiguration +] + +{ #category : #accessing } +PharoLauncherCLIModel >> configuration: aPharoLauncherConfiguration [ + + configuration := aPharoLauncherConfiguration +] + { #category : #accessing } PharoLauncherCLIModel >> imageRepository [ ^ imageRepository - ifNil: [ | configuration | - configuration := PharoLauncherCLIConfiguration defaultConfiguration. - self + ifNil: [ self imageRepository: (PhLDirectoryBasedImageRepository forDirectory: configuration imagesDirectory). @@ -46,9 +65,7 @@ PharoLauncherCLIModel >> templateRepository: aPathString [ { #category : #accessing } PharoLauncherCLIModel >> vmManager [ ^ vmManager - ifNil: [ | configuration | - configuration := PharoLauncherCLIConfiguration defaultConfiguration. - PhLVirtualMachineManager vmStore: configuration vmsDirectory. + ifNil: [ PhLVirtualMachineManager vmStore: configuration vmsDirectory. self vmManager: PhLVirtualMachineManager new. vmManager ] ] From 019471bb13af6b0876d1093fc6c918627eef0df8 Mon Sep 17 00:00:00 2001 From: Christophe Demarey Date: Mon, 16 Oct 2023 12:13:37 +0200 Subject: [PATCH 09/21] remove unused PharoLauncherModel --- .../PharoLauncherModel.class.st | 226 ------------------ 1 file changed, 226 deletions(-) delete mode 100644 src/PharoLauncher-Core/PharoLauncherModel.class.st diff --git a/src/PharoLauncher-Core/PharoLauncherModel.class.st b/src/PharoLauncher-Core/PharoLauncherModel.class.st deleted file mode 100644 index 1fad05cb..00000000 --- a/src/PharoLauncher-Core/PharoLauncherModel.class.st +++ /dev/null @@ -1,226 +0,0 @@ -" -Provide an environment that the commands can query and change. The environment is composed of an image repository, a template repository, and a selection (of either images or templates). - -Instance Variables - imageRepository: the list of available images in the system - selection: a current selection of either images or templates - templateRepository: the list of templates that can be used to create images. - -" -Class { - #name : #PharoLauncherModel, - #superclass : #Object, - #instVars : [ - 'selection', - 'imageRepository', - 'templateRepository' - ], - #classVars : [ - 'IsDeployed' - ], - #category : #'PharoLauncher-Core-Model' -} - -{ #category : #settings } -PharoLauncherModel class >> deactivateDeployed [ - IsDeployed := false -] - -{ #category : #settings } -PharoLauncherModel class >> isDeployed [ - ^ IsDeployed ifNil: [ IsDeployed := false ] -] - -{ #category : #settings } -PharoLauncherModel class >> makeDeployed [ - IsDeployed := true -] - -{ #category : #'instance creation' } -PharoLauncherModel class >> selection: aSelection imageRepository: imageRepository templateRepository: templateRepository [ - ^ self new - setSelection: aSelection imageRepository: imageRepository templateRepository: templateRepository; - yourself -] - -{ #category : #private } -PharoLauncherModel >> ensure: aBoolean [ - aBoolean - ifFalse: [ PhLCommandError signal ] -] - -{ #category : #'testing selection' } -PharoLauncherModel >> hasAtLeastOneImageSelected [ - ^ selection anySatisfy: #isImage -] - -{ #category : #'testing selection' } -PharoLauncherModel >> hasAtLeastOneTemplateGroupSelected [ - ^ selection anySatisfy: #isTemplateGroup -] - -{ #category : #testing } -PharoLauncherModel >> hasImageNamed: aString [ - ^ imageRepository hasImageNamed: aString -] - -{ #category : #'testing selection' } -PharoLauncherModel >> hasNoSelection [ - ^ selection size = 0 -] - -{ #category : #'testing selection' } -PharoLauncherModel >> hasSingleImageSelected [ - ^ (selection size = 1) and: [ selection anyOne isImage ] -] - -{ #category : #'testing selection' } -PharoLauncherModel >> hasSingleLocalTemplateSelected [ - ^ (selection size = 1) and: [ selection anyOne isLocalTemplate ] -] - -{ #category : #'testing selection' } -PharoLauncherModel >> hasSingleTemplateSelected [ - ^ (selection size = 1) and: [ selection anyOne isTemplate ] -] - -{ #category : #testing } -PharoLauncherModel >> hasTemplateNamed: aString [ - ^ templateRepository hasLocalTemplateNamed: aString -] - -{ #category : #accessing } -PharoLauncherModel >> imageRepository [ - ^ imageRepository -] - -{ #category : #announcements } -PharoLauncherModel >> imageRepositoryChanged [ - self imageRepository contentsChanged -] - -{ #category : #testing } -PharoLauncherModel >> isNewImageNameValid: aString [ - ^ aString isEmptyOrNil not and: [ (self hasImageNamed: aString) not ] -] - -{ #category : #testing } -PharoLauncherModel >> isNewLocalTemplateNameValid: aString [ - ^ aString isEmptyOrNil not and: [ (self hasTemplateNamed: aString) not ] -] - -{ #category : #action } -PharoLauncherModel >> makeUniqueImageName [ - self shouldBeImplemented. -] - -{ #category : #accessing } -PharoLauncherModel >> makeUniqueImageName: aString [ - ^ imageRepository makeUniqueImageName: aString -] - -{ #category : #accessing } -PharoLauncherModel >> makeUniqueTemplateName: aString [ - ^ templateRepository makeUniqueTemplateName: aString -] - -{ #category : #'user interaction' } -PharoLauncherModel >> newConfirmation [ - ^ PhLUIConfirmation new -] - -{ #category : #'user interaction' } -PharoLauncherModel >> newInformation [ - ^ PhLUIInformation new -] - -{ #category : #'user interaction' } -PharoLauncherModel >> newRequest [ - ^ PhLUIRequest new -] - -{ #category : #'user interaction' } -PharoLauncherModel >> requestNewImageName: aString [ - - self halt. "should not be used" - ^ self newRequest - title: 'Image name?'; - initialAnswer: aString; - validateAnswer: [ :answer | (self hasImageNamed: answer) not ]; - request -] - -{ #category : #'user interaction' } -PharoLauncherModel >> requestNewTemplateName: aString [ - - self halt. "should not be used" - ^ self newRequest - title: 'Template name?'; - initialAnswer: (self makeUniqueTemplateName: aString); - validateAnswer: [ :answer | - (self hasTemplateNamed: answer) - ifTrue: [ UIManager default confirm: 'Do you want to override exisiting template?' ] - ifFalse: [ true ] ]; - request -] - -{ #category : #selection } -PharoLauncherModel >> selectedImages [ - ^ selection select: #isImage -] - -{ #category : #selection } -PharoLauncherModel >> selectedTemplateGroups [ - ^ selection select: #isTemplateGroup -] - -{ #category : #selection } -PharoLauncherModel >> selectedTemplates [ - ^ selection select: #isTemplate -] - -{ #category : #initialization } -PharoLauncherModel >> setSelection: aSelection imageRepository: anImageRepository templateRepository: aTemplateRepository [ - selection := aSelection. - imageRepository := anImageRepository. - templateRepository := aTemplateRepository. -] - -{ #category : #selection } -PharoLauncherModel >> singleImage [ - self - ensure: self hasSingleImageSelected. - ^ selection anyOne -] - -{ #category : #selection } -PharoLauncherModel >> singleImageName [ - self - ensure: self hasSingleImageSelected. - - ^ selection pathNames anyOne -] - -{ #category : #selection } -PharoLauncherModel >> singleTemplate [ - self - ensure: self hasSingleTemplateSelected. - ^ selection anyOne -] - -{ #category : #accessing } -PharoLauncherModel >> templateRepository [ - ^ templateRepository -] - -{ #category : #announcements } -PharoLauncherModel >> templateRepositoryChanged [ - self templateRepository contentsChanged -] - -{ #category : #copying } -PharoLauncherModel >> withNewSelection: aSelection [ - ^ self copy - setSelection: aSelection imageRepository: imageRepository templateRepository: templateRepository; - yourself -] From b2abc11bf6aba4f240b2142b16cb90f9ddbb15c9 Mon Sep 17 00:00:00 2001 From: Christophe Demarey Date: Mon, 16 Oct 2023 12:15:11 +0200 Subject: [PATCH 10/21] Do not use PharoLauncherApplication instance when in CLI mode. See issue https://github.com/pharo-project/pharo-launcher/issues/630 --- .../PhLNotificationCenter.class.st | 22 ++++++++++++++++++- .../PhLDownloadManager.class.st | 2 -- .../PhLDeploymentScript.class.st | 7 ++++-- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/PharoLauncher-CLI/PhLNotificationCenter.class.st b/src/PharoLauncher-CLI/PhLNotificationCenter.class.st index ac4676b6..cc0d6b6d 100644 --- a/src/PharoLauncher-CLI/PhLNotificationCenter.class.st +++ b/src/PharoLauncher-CLI/PhLNotificationCenter.class.st @@ -1,5 +1,8 @@ " -This represents singleton object for accessing errorStream, outStream in methods used by CLI, that do not have any reference to streams of CLI command (or CLI context) object. +I represent an object to manage notifications to user when ran in CLI mode. + +I can act as the PharoLauncher default application (see PharoLauncherApplication class>>#default). +I only have a minimal set of methods to provide some polymorphism with an SpApplication and avoid UI interactions. " Class { #name : #PhLNotificationCenter, @@ -54,3 +57,20 @@ PhLNotificationCenter >> outStream [ PhLNotificationCenter >> outStream: anOutStream [ outStream := anOutStream ] + +{ #category : #ui } +PhLNotificationCenter >> pushProgress: aString with: aFullBlockClosure [ + "do not display progress, only evaluate the block" + aFullBlockClosure value: DummySystemProgressItem new +] + +{ #category : #ui } +PhLNotificationCenter >> showError: anError [ + + self errorStream + nextPutAll: 'Error: '; + nextPutAll: anError name; + nextPutAll: ' - '; + nextPutAll: anError longDescription; + cr +] diff --git a/src/PharoLauncher-Core/PhLDownloadManager.class.st b/src/PharoLauncher-Core/PhLDownloadManager.class.st index e232d1b1..79a5ecec 100644 --- a/src/PharoLauncher-Core/PhLDownloadManager.class.st +++ b/src/PharoLauncher-Core/PhLDownloadManager.class.st @@ -46,8 +46,6 @@ PhLDownloadManager >> basicDownload: url toFile: destinationFile [ { #category : #private } PhLDownloadManager >> displayProgress: aTitle during: workBlock [ "Inform user about download progression" - | bar | - bar := ConsoleProgressBar on: PhLNotificationCenter default outStream. PharoLauncherApplication default pushProgress: aTitle diff --git a/src/PharoLauncher-Spec2/PhLDeploymentScript.class.st b/src/PharoLauncher-Spec2/PhLDeploymentScript.class.st index f48a51df..4a3e526e 100644 --- a/src/PharoLauncher-Spec2/PhLDeploymentScript.class.st +++ b/src/PharoLauncher-Spec2/PhLDeploymentScript.class.st @@ -166,8 +166,11 @@ PhLDeploymentScript class >> isDeployed [ { #category : #'system startup' } PhLDeploymentScript class >> launcherStartUp [ - (self isDeployed and: [ Smalltalk isInteractive not ]) - ifTrue: [ self closeWindowsAndOpenLauncher ] + self isDeployed ifFalse: [ ^ self ]. + + Smalltalk isInteractive + ifTrue: [ PharoLauncherApplication default: PhLNotificationCenter default ] + ifFalse: [ self closeWindowsAndOpenLauncher ] ] { #category : #'system startup' } From 87a14602f87713a6ed39e290a6786f8e08acb778 Mon Sep 17 00:00:00 2001 From: Christophe Demarey Date: Mon, 16 Oct 2023 13:49:06 +0200 Subject: [PATCH 11/21] do not log information on error stream --- src/PharoLauncher-CLI/PharoLauncherCLIConfiguration.class.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PharoLauncher-CLI/PharoLauncherCLIConfiguration.class.st b/src/PharoLauncher-CLI/PharoLauncherCLIConfiguration.class.st index 71addbe4..4bccbc2b 100644 --- a/src/PharoLauncher-CLI/PharoLauncherCLIConfiguration.class.st +++ b/src/PharoLauncher-CLI/PharoLauncherCLIConfiguration.class.st @@ -15,7 +15,7 @@ Class { { #category : #'error signalling' } PharoLauncherCLIConfiguration class >> configFileNotFound: aFile [ - PhLNotificationCenter default errorStream + PhLNotificationCenter default outStream nextPutAll: 'Config file not found, creating a new one at '; nextPutAll: self preferencesFile fullName; From c15bd7d9e8ee92d6f545bdd6927f46a8ccd86c60 Mon Sep 17 00:00:00 2001 From: Christophe Demarey Date: Mon, 16 Oct 2023 14:22:23 +0200 Subject: [PATCH 12/21] fix test --- .../PharoLauncherCLIConfigurationTest.class.st | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/PharoLauncher-CLI-Tests/PharoLauncherCLIConfigurationTest.class.st b/src/PharoLauncher-CLI-Tests/PharoLauncherCLIConfigurationTest.class.st index ee50a47a..5f740aad 100644 --- a/src/PharoLauncher-CLI-Tests/PharoLauncherCLIConfigurationTest.class.st +++ b/src/PharoLauncher-CLI-Tests/PharoLauncherCLIConfigurationTest.class.st @@ -3,7 +3,8 @@ Class { #superclass : #TestCase, #instVars : [ 'root', - 'errorStream' + 'errorStream', + 'outStream' ], #category : #'PharoLauncher-CLI-Tests' } @@ -22,8 +23,11 @@ PharoLauncherCLIConfigurationTest >> createPreferencesFileWith: aConfiguration [ PharoLauncherCLIConfigurationTest >> setUp [ super setUp. root := FileSystem memory root. + outStream := WriteStream on: (String new). errorStream := WriteStream on: (String new). - PhLNotificationCenter default errorStream: errorStream + PhLNotificationCenter default + errorStream: errorStream; + outStream: outStream. ] @@ -74,7 +78,7 @@ PharoLauncherCLIConfigurationTest >> testGetConfigurationWhenConfigurationFileAb config := PharoLauncherCLIConfiguration configurationFromFile: (root / 'launcherSettings.ston') asFileReference . self assert: (config isKindOf: PharoLauncherCLIConfiguration). - self assert: ( PhLNotificationCenter default errorStream contents includesSubstring: 'Config' ) + self assert: (PhLNotificationCenter default outStream contents includesSubstring: 'Config') ] From 1408328984a0d19f26a9354641264f77c50b7f37 Mon Sep 17 00:00:00 2001 From: Christophe Demarey Date: Wed, 18 Oct 2023 11:10:08 +0200 Subject: [PATCH 13/21] fix default PharoLauncherApplication initialization --- src/PharoLauncher-Spec2/PhLDeploymentScript.class.st | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PharoLauncher-Spec2/PhLDeploymentScript.class.st b/src/PharoLauncher-Spec2/PhLDeploymentScript.class.st index 4a3e526e..6d5f5f12 100644 --- a/src/PharoLauncher-Spec2/PhLDeploymentScript.class.st +++ b/src/PharoLauncher-Spec2/PhLDeploymentScript.class.st @@ -169,8 +169,8 @@ PhLDeploymentScript class >> launcherStartUp [ self isDeployed ifFalse: [ ^ self ]. Smalltalk isInteractive - ifTrue: [ PharoLauncherApplication default: PhLNotificationCenter default ] - ifFalse: [ self closeWindowsAndOpenLauncher ] + ifTrue: [ self closeWindowsAndOpenLauncher ] + ifFalse: [ PharoLauncherApplication default: PhLNotificationCenter default ] ] { #category : #'system startup' } From 64288ff9305883fa961e2376fc85f3bf1c42ace3 Mon Sep 17 00:00:00 2001 From: Christophe Demarey Date: Wed, 18 Oct 2023 12:00:14 +0200 Subject: [PATCH 14/21] use #reset already defined in SpApplication and implement the same method in PhLNotificationCenter for polymorphism --- src/PharoLauncher-CLI/PhLNotificationCenter.class.st | 8 ++++++++ src/PharoLauncher-Spec2/PharoLauncherApplication.class.st | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/PharoLauncher-CLI/PhLNotificationCenter.class.st b/src/PharoLauncher-CLI/PhLNotificationCenter.class.st index cc0d6b6d..04fb0cc3 100644 --- a/src/PharoLauncher-CLI/PhLNotificationCenter.class.st +++ b/src/PharoLauncher-CLI/PhLNotificationCenter.class.st @@ -64,6 +64,14 @@ PhLNotificationCenter >> pushProgress: aString with: aFullBlockClosure [ aFullBlockClosure value: DummySystemProgressItem new ] +{ #category : #polymorphism } +PhLNotificationCenter >> reset [ + + "This method is not a 'real' reset but is there for polymorphism with `PharoLauncherApplication`. + It is called by `PhLStartupManager class>>#startUp:`. + One should not reset my streams as they are initialized by clap at image startup." +] + { #category : #ui } PhLNotificationCenter >> showError: anError [ diff --git a/src/PharoLauncher-Spec2/PharoLauncherApplication.class.st b/src/PharoLauncher-Spec2/PharoLauncherApplication.class.st index 31200ce1..917f6636 100644 --- a/src/PharoLauncher-Spec2/PharoLauncherApplication.class.st +++ b/src/PharoLauncher-Spec2/PharoLauncherApplication.class.st @@ -158,7 +158,7 @@ PharoLauncherApplication class >> pharoIcon16x16 [ PharoLauncherApplication class >> reset [ Default ifNil: [ ^ self ]. - Default closeAllWindows. + Default reset. Default := nil ] From 9dc59d3f6b5607676209a7d32ea692ab238da642 Mon Sep 17 00:00:00 2001 From: Christophe Demarey Date: Tue, 7 Nov 2023 17:13:24 +0100 Subject: [PATCH 15/21] use official clap repository --- src/BaselineOfPharoLauncher/BaselineOfPharoLauncher.class.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BaselineOfPharoLauncher/BaselineOfPharoLauncher.class.st b/src/BaselineOfPharoLauncher/BaselineOfPharoLauncher.class.st index 2f2de89d..71618ba1 100644 --- a/src/BaselineOfPharoLauncher/BaselineOfPharoLauncher.class.st +++ b/src/BaselineOfPharoLauncher/BaselineOfPharoLauncher.class.st @@ -63,7 +63,7 @@ BaselineOfPharoLauncher >> clap: spec [ spec baseline: #Clap - with: [ spec repository: 'github://demarey/clap-st:refactoring/src' ] + with: [ spec repository: 'github://pharo-contributions/clap-st:master/src' ] ] { #category : #'external projects' } From 770d6dcd5d03ab7f0cae0b422b7fd348fad2afbf Mon Sep 17 00:00:00 2001 From: Christophe Demarey Date: Thu, 9 Nov 2023 15:39:25 +0100 Subject: [PATCH 16/21] use Pharo 11 --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a797043f..826a964d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -18,7 +18,7 @@ on: workflow_dispatch: env: - PHARO: 100 + PHARO: 110 ARCHITECTURE: 64 VM: vm isRelease: ${{ startsWith(github.ref, 'refs/tags/') }} @@ -132,7 +132,7 @@ jobs: - name: Prepare files shell: pwsh run: | - Invoke-WebRequest -OutFile pharo-win-stable-signed.zip -Uri http://files.pharo.org/get-files/110/pharo-win-stable-signed.zip + Invoke-WebRequest -OutFile pharo-win-stable-signed.zip -Uri http://files.pharo.org/get-files/${{ env.PHARO }}/pharo-win-stable-signed.zip Expand-Archive -LiteralPath .\pharo-win-stable-signed.zip -DestinationPath $Env:PACKAGE_DIR $Env:IMAGES_DIR = "${Env:PACKAGE_DIR}\images" mkdir "$Env:IMAGES_DIR" From 9aa544b1404cca0fcfcb2692f5318ab5b871ffb5 Mon Sep 17 00:00:00 2001 From: DEMAREY Christophe Date: Fri, 5 Jan 2024 13:43:07 +0100 Subject: [PATCH 17/21] Do not try to guess image pharo version. Too unreliable. --- src/PharoLauncher-Core/PhLImage.class.st | 4 +- ...PhLImageVersionDeterminationError.class.st | 37 ---- .../PhLImageVersionFileNotFound.class.st | 22 +++ .../PhLLaunchConfiguration.class.st | 7 +- .../PhLLaunchImageCommand.class.st | 3 +- .../PhLPrivateVirtualMachine.class.st | 27 --- .../PhLToggleVmPrivateVmCommand.class.st | 28 --- .../PhLVirtualMachine.class.st | 20 +- .../PhLVirtualMachineManager.class.st | 175 +----------------- .../PhLVirtualMachinesDataSource.class.st | 33 +--- .../PhLVmProviderUntilPharo80.class.st | 11 -- .../PhLVMPresenter.class.st | 53 +----- .../PhLDeleteVmCommandTest.class.st | 41 +--- .../PhLTestVirtualMachineManager.class.st | 12 +- .../PhLTestVmPresenter.class.st | 33 +--- .../PhLToggleVmPrivateVmCommandTest.class.st | 68 ------- .../PhLUpdateVmCommandTest.class.st | 27 +-- .../PhLImage.extension.st | 7 + .../PhLImageTest.class.st | 4 +- .../PhLLaunchConfigurationTest.class.st | 14 +- .../PhLVirtualMachineManagerTest.class.st | 20 +- .../PhLLaunchImageTest.class.st | 9 +- .../PhLOsXCatalinaTestImage.class.st | 20 ++ .../PhLOsXMojaveTestImage.class.st | 19 -- .../PhLPrivateVirtualMachineTest.class.st | 18 -- ...rtualMachineManagerFunctionalTest.class.st | 88 +-------- ...VirtualMachineManagerTestResource.class.st | 9 - .../PhLVirtualMachineTest.class.st | 4 +- .../TestMacOSXCatalinaPlatform.class.st | 13 ++ .../TestMacOSXMojavePlatform.class.st | 13 -- 30 files changed, 123 insertions(+), 716 deletions(-) delete mode 100644 src/PharoLauncher-Core/PhLImageVersionDeterminationError.class.st create mode 100644 src/PharoLauncher-Core/PhLImageVersionFileNotFound.class.st delete mode 100644 src/PharoLauncher-Core/PhLPrivateVirtualMachine.class.st delete mode 100644 src/PharoLauncher-Core/PhLToggleVmPrivateVmCommand.class.st delete mode 100644 src/PharoLauncher-Tests-Commands/PhLToggleVmPrivateVmCommandTest.class.st create mode 100644 src/PharoLauncher-Tests-Core/PhLImage.extension.st create mode 100644 src/PharoLauncher-Tests-Functional/PhLOsXCatalinaTestImage.class.st delete mode 100644 src/PharoLauncher-Tests-Functional/PhLOsXMojaveTestImage.class.st delete mode 100644 src/PharoLauncher-Tests-Functional/PhLPrivateVirtualMachineTest.class.st create mode 100644 src/PharoLauncher-Tests-Functional/TestMacOSXCatalinaPlatform.class.st delete mode 100644 src/PharoLauncher-Tests-Functional/TestMacOSXMojavePlatform.class.st diff --git a/src/PharoLauncher-Core/PhLImage.class.st b/src/PharoLauncher-Core/PhLImage.class.st index f73dfc8d..2e78dae7 100644 --- a/src/PharoLauncher-Core/PhLImage.class.st +++ b/src/PharoLauncher-Core/PhLImage.class.st @@ -392,12 +392,10 @@ PhLImage >> launchWithConfiguration: aPhLLaunchConfiguration [ ^ self ]. architectureWarningEnabled := true. continue := true. - [ [ | processWrapper| + [ | processWrapper| processWrapper := (aPhLLaunchConfiguration launchProcess) runUnwatch. self doNotRunInitializationScript. "Just run, image already initialized" ^ processWrapper ] - on: PhLImageVersionDeterminationError - do: [ :error | error uiAlert ] ] on: PhLArchitectureMismatchWarning do: [ :warning | architectureWarningEnabled ifTrue: [ diff --git a/src/PharoLauncher-Core/PhLImageVersionDeterminationError.class.st b/src/PharoLauncher-Core/PhLImageVersionDeterminationError.class.st deleted file mode 100644 index d4125c16..00000000 --- a/src/PharoLauncher-Core/PhLImageVersionDeterminationError.class.st +++ /dev/null @@ -1,37 +0,0 @@ -" -Error thrown when Pharo Launcher did not succeed to determine the Pharo version of the image to launch. -Probably, the run command failed. -I hold the command run to determoine the version so that it can be reused for debugging purposes. -" -Class { - #name : #PhLImageVersionDeterminationError, - #superclass : #PhLError, - #instVars : [ - 'command' - ], - #category : #'PharoLauncher-Core-Download' -} - -{ #category : #signalling } -PhLImageVersionDeterminationError class >> signalCommand: aCommandString [ - ^ self new - setCommand: aCommandString; - signal -] - -{ #category : #accessing } -PhLImageVersionDeterminationError >> longDescription [ - ^ PhLImage versionFileName , - ' file was not found for your image, and probably your VMs are not up to date. -Please, contact us at http://pharo.org/community' -] - -{ #category : #accessing } -PhLImageVersionDeterminationError >> name [ - ^ 'Cannot determine image version' -] - -{ #category : #initialization } -PhLImageVersionDeterminationError >> setCommand: aCommandString [ - command := aCommandString reject: [ :c | c = Character cr ] "easier to run the copy/pasted command in a shell if command has only one line" -] diff --git a/src/PharoLauncher-Core/PhLImageVersionFileNotFound.class.st b/src/PharoLauncher-Core/PhLImageVersionFileNotFound.class.st new file mode 100644 index 00000000..35bebd9d --- /dev/null +++ b/src/PharoLauncher-Core/PhLImageVersionFileNotFound.class.st @@ -0,0 +1,22 @@ +" +Error thrown when Pharo Launcher did not succeed to determine the Pharo version of the image to launch. +Probably, the run command failed. +I hold the command run to determoine the version so that it can be reused for debugging purposes. +" +Class { + #name : #PhLImageVersionFileNotFound, + #superclass : #PhLError, + #category : #'PharoLauncher-Core-Download' +} + +{ #category : #accessing } +PhLImageVersionFileNotFound >> longDescription [ + ^ PhLImage versionFileName , + ' file was not found for your image, and probably your VMs are not up to date. +Please, contact us at http://pharo.org/community' +] + +{ #category : #accessing } +PhLImageVersionFileNotFound >> name [ + ^ 'Image version file ', PhLImage versionFileName , ' not found!' +] diff --git a/src/PharoLauncher-Core/PhLLaunchConfiguration.class.st b/src/PharoLauncher-Core/PhLLaunchConfiguration.class.st index 5c168eff..c637d20c 100644 --- a/src/PharoLauncher-Core/PhLLaunchConfiguration.class.st +++ b/src/PharoLauncher-Core/PhLLaunchConfiguration.class.st @@ -92,7 +92,7 @@ PhLLaunchConfiguration >> commandString [ { #category : #querying } PhLLaunchConfiguration >> defaultVm [ - self image ensurePharoVersion. + self image pharoVersion. ^ self image vmManager virtualMachine ] @@ -128,7 +128,8 @@ PhLLaunchConfiguration >> initializeWithImage: anImage [ image := anImage. name := 'new configuration...'. usePharoSettings := true. - imageArguments := anImage defaultArguments + imageArguments := anImage defaultArguments. + image ensurePharoVersion ] { #category : #testing } @@ -168,7 +169,7 @@ PhLLaunchConfiguration >> printOn: aStream [ { #category : #configuring } PhLLaunchConfiguration >> useSettings: aBoolean [ "Cannot skip Pharo settings before Pharo 3.0" - self image ensurePharoVersion asInteger < 30 ifTrue: [ ^ self ]. + self image pharoVersion asInteger < 30 ifTrue: [ ^ self ]. usePharoSettings := aBoolean. ] diff --git a/src/PharoLauncher-Core/PhLLaunchImageCommand.class.st b/src/PharoLauncher-Core/PhLLaunchImageCommand.class.st index caf711ad..a6f3c941 100644 --- a/src/PharoLauncher-Core/PhLLaunchImageCommand.class.st +++ b/src/PharoLauncher-Core/PhLLaunchImageCommand.class.st @@ -129,8 +129,7 @@ PhLLaunchImageCommand >> launchConfigurationOfImage: aPhLImage [ PhLLaunchImageCommand >> launchImage: aPhLImage [ | process launchConfig | - [ - launchConfig := self launchConfigurationOfImage: aPhLImage. + [ launchConfig := self launchConfigurationOfImage: aPhLImage. launchConfig useSettings: useSettings. process := aPhLImage launchWithConfiguration: launchConfig ] on: PhLError diff --git a/src/PharoLauncher-Core/PhLPrivateVirtualMachine.class.st b/src/PharoLauncher-Core/PhLPrivateVirtualMachine.class.st deleted file mode 100644 index 07f6ac7c..00000000 --- a/src/PharoLauncher-Core/PhLPrivateVirtualMachine.class.st +++ /dev/null @@ -1,27 +0,0 @@ -" -I represent a Pharo virtual machine used to determine an image phar version by running it with a VM compatible with its image format. - - ex: 6505 6521 68021 - -" -Class { - #name : #PhLPrivateVirtualMachine, - #superclass : #PhLVirtualMachine, - #category : #'PharoLauncher-Core-Download' -} - -{ #category : #testing } -PhLPrivateVirtualMachine class >> isSubclassForDirectory: aFileReference private: isPrivateVm [ - ^ isPrivateVm -] - -{ #category : #querying } -PhLPrivateVirtualMachine >> downloadUrl [ - ^ self manager compatibleVmUrls - at: self name asInteger -] - -{ #category : #accessing } -PhLPrivateVirtualMachine >> vmStore [ - ^ self manager privateVmStore -] diff --git a/src/PharoLauncher-Core/PhLToggleVmPrivateVmCommand.class.st b/src/PharoLauncher-Core/PhLToggleVmPrivateVmCommand.class.st deleted file mode 100644 index ae44681b..00000000 --- a/src/PharoLauncher-Core/PhLToggleVmPrivateVmCommand.class.st +++ /dev/null @@ -1,28 +0,0 @@ -" -Toggle between display of VMs used to launch Pharo images and ""private"" VMs used to determine Pharo version of an image (one VM per image format) -" -Class { - #name : #PhLToggleVmPrivateVmCommand, - #superclass : #PhLVmCommand, - #category : #'PharoLauncher-Core-Commands' -} - -{ #category : #converting } -PhLToggleVmPrivateVmCommand >> asSpecCommand [ - ^ super asSpecCommand - iconName: #remote; - beDisplayedOnRightSide; - configureAsToolBarToggleButton; - yourself -] - -{ #category : #executing } -PhLToggleVmPrivateVmCommand >> execute [ - self vmsPresenter toggleShowVmPrivateVm. -] - -{ #category : #initialization } -PhLToggleVmPrivateVmCommand >> initialize [ - super initialize. - self name: 'public' -] diff --git a/src/PharoLauncher-Core/PhLVirtualMachine.class.st b/src/PharoLauncher-Core/PhLVirtualMachine.class.st index c1c681cd..4eb3d6e0 100644 --- a/src/PharoLauncher-Core/PhLVirtualMachine.class.st +++ b/src/PharoLauncher-Core/PhLVirtualMachine.class.st @@ -41,18 +41,14 @@ Class { { #category : #'instance creation' } PhLVirtualMachine class >> directory: aFileReference [ - ^ self - directory: aFileReference - private: false -] -{ #category : #'instance creation' } -PhLVirtualMachine class >> directory: aFileReference private: isPrivateVm [ | targetClass | - targetClass := self allSubclasses detect: [ :cls | cls isSubclassForDirectory: aFileReference private: isPrivateVm ] ifNone: [ self ]. - ^ targetClass new - initializeOn: aFileReference; - yourself + targetClass := self allSubclasses + detect: [ :cls | cls isSubclassForDirectory: aFileReference ] + ifNone: [ self ]. + ^ targetClass new + initializeOn: aFileReference; + yourself ] { #category : #accessing } @@ -80,9 +76,9 @@ PhLVirtualMachine class >> id: aString [ ] { #category : #testing } -PhLVirtualMachine class >> isSubclassForDirectory: aFileReference private: isPrivateVm [ +PhLVirtualMachine class >> isSubclassForDirectory: aFileReference [ - ^ isPrivateVm not and: [ aFileReference basename beginsWith: self versionPrefix ] + ^ aFileReference basename beginsWith: self versionPrefix ] { #category : #accessing } diff --git a/src/PharoLauncher-Core/PhLVirtualMachineManager.class.st b/src/PharoLauncher-Core/PhLVirtualMachineManager.class.st index 27f86c74..f78f4b37 100644 --- a/src/PharoLauncher-Core/PhLVirtualMachineManager.class.st +++ b/src/PharoLauncher-Core/PhLVirtualMachineManager.class.st @@ -117,12 +117,6 @@ PhLVirtualMachineManager class >> pharoUnzip: aZipFileReference to: outputDirect overwrite: true ] ] -{ #category : #private } -PhLVirtualMachineManager class >> privateVmStore [ - "The private store is used to fetch one VM per image format and open image to determine their pharo version number (e.g. 6.0, 7.0, etc.). Then we download the latest stable VM for the given Pharo image version." - ^ (self vmStore / 'private') ensureCreateDirectory -] - { #category : #initialization } PhLVirtualMachineManager class >> reset [