Christoph Thiede uploaded a new version of Monticello to project The Inbox:
http://source.squeak.org/inbox/Monticello-ct.717.mcz ==================== Summary ==================== Name: Monticello-ct.717 Author: ct Time: 18 April 2020, 4:43:29.411949 pm UUID: c83665a7-dbba-654c-9f87-a43916ed24a6 Ancestors: Monticello-nice.716 Fixes regression in the dependency sorter that was introduced via Monticello-ct.715. Restore the original semantics of #orderedItems, meaning to return all items that were added to the sorter. Rename (and reorder) instance variable to avoid confusion with the changed behavior of #orderedItems. Note that #orderedItems is no quick getter any more. Add some documentation. Note that I did not document the instvars 'required' and 'provided' coz I don't have an appropriate overview of them at the moment. Thanks to Jakob (jr) for the help! :-) =============== Diff against Monticello-nice.716 =============== Item was changed: ----- Method: MCDefinition>>wantsToBeOutermost (in category 'testing') ----- wantsToBeOutermost + "Outermost definitions are installed after all other definitions. In particular, this hook is crucial for the correct behavior of removal preambles. See MCDependencySorter >> #addDeferred:." ^ false! Item was changed: Object subclass: #MCDependencySorter + instanceVariableNames: 'nondeferred deferred required provided' - instanceVariableNames: 'required provided deferred orderedItems' classVariableNames: '' poolDictionaries: '' category: 'Monticello-Loading'! + + !MCDependencySorter commentStamp: 'ct 4/18/2020 16:38' prior: 0! + I sort a set of passed MCDefinitions, resolving all dependency conflicts automatically. + + To use me, first add some items to me using the building protocol or my class-side #items: selector. After that, send #orderedItems to me and I will tell you all items in a loadable order. + + Instance Variables + nondeferred: <SequenceableCollection> + Usual items that do not require special sorting mechanics. + deferred: <SequenceableCollection> + Items that are added after all nondeferred items. See MCDefinition >> #wantsToBeOutermost. + required: <Set> + provided: <Set>! Item was changed: ----- Method: MCDependencySorter class>>sortItems: (in category 'utility') ----- sortItems: aCollection | sorter | sorter := self items: aCollection. sorter externalRequirements do: [:req | sorter addProvision: req]. + ^ sorter orderedItems! - ^ sorter orderedItems.! Item was removed: - ----- Method: MCDependencySorter>>addDeferred (in category 'building') ----- - addDeferred - deferred do: [:ea | - self addToOrder: ea].! Item was changed: ----- Method: MCDependencySorter>>addDeferred: (in category 'private') ----- addDeferred: anItem + "Add an item to the derred list. Deferred items will be appended to #orderedItems after all nondeferred items. See #wantsToBeOutermost." + ^ deferred add: anItem! Item was changed: ----- Method: MCDependencySorter>>addToOrder: (in category 'private') ----- addToOrder: anItem + nondeferred add: anItem. - orderedItems add: anItem. anItem provisions do: [:ea | self addProvision: ea].! Item was changed: ----- Method: MCDependencySorter>>initialize (in category 'initialize-release') ----- initialize provided := Set new. required := Dictionary new. + nondeferred := OrderedCollection new. - orderedItems := OrderedCollection new. deferred := OrderedCollection new.! Item was changed: + ----- Method: MCDependencySorter>>orderedItems (in category 'accessing') ----- - ----- Method: MCDependencySorter>>orderedItems (in category 'sorting') ----- orderedItems + "Return all ordered items, first nondeferred items, second deferred (outermost) items." + + ^ nondeferred , deferred! - ^ orderedItems! Item was changed: ----- Method: MCPackageLoader>>sorterForItems: (in category 'private') ----- sorterForItems: aCollection | sorter | sorter := MCDependencySorter items: aCollection. sorter addExternalProvisions: self provisions. - sorter addDeferred. ^ sorter! |
Free forum by Nabble | Edit this page |