The Trunk: ReleaseBuilder-mt.132.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: ReleaseBuilder-mt.132.mcz

commits-2
Marcel Taeumel uploaded a new version of ReleaseBuilder to project The Trunk:
http://source.squeak.org/trunk/ReleaseBuilder-mt.132.mcz

==================== Summary ====================

Name: ReleaseBuilder-mt.132
Author: mt
Time: 13 May 2016, 2:29:01.268213 pm
UUID: e0d68a5b-f098-b54f-9abb-b809062a0a07
Ancestors: ReleaseBuilder-mt.131

More refactoring. Separate image preparation into a) preparing source code and b) preparing environment. Seperating environment preparation into 1) clear caches, 2) configure tools, 3) set preferences, and 4) configure desktop/content. The steps 2) and 3) are somewhat similar. 3) means the (pragma) preferences mechanism only whereas 2) addresses configuration in other ways.

=============== Diff against ReleaseBuilder-mt.131 ===============

Item was changed:
+ ----- Method: ReleaseBuilder class>>checkForDirtyPackages (in category 'scripts - support') -----
- ----- Method: ReleaseBuilder class>>checkForDirtyPackages (in category 'scripts') -----
  checkForDirtyPackages
 
  | modifiedWorkingCopies unmergedWorkingCopies |
  MCWorkingCopy checkModified: true.
  modifiedWorkingCopies := MCWorkingCopy allManagers
  select: [:wc | wc ancestors size = 1 and: [wc modified] ].
  unmergedWorkingCopies := MCWorkingCopy allManagers
  select: [:wc | (wc ancestors size = 1) not ].
 
  unmergedWorkingCopies ifNotEmpty: [
  "Sort to simplify exploration. MC browser does also show packages sorted."
  (modifiedWorkingCopies sortBy: [:wc1 :wc2 | wc1 packageName <= wc2 packageName]) explore.
  Warning signal: 'There are unmerged packages.'].
 
  modifiedWorkingCopies ifNotEmpty: [
  "Sort to simplify exploration. MC browser does also show packages sorted."
  (modifiedWorkingCopies sortBy: [:wc1 :wc2 | wc1 packageName <= wc2 packageName]) explore.
 
  (Project current uiManager
  confirm: 'Do you want to discard all local changes?'
  orCancel: [^ Error signal: 'Release building canceled.']
  title: 'Dirty Packages Found')
  ifTrue: [modifiedWorkingCopies do: [:wc |
  [(self buildRepository versionWithInfo: wc ancestors first) load]
  on: Warning do: [:warning | warning resume]]]].!

Item was added:
+ ----- Method: ReleaseBuilder class>>clearCaches (in category 'scripts') -----
+ clearCaches
+ "Clear caches, discard unused references, free space."
+
+ Smalltalk cleanUp: true.
+ Project current resourceManager reset. "Zap eventual resources"
+ self discardUserObjects.
+ MCFileBasedRepository flushAllCaches.
+
+ "Clear all user login data."
+ MCHttpRepository clearCredentials.
+ Utilities setAuthorInitials: String empty.
+
+ Environment allInstancesDo: [ : env | env purgeUndeclared ].
+ Undeclared removeUnreferencedKeys.
+
+ Smalltalk garbageCollect.!

Item was changed:
  ----- Method: ReleaseBuilder class>>configureDesktop (in category 'scripts') -----
  configureDesktop
+ "Open tools, multimedia content, etc."
+
+ self setDisplayExtent: 800 @ 600.
+ self setProjectBackground: Color darkGray.
+
  self deleteAllWindows.
+
- Project current resourceManager reset. "Zap eventual resources"
  "Replace docking bar instance in case its code has changed."
  Project current removeMainDockingBar.
+ TheWorldMainDockingBar updateInstances.
+
+ self openWelcomeWorkspaces.!
- TheWorldMainDockingBar updateInstances!

