From b7e3a4973439a7eb0cde09533edd46355c5d1610 Mon Sep 17 00:00:00 2001 From: ClotildeToullec Date: Mon, 2 Sep 2024 11:18:04 +0200 Subject: [PATCH 1/2] Register MooseConfiguration to Iceberg announcements. This will sort repositories by: - Cloned repositories before 'Local repository missing' - Name This sorting will happen each time a repo is added or modified (cloned). --- src/BaselineOfMoose/BaselineOfMoose.class.st | 26 ++++++++++++++++--- .../MooseConfiguration.class.st | 20 ++++++++++++++ 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/BaselineOfMoose/BaselineOfMoose.class.st b/src/BaselineOfMoose/BaselineOfMoose.class.st index 8f4c9282..6644d4fe 100644 --- a/src/BaselineOfMoose/BaselineOfMoose.class.st +++ b/src/BaselineOfMoose/BaselineOfMoose.class.st @@ -19,11 +19,14 @@ BaselineOfMoose >> baseline: spec [ mooseIDE: spec. spec - package: 'Moose-Configuration' with: [ spec requires: #( 'Famix' 'FamixTagging' 'FamixReplication' 'MooseIDE' ) ]; - package: 'Moose-WelcomeBrowser' with: [ spec requires: #( 'Moose-Configuration' ) ]. + package: 'Moose-Configuration' with: [ + spec requires: + #( 'Famix' 'FamixTagging' 'FamixReplication' 'MooseIDE' ) ]; + package: 'Moose-WelcomeBrowser' + with: [ spec requires: #( 'Moose-Configuration' ) ]. self groups: spec. - spec postLoadDoIt: #registerMooseWelcomeBrowser ] + spec postLoadDoIt: #installMooseConfigurations ] ] { #category : #dependencies } @@ -59,6 +62,13 @@ BaselineOfMoose >> groups: spec [ spec group: 'Metamodel' with: #( 'Famix' ) ] +{ #category : #actions } +BaselineOfMoose >> installMooseConfigurations [ + + self registerMooseWelcomeBrowser. + self registerToIceberg +] + { #category : #dependencies } BaselineOfMoose >> mooseIDE: spec [ @@ -75,9 +85,17 @@ BaselineOfMoose >> projectClass [ { #category : #actions } BaselineOfMoose >> registerMooseWelcomeBrowser [ - "For Pharo 11 and after" Smalltalk at: #MooseWelcomeBrowser ifPresent: [ :mooseWelcome | mooseWelcome register ] ] + +{ #category : #actions } +BaselineOfMoose >> registerToIceberg [ + + Smalltalk + at: #MooseWelcomeBrowser + ifPresent: [ :mooseConfiguration | + mooseConfiguration registerToIceberg ] +] diff --git a/src/Moose-Configuration/MooseConfiguration.class.st b/src/Moose-Configuration/MooseConfiguration.class.st index ff3ee7b7..99f73ae7 100644 --- a/src/Moose-Configuration/MooseConfiguration.class.st +++ b/src/Moose-Configuration/MooseConfiguration.class.st @@ -31,3 +31,23 @@ MooseConfiguration class >> mooseSettingsOn: aBuilder [ label: 'Moose'; description: 'Moose settings' ] + +{ #category : #iceberg } +MooseConfiguration class >> registerToIceberg [ + + Iceberg announcer + when: IceRepositoryCreated + send: #sortIcebergRepositories + to: self. + + Iceberg announcer + when: IceRepositoryModified + send: #sortIcebergRepositories + to: self +] + +{ #category : #iceberg } +MooseConfiguration class >> sortIcebergRepositories [ + + IceRepository registry sort: #isMissing ascending , #name ascending +] From 80265f364b7fda88dadb731fbe09530b8edb48c1 Mon Sep 17 00:00:00 2001 From: ClotildeToullec Date: Mon, 2 Sep 2024 11:25:56 +0200 Subject: [PATCH 2/2] Fix small mistake --- src/BaselineOfMoose/BaselineOfMoose.class.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BaselineOfMoose/BaselineOfMoose.class.st b/src/BaselineOfMoose/BaselineOfMoose.class.st index 6644d4fe..d5cb1fb8 100644 --- a/src/BaselineOfMoose/BaselineOfMoose.class.st +++ b/src/BaselineOfMoose/BaselineOfMoose.class.st @@ -95,7 +95,7 @@ BaselineOfMoose >> registerMooseWelcomeBrowser [ BaselineOfMoose >> registerToIceberg [ Smalltalk - at: #MooseWelcomeBrowser + at: #MooseConfiguration ifPresent: [ :mooseConfiguration | mooseConfiguration registerToIceberg ] ]