The Trunk: ReleaseBuilder-mt.138.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.138.mcz

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

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

Name: ReleaseBuilder-mt.138
Author: mt
Time: 29 July 2016, 3:50:05.208103 pm
UUID: 3a79fdbe-4a63-c44d-84d2-561de7f32556
Ancestors: ReleaseBuilder-mt.137

Improve release building process. Some clean-up. Automate this and that. :-)

Add the "alpha" suffix for the current trunk version again.

=============== Diff against ReleaseBuilder-mt.137 ===============

Item was changed:
  Object subclass: #ReleaseBuilder
  instanceVariableNames: ''
+ classVariableNames: 'DeferredTask NextMajorVersion NextMinorVersion NextTask'
- classVariableNames: ''
  poolDictionaries: ''
  category: 'ReleaseBuilder'!
 
+ !ReleaseBuilder commentStamp: 'mt 6/22/2016 18:08' prior: 0!
+ I'm the script that prepares a trunk image for release.
- !ReleaseBuilder commentStamp: 'mt 5/12/2016 16:50' prior: 0!
- I'm the script that prepares a trunk image for release. For the next release version please update #releaseVersionMajor and #releaseVersionMinor.
 
+ Just do "ReleaseBuilder doNextStep" repeatedly until the next release is done.
- Prepare and save this image as a release image via "ReleaseBuilder saveAsNewRelease."
- If you want to save this image as the next alpha release, do: "ReleaseBuilder saveAsNextVersionAlpha."
 
+ For the final release step:
+ - If you want to try it locally, change #localBuild to return true.
+ - Most of the code operates (read-only) on the build repository, which is usually the trunk. For releases, there is a release repository, to which some package versions will be copied from trunk.!
- If you want to try it locally, change #localBuild to return true.
-
- Most of the code operates (read-only) on the build repository, which is usually the trunk. For releases, there is a release repository, to which some package versions will be copied from trunk.!

Item was added:
+ ----- Method: ReleaseBuilder class>>assureReleaseRepositoryReadAccess: (in category 'manual') -----
+ assureReleaseRepositoryReadAccess: repo
+
+ self releaseLocally ifTrue: [
+ (FileDirectory on: repo description) assureExistence.
+ ^ true].
+
+ [repo allFileNames] on: NetworkError do: [
+ UserDialogBoxMorph
+ inform: ('Please create the release repository:\{1}\...and ensure that you have global read access to it.' withCRs
+ format: {repo description}) title: 'Release Builder - Manual Step Required'.
+ ^ false].
+ ^ true!

Item was added:
+ ----- Method: ReleaseBuilder class>>assureReleaseRepositoryWriteAccess: (in category 'manual') -----
+ assureReleaseRepositoryWriteAccess: repo
+
+ self releaseLocally ifTrue: [^ self].
+
+ repo
+ user: (UIManager default
+ request: 'Enter user for ', repo description
+ initialAnswer: (repo user ifEmpty: [Utilities authorInitials]));
+ password: (UIManager default
+ requestPassword: 'Enter password for ' , repo description).!

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

Item was added:
+ ----- Method: ReleaseBuilder class>>copyPackages (in category 'manual') -----
+ copyPackages
+ "For bootstrapping the contents of the release repository."
+
+ self copyPackagesFrom: self buildRepository to: self releaseRepository depth: 1.!

Item was changed:
+ ----- Method: ReleaseBuilder class>>copyPackagesFrom:to:depth: (in category 'manual') -----
- ----- Method: ReleaseBuilder class>>copyPackagesFrom:to:depth: (in category 'scripts - support') -----
  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 added:
+ ----- Method: ReleaseBuilder class>>copyUpdateMap (in category 'manual') -----
+ copyUpdateMap
+ "For bootstrapping the contents of the release repository."
+
+ self copyUpdateMap: self buildConfiguration to: self releaseRepository.!

Item was added:
+ ----- Method: ReleaseBuilder class>>copyUpdateMap:to: (in category 'manual') -----
+ copyUpdateMap: configuration to: targetRepository
+
+ | newConfig |
+ newConfig := MCConfiguration new.
+ newConfig repositories add: targetRepository.
+ newConfig dependencies addAll: configuration dependencies.
+ newConfig name: configuration name.
+
+ targetRepository storeVersion: newConfig.!

Item was removed:
- ----- Method: ReleaseBuilder class>>copyUpdateMapTo: (in category 'scripts - support') -----
- 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 added:
+ ----- Method: ReleaseBuilder class>>doNextStep (in category 'manual') -----
+ doNextStep
+ "Use this call to perform the manual steps in the release process."
+
+ | versionString |
+ SystemVersion current isRelease ifTrue: [
+ ^ self inform: 'This is a release image. Please use a trunk image to prepare the next release'].
+
+ versionString := SystemVersion current version.
+
+ SystemVersion current isAlpha ifTrue: [^ self step1FeatureFreeze].
+ SystemVersion current isFeatureFreeze ifTrue: [^ self step2CodeFreeze].
+ SystemVersion current isReleaseCandidate ifTrue: [
+ "Still code freeze and another RC? Or do the release?"
+ (UIManager default
+ chooseFrom: #('Create next release candidate' 'Create next release' 'Do nothing') lines: #(2)
+ title: versionString) in: [:answer |
+ answer = 1 ifTrue: [^ self step3NextReleaseCandidate].
+ answer = 2 ifTrue: [^ self step4Release]].
+ ^ self].!

Item was added:
+ ----- Method: ReleaseBuilder class>>initialize (in category 'class initialization') -----
+ initialize
+ Smalltalk addToStartUpList: self.
+
+ SystemVersion newVersion: 'Squeak5.1alpha'.!

Item was removed:
- ----- Method: ReleaseBuilder class>>localBuild (in category 'accessing') -----
- localBuild
- "If true, use a local, directory-based repository. Usually in the working directory."
-
- ^ true!

Item was removed:
- ----- Method: ReleaseBuilder class>>prepareNewRelease (in category 'preparing') -----
- prepareNewRelease
- "This method is run at time of release to transfer the top trunk versions into my releaseRepository, and produce a release image."
-
- | source target |
- source := self buildRepository.
- target := self releaseRepository.
-
- [ self
- setTopProject;
- prepareSourceCode;
- copyPackagesFrom: source to: target depth: 1;
- copyUpdateMapTo: target;
- prepareEnvironment;
- switchToNewRepository: target.
- ] on: MCEmptyVersion do: [:warning | warning resume].
-
- SystemVersion newVersion: self versionString.!

Item was removed:
- ----- Method: ReleaseBuilder class>>prepareNextVersionAlpha (in category 'preparing') -----
- prepareNextVersionAlpha
- "Prepare the first alpha image for next release."
-
- self
- setTopProject;
- prepareSourceCode;
- prepareEnvironment;
- switchToNewRepository: self buildRepository.
-
- SystemVersion newVersion: self versionStringAlpha.!

Item was added:
+ ----- Method: ReleaseBuilder class>>releaseLocally (in category 'accessing') -----
+ releaseLocally
+ "If true, use a local, directory-based repository. Usually in the working directory."
+
+ ^ true!

Item was changed:
  ----- Method: ReleaseBuilder class>>releaseRepository (in category 'accessing') -----
  releaseRepository
 
+ (MCRepositoryGroup default repositories
+ detect: [:repo | repo description = self releaseRepositoryUrl]
+ ifNone: [MCRepository location: self releaseRepositoryUrl])
+ in: [:repo |
+ MCRepositoryGroup default addRepository: repo.
+ (self assureReleaseRepositoryReadAccess: repo)
+ ifFalse: [ReleaseBuilderFailed signal: 'Could not build the release.'].
+ ^ repo]!
- ^ (MCRepository location: self releaseRepositoryUrl) in: [:repo |
- self localBuild ifFalse: [
- repo
- user: (UIManager default
- request: 'Enter user for ', self releaseRepositoryUrl
- initialAnswer: Utilities authorInitials);
- password: (UIManager default
- requestPassword: 'Enter password for ' , self releaseRepositoryUrl)].
- repo].!

Item was added:
+ ----- Method: ReleaseBuilder class>>releaseRepositoryName (in category 'accessing') -----
+ releaseRepositoryName
+
+ ^ (self versionString copyWithout: $.) asLowercase!

Item was changed:
  ----- Method: ReleaseBuilder class>>releaseRepositoryUrl (in category 'accessing') -----
  releaseRepositoryUrl
 
+ ^ self releaseLocally
+ ifFalse: [self serverUrl, '/', self releaseRepositoryName]
+ ifTrue: [(FileDirectory default on: 'repositories', FileDirectory slash, self releaseRepositoryName) fullName]!
- ^ self localBuild
- ifFalse: [(self serverUrl, '/', (self versionString copyWithout: $.)) asLowercase]
- ifTrue: [(FileDirectory default on: 'repositories', FileDirectory slash, (self versionString copyWithout: $.) asLowercase)
- assureExistence;
- fullName]!

Item was changed:
  ----- Method: ReleaseBuilder class>>releaseVersionMajor (in category 'accessing') -----
  releaseVersionMajor
 
+ ^ NextMajorVersion ifNil: [5]!
- ^ 5!

Item was changed:
  ----- Method: ReleaseBuilder class>>releaseVersionMinor (in category 'accessing') -----
  releaseVersionMinor
 
+ ^ NextMinorVersion ifNil: [1]!
- ^ 1!

Item was added:
+ ----- Method: ReleaseBuilder class>>requestNextReleaseVersion (in category 'manual - steps') -----
+ requestNextReleaseVersion
+ "self requestNextReleaseVersion"
+
+ | nextMinor nextMajor current |
+ current := {
+ SystemVersion current majorVersionNumber.
+ SystemVersion current minorVersionNumber}.
+ nextMinor := {
+ current first.
+ current second + 1}.
+ nextMajor := {
+ current first + 1.
+ 0}.
+
+ (UIManager default
+ chooseFrom: {
+ '{1}.{2}' format: {nextMinor first. nextMinor second}.
+ '{1}.{2}' format: {nextMajor first. nextMajor second}}
+ title: 'Please Choose Next Version') in: [:answer |
+ answer ifNil: [^ false].
+ answer = 1 ifTrue: [
+ NextMinorVersion := nextMinor second].
+ answer = 2 ifTrue: [
+ NextMajorVersion := nextMajor first.
+ NextMinorVersion := 0]].
+
+ ^ true!

Item was removed:
- ----- 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 condenseChanges.
- Smalltalk snapshot: true "Important!!" andQuit: true.!

Item was added:
+ ----- Method: ReleaseBuilder class>>saveAsNewTrunk (in category 'saving') -----
+ saveAsNewTrunk
+ "Use this to create a new trunk image to be used by smalltalkCI."
+
+ | fileName |
+ fileName := ('squeak-trunk{1}' format: {
+ self releaseLocally ifTrue: ['-offline'] ifFalse: ['']}).
+
+ [ self
+ setTopProject;
+ prepareSourceCode;
+ prepareEnvironment;
+ switchToNewRepository: self buildRepository.
+ ] on: MCEmptyVersion do: [:warning | warning resume].
+
+ Smalltalk saveAs: fileName.
+
+ Smalltalk condenseChanges.
+ Smalltalk snapshot: true "Important!!" andQuit: true.!

Item was removed:
- ----- 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 condenseChanges.
- Smalltalk snapshot: true "Important!!" andQuit: true.!

Item was added:
+ ----- Method: ReleaseBuilder class>>setNewSystemVersion: (in category 'manual') -----
+ setNewSystemVersion: version
+
+ self class
+ compile: ('initialize
+ Smalltalk addToStartUpList: self.
+
+ SystemVersion newVersion: ''{1}''.' format: {version})
+ classified: 'class initialization'.
+
+ self initialize.!

Item was changed:
  ----- Method: ReleaseBuilder class>>setPreferences (in category 'scripts') -----
  setPreferences
  "Preferences class defaultValueTableForCurrentRelease"
 
  " Preferences outOfTheBox."  "<-- uncomment after #defaultValueTableForCurrentRelease is fixed up."
 
  "General User interaction"
  Preferences
  enable: #generalizedYellowButtonMenu ;
  enable: #swapMouseButtons;
  disable: #mouseOverForKeyboardFocus.
  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.
  SystemWindow windowsActiveOnlyOnTop: true.
  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.
  SystemWindow roundedWindowCorners: false.
  PluggableButtonMorph roundedButtonCorners: false.
  FillInTheBlankMorph roundedDialogCorners: false.
  MenuMorph roundedMenuCorners: false.
  ScrollBar roundedScrollBarLook: false.
 
  "Gradients."
  ScrollBar gradientScrollBar: false.
  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).
  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 added:
+ ----- Method: ReleaseBuilder class>>startUp: (in category 'class initialization') -----
+ startUp: resuming
+ resuming
+ ifTrue: [DeferredTask ifNotNil: [:task | DeferredTask := nil. task value]. NextTask := nil]
+ ifFalse: [NextTask ifNotNil: [:task | NextTask := nil. task value]. DeferredTask := nil].!

Item was added:
+ ----- Method: ReleaseBuilder class>>step0AssureAlpha (in category 'manual - steps') -----
+ step0AssureAlpha
+
+ self requestNextReleaseVersion ifFalse: [^ self].
+ self setNewSystemVersion: self versionString, 'alpha'.!

Item was added:
+ ----- Method: ReleaseBuilder class>>step1FeatureFreeze (in category 'manual - steps') -----
+ step1FeatureFreeze
+
+ (UIManager default
+ confirm: ('Do you really want to feature-freeze the trunk\in preparation for the next release {1}?\Bugfixes only after this.' withCRs format: {self versionString})
+ title: 'Release Builder Step 1 of 4: Feature Freeze') ifFalse: [^ self].
+
+ self setNewSystemVersion: self versionString, 'beta'.!

Item was added:
+ ----- Method: ReleaseBuilder class>>step2CodeFreeze (in category 'manual - steps') -----
+ step2CodeFreeze
+ "Creates the first release candidate."
+
+ (UIManager default
+ confirm: ('Do you really want to code-freeze the trunk\in preparation for the next release {1}?\Urgent fixes only after this.' withCRs format: {self versionString})
+ title: 'Release Builder Step 2 of 4: Code Freeze') ifFalse: [^ self].
+
+ self setNewSystemVersion: self versionString, 'rc', (SystemVersion current releaseCandidateNumber + 1) asString.!

Item was added:
+ ----- Method: ReleaseBuilder class>>step3NextReleaseCandidate (in category 'manual - steps') -----
+ step3NextReleaseCandidate
+ "Creates additional release candidates."
+ "update version, update post load script, add stuff commit"
+
+ (UIManager default
+ confirm: ('Do you want create another release candidate\for the next release {1}?\Urgent fixes still possible.' withCRs format: {self versionString})
+ title: 'Release Builder Step 3 of 4: Release Candidate') ifFalse: [^ self].
+
+ self setNewSystemVersion: self versionString, 'rc', (SystemVersion current releaseCandidateNumber + 1) asString.!

Item was added:
+ ----- Method: ReleaseBuilder class>>step4Release (in category 'manual - steps') -----
+ step4Release
+ "Creates the release. New file, clean-ed up."
+
+ | fileName |
+ (UIManager default
+ confirm: ('Do you want release {1}{2}?' withCRs format: {
+ self versionString.
+ (self releaseLocally ifTrue: [' locally'] ifFalse: [''])})
+ title: 'Release Builder Step 4 of 4: The Release')
+ ifFalse: [^ self].
+
+ "If you re-open the current trunk image again, it will be an alpha version for the next release."
+ DeferredTask := [self step0AssureAlpha].
+ Smalltalk snapshot: true andQuit: false.
+
+ "Create new .image and .changes files for the release image."
+ self setNewSystemVersion: self versionString.
+ fileName := ('squeak-{1}.{2}{3}' format: {
+ SystemVersion current majorVersionNumber.
+ SystemVersion current minorVersionNumber.
+ self releaseLocally ifTrue: ['-offline'] ifFalse: ['']}).
+ Smalltalk saveAs: fileName.
+
+ "Update the image state."
+ [ self
+ setTopProject;
+ prepareSourceCode;
+ prepareEnvironment;
+ switchToNewRepository: self releaseRepository.
+ ] on: MCEmptyVersion do: [:warning | warning resume].
+
+ NextTask := [self uploadForSmalltalkCI: fileName.].
+
+ Smalltalk condenseChanges.
+ Smalltalk snapshot: true "Important!!" andQuit: false.!

Item was added:
+ ----- Method: ReleaseBuilder class>>uploadForSmalltalkCI: (in category 'manual') -----
+ uploadForSmalltalkCI: fileName
+ "TODO Automate upload."
+
+ self releaseLocally ifTrue: [
+ ^ UserDialogBoxMorph
+ inform: ('Please do never upload images that are meant to be used locally.')
+ title: 'Release Builder - Local Release Finished'.].
+
+ UserDialogBoxMorph
+ inform: ('Please upload {1] and {2} to files.squeak.org/smalltalkCI' format: {fileName, '.image'. fileName, '.changes'})
+ title: 'Release Builder - Almost Done'.!

Item was added:
+ Error subclass: #ReleaseBuilderFailed
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'ReleaseBuilder'!