Item was added:
+ ----- Method: ReleaseBuilder class>>configureTools (in category 'scripts') -----
+ configureTools
+ "Initialize well-known tools and other resources."
+
+ TTCFont registerAll.
+ FileList initialize. "register file reader services"
+ RealEstateAgent standardSize: 600 @ 400.
+ SMLoaderPlus setDefaultFilters: #(filterSafelyAvailable).
+ !

Item was changed:
+ ----- Method: ReleaseBuilder class>>copyPackagesFrom:to:depth: (in category 'scripts - support') -----
- ----- Method: ReleaseBuilder class>>copyPackagesFrom:to:depth: (in category 'scripts') -----
  copyPackagesFrom: sourceRepository to: targetRepository depth: historyDepth
  "Copy the packages currently loaded in the image from the source repository to a target repository. Follow ancestry up to the depth specified."
 
  | currentDepth nextVersions currentVersions ignoredVersions |
  currentDepth := 0.
  nextVersions := (MCWorkingCopy allManagers gather: [:wc | wc ancestors]) asOrderedCollection.
  ignoredVersions := OrderedCollection new.
 
  [nextVersions notEmpty] whileTrue: [
  currentVersions := nextVersions.
  nextVersions := OrderedCollection new.
  currentDepth := currentDepth + 1.
 
  currentVersions do: [:versionInfo |
  (targetRepository includesVersionNamed: versionInfo versionName)
  ifTrue: [Transcript showln: ('[ReleaseBuilder] Version {1} already exists in {2}'
  format: {versionInfo versionName. targetRepository description})]
  ifFalse: [(sourceRepository versionWithInfo: versionInfo)
  ifNil: [ignoredVersions add: versionInfo]
  ifNotNil: [:version | targetRepository storeVersion: version ] ].
  currentDepth < historyDepth ifTrue: [
  nextVersions addAll: versionInfo ancestors]]].
 
  ignoredVersions ifNotEmpty: [
  ignoredVersions explore.
  Warning signal: 'There were versions not found in the source repository.'].!

Item was changed:
+ ----- Method: ReleaseBuilder class>>copyUpdateMapTo: (in category 'scripts - support') -----
- ----- Method: ReleaseBuilder class>>copyUpdateMapTo: (in category 'scripts') -----
  copyUpdateMapTo: targetRepository
 
  self buildConfiguration in: [:config |
  | newConfig |
  newConfig := MCConfiguration new.
  newConfig repositories add: targetRepository.
  newConfig dependencies addAll: config dependencies.
  newConfig name: config name.
 
  targetRepository storeVersion: newConfig].!

Item was changed:
+ ----- Method: ReleaseBuilder class>>deleteAllWindows (in category 'scripts - support') -----
- ----- Method: ReleaseBuilder class>>deleteAllWindows (in category 'scripts') -----
  deleteAllWindows
  (SystemWindow
  windowsIn: Project current world
  satisfying:
  [ : window | true ]) do:
  [ : window | [ window makeClosable; delete ]
  on: ProvideAnswerNotification
  do: [ : noti | noti resume: true ] ]!

Item was changed:
+ ----- Method: ReleaseBuilder class>>discardUserObjects (in category 'scripts - support') -----
- ----- Method: ReleaseBuilder class>>discardUserObjects (in category 'scripts') -----
  discardUserObjects
 
  Player removeUninstantiatedSubclassesSilently.
+ MorphicModel removeUninstantiatedSubclassesSilently.
+
+ "Remove empty categories for user objects."
+ SystemOrganizer cleanUp: true.!
- MorphicModel removeUninstantiatedSubclassesSilently.!

Item was changed:
+ ----- Method: ReleaseBuilder class>>loadWellKnownPackages (in category 'scripts - support') -----
- ----- Method: ReleaseBuilder class>>loadWellKnownPackages (in category 'scripts') -----
  loadWellKnownPackages
  "Load into the release image those packages that have been stripped from Trunk, but still deemed necessary for a release artifact."
+
+ "Not ready yet."
+ "Installer new merge: #squeakRelease"!
- Installer new merge: #squeakRelease!

Item was changed:
+ ----- Method: ReleaseBuilder class>>openWelcomeWorkspaces (in category 'scripts - support') -----
- ----- Method: ReleaseBuilder class>>openWelcomeWorkspaces (in category 'scripts') -----
  openWelcomeWorkspaces
  |offset | offset:= 50@50.
  #('License Information' 'The Squeak User Interface' 'Working With Squeak' 'Release Notes')
  with:  #(#licenseInformation #squeakUserInterface #workingWithSqueak #releaseNotes)
    do: [ : eachLabel : eachAccessor |
  TheWorldMainDockingBar instance
  showWelcomeText: eachAccessor
  label: eachLabel
  in: (offset extent: 500@300).
  offset := offset + (30@30)]!

Item was changed:
  ----- Method: ReleaseBuilder class>>prepareEnvironment (in category 'preparing') -----
  prepareEnvironment
  "Prepare everything that should be done for a new image build. Clear caches, passwords, etc."
  "ReleaseBuilder prepareNewBuild"
 
- TTCFont registerAll.
- FileList initialize.
- RealEstateAgent standardSize: 600 @ 400.
- SMLoaderPlus setDefaultFilters: (OrderedCollection with: #filterSafelyAvailable).
- " Preferences outOfTheBox."  "<-- uncomment after #defaultValueTableForCurrentRelease is fixed up."
  self
+ clearCaches;
+ configureTools;
+ setPreferences;
+ configureDesktop.!
- setDisplayExtent: 800 @ 600 ;
- setPreferences ;  "<-- remove this after defaultValueTableForCurrentRelease is fixed up."
- discardUserObjects ;
- configureDesktop.
- Smalltalk cleanUp: true.
- MCFileBasedRepository flushAllCaches.
- MCHttpRepository clearCredentials.
- Utilities setAuthorInitials: String empty.
- Environment allInstancesDo: [ : env | env purgeUndeclared ].
- Undeclared removeUnreferencedKeys.
- Smalltalk garbageCollect.
- [ self loadWellKnownPackages "<-- 4.5 is not ready for unloaded / reloaded packages" ].
- Compiler recompileAll.
- self openWelcomeWorkspaces.!

Item was changed:
  ----- Method: ReleaseBuilder class>>prepareSourceCode (in category 'preparing') -----
  prepareSourceCode
  "Update code. Remove foreign packages."
 
  MCMcmUpdater defaultUpdateURL: self buildRepository description.
 
  MCMcmUpdater updateMissingPackages: true.
  MCMcmUpdater enableUpdatesForAllPackages.
 
  MCMcmUpdater default doUpdate: false. "non-interactive".
 
+ self
+ unloadForeignPackages;
+ checkForDirtyPackages;
+ loadWellKnownPackages.
+
+ Compiler recompileAll.!
- self unloadForeignPackages.
- self checkForDirtyPackages.!

Item was changed:
  ----- Method: ReleaseBuilder class>>saveAsNewRelease (in category 'saving') -----
  saveAsNewRelease
  "ReleaseManager saveAsNewRelease"
 
  (Project current uiManager
  confirm: 'About to build new release', (self localBuild ifTrue: [' (locally!!)'] ifFalse: ['']),': ', self versionString, String cr, String cr, 'The VM will quit after that. Continue?'
  title: 'Release Builder') ifFalse: [^ self].
 
  self prepareNewRelease.
+ Smalltalk saveAs: self versionString, '-', SystemVersion current highestUpdate asString, (self localBuild ifTrue: ['-offline'] ifFalse: ['']).
- Smalltalk saveAs: self versionString, '-', SystemVersion current highestUpdate asString.
  Smalltalk snapshot: true "Important!!" andQuit: true.!

Item was changed:
  ----- Method: ReleaseBuilder class>>saveAsNextVersionAlpha (in category 'saving') -----
  saveAsNextVersionAlpha
  "ReleaseBuilder saveNextVersionAlpha."
 
  (Project current uiManager
  confirm: 'About to build new release', (self localBuild ifTrue: [' (locally!!)'] ifFalse: ['']),': ', self versionStringAlpha, String cr, String cr, 'The VM will quit after that. Continue?'
  title: 'Release Builder') ifFalse: [^ self].
 
  self prepareNextVersionAlpha.
+ Smalltalk saveAs: self versionStringAlpha, '-', SystemVersion current highestUpdate asString, (self localBuild ifTrue: ['-offline'] ifFalse: ['']).
- Smalltalk saveAs: self versionStringAlpha, '-', SystemVersion current highestUpdate asString.
  Smalltalk snapshot: true "Important!!" andQuit: true.!

Item was changed:
+ ----- Method: ReleaseBuilder class>>setDisplayExtent: (in category 'scripts - support') -----
- ----- Method: ReleaseBuilder class>>setDisplayExtent: (in category 'scripts') -----
  setDisplayExtent: extent
 
  DisplayScreen
  fullScreenOff;
  setNewScreenSize: extent.
 
  self assert: Display extent = extent.!

Item was changed:
  ----- Method: ReleaseBuilder class>>setPreferences (in category 'scripts') -----
  setPreferences
  "Preferences class defaultValueTableForCurrentRelease"
 
+ " Preferences outOfTheBox."  "<-- uncomment after #defaultValueTableForCurrentRelease is fixed up."
- self setProjectBackground: Color darkGray.
 
  "General User interaction"
  Preferences
  enable: #generalizedYellowButtonMenu ;
  disable: #mouseOverForKeyboardFocus ;
  enable: #swapMouseButtons.
  Morph indicateKeyboardFocus: true.
  ToolBuilder openToolsAttachedToMouseCursor: false.
  SearchBar useScratchPad: false.
 
  "Text input."
  TextEditor
  autoEnclose: true ;
  autoIndent: true ;
  destructiveBackWord: false ;
  blinkingCursor: true ;
  dumbbellCursor: false.
  Preferences
  insertionPointColor: Color red.
  PluggableTextMorph simpleFrameAdornments: false.
 
  "Windows"
  Preferences installUniformWindowColors.
  SystemWindow reuseWindows: false.
  Model windowActiveOnFirstClick: false. "Not good for 800x600"
  Preferences
  disable: #showSplitterHandles;
  enable: #fastDragWindowForMorphic.
  CornerGripMorph drawCornerResizeHandles: false.
  ProportionalSplitterMorph
  smartHorizontalSplitters: false ;
  smartVerticalSplitters: false.
 
  "Scroll bars."
  Preferences
  enable: #scrollBarsNarrow;
  enable: #scrollBarsOnRight;
  disable: #alwaysHideHScrollbar;
  disable: #alwaysShowHScrollbar;
  disable: #alwaysShowVScrollbar.
  ScrollBar
  scrollBarsWithoutArrowButtons: true;
  scrollBarsWithoutMenuButton: true.
  ScrollPane
  useRetractableScrollBars: false.
 
  "Rounded corners."
  Morph preferredCornerRadius: 6.
  Preferences disable: #roundedWindowCorners.
  PluggableButtonMorph roundedButtonCorners: false.
  FillInTheBlankMorph roundedDialogCorners: false.
  MenuMorph roundedMenuCorners: false.
  ScrollBar roundedScrollBarLook: false.
 
  "Gradients."
  Preferences disable: #gradientScrollBars.
  SystemWindow gradientWindow: false.
  MenuMorph gradientMenu: false.
  PluggableButtonMorph gradientButton: false.
 
  "Shadows"
  Preferences enable: #menuAppearance3d.
  MenuMorph
  menuBorderWidth: 1;
  menuBorderColor: Color lightGray;
  menuLineColor: Color lightGray.
  Morph useSoftDropShadow: true..
 
  "Lists and Trees"
  PluggableListMorph
  filterableLists: true;
  clearFilterAutomatically: false;
  highlightHoveredRow: true;
  menuRequestUpdatesSelection: true.
  PluggableTreeMorph
  filterByLabelsOnly: false;
  maximumSearchDepth: 1.
  LazyListMorph
  listSelectionTextColor: Color black;
  listSelectionColor: (Color r: 0.72 g: 0.72 b: 0.9).
 
  "Standard Tools"
+ BalloonMorph balloonColor: (Color r: 0.92 g: 0.92 b: 0.706).
- BalloonMorph balloonColor:
- (TranslucentColor r: 0.92 g: 0.92 b: 0.706 alpha: 0.75).
  Workspace shouldStyle: false.
  Browser
  listClassesHierarchically: true;
  showClassIcons: true;
  showMessageIcons: true;
  sortMessageCategoriesAlphabetically: true.
  Preferences enable: #annotationPanes;
  enable: #optionalButtons;
  enable: #diffsWithPrettyPrint;
  enable: #traceMessages;
  enable: #alternativeBrowseIt;
  enable: #menuWithIcons;
  enable: #visualExplorer.
  SystemNavigation thoroughSenders: true.
  Preferences disable: #debugLogTimestamp.
 
  "Halo"
  Preferences
  enable: #showBoundsInHalo ;
  disable: #alternateHandlesLook.
 
  "System"
  NetNameResolver enableIPv6: false.
  Scanner
  allowUnderscoreAsAssignment: true;
  prefAllowUnderscoreSelectors: true.
 
  "that's all, folks"!

Item was changed:
+ ----- Method: ReleaseBuilder class>>setProjectBackground: (in category 'scripts - support') -----
- ----- Method: ReleaseBuilder class>>setProjectBackground: (in category 'scripts') -----
  setProjectBackground: aFormOrColorOrFillStyle
 
  MorphicProject defaultFill: (aFormOrColorOrFillStyle isForm
  ifTrue: [InfiniteForm with: aFormOrColorOrFillStyle]
  ifFalse: [aFormOrColorOrFillStyle isColor
  ifTrue: [SolidFillStyle color: aFormOrColorOrFillStyle]
  ifFalse: [aFormOrColorOrFillStyle]]).
  ActiveWorld fillStyle: MorphicProject defaultFill.!

Item was changed:
+ ----- Method: ReleaseBuilder class>>setTopProject (in category 'scripts - support') -----
- ----- Method: ReleaseBuilder class>>setTopProject (in category 'scripts') -----
  setTopProject
 
  Project current isMorphic ifFalse: [
  Warning signal: 'The current project is not Morphic. A new Morphic project will be created and entered. Please restart the release building process after that.'.
  MorphicProject new enter "current process terminates after this"].
 
  Project current removeAllOtherProjects.!

Item was changed:
+ ----- Method: ReleaseBuilder class>>switchToNewRepository: (in category 'scripts - support') -----
- ----- Method: ReleaseBuilder class>>switchToNewRepository: (in category 'scripts') -----
  switchToNewRepository: anMCRepository
  MCMcmUpdater defaultUpdateURL: anMCRepository description.
  MCRepositoryGroup reset.
  MCRepositoryGroup default addRepository: anMCRepository.
  MCWorkingCopy allManagers do:
  [ : each | each repositoryGroup:
  (MCRepositoryGroup new
  addRepository: anMCRepository ;
  yourself) ]!

Item was changed:
+ ----- Method: ReleaseBuilder class>>unloadForeignPackages (in category 'scripts - support') -----
- ----- Method: ReleaseBuilder class>>unloadForeignPackages (in category 'scripts') -----
  unloadForeignPackages
  "Removes all packages that are not present in the build configuration."
 
  self buildConfiguration in: [:config |
  MCWorkingCopy allManagers
  reject: [:wc | config dependencies anySatisfy: [:dep | dep package name = wc package name]]
  thenDo: [:wc | wc unload]].!