Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add MetacelloMCBaselineProject to hold the singleton baseline version

for the BaelineOf
  • Loading branch information...
commit dda8c34bb69a15a27b7ae8754ee06bc36f824dea 1 parent fab7ed5
Dale Henrichs authored
Showing with 192 additions and 26 deletions.
  1. +8 −7 repository/Metacello-Core.package/MetacelloBaselineConstructor.class/instance/on..st
  2. +3 −0  repository/Metacello-Core.package/MetacelloBaselineConstructor.class/instance/projectClass.st
  3. +2 −1  repository/Metacello-Core.package/MetacelloProject.class/instance/errorMap..st
  4. +7 −0 repository/Metacello-Core.package/MetacelloScriptEngine.class/class/baselineNameFrom..st
  5. +10 −0 repository/Metacello-Core.package/MetacelloScriptEngine.class/instance/getBaselineUnconditionalLoad..st
  6. +21 −0 repository/Metacello-Core.package/MetacelloScriptEngine.class/instance/lookupBaselineGofer..st
  7. +13 −0 repository/Metacello-Core.package/MetacelloScriptEngine.class/instance/lookupBaselinePackageSpecFrom..st
  8. +6 −0 repository/Metacello-Core.package/MetacelloScriptEngine.class/instance/projectBaselinePackageSpec.st
  9. +2 −2 repository/Metacello-Core.package/monticello.meta/version
  10. +3 −3 repository/Metacello-MC.package/MetacelloAbstractVersionConstructor.extension/instance/project.st
  11. +3 −0  repository/Metacello-MC.package/MetacelloAbstractVersionConstructor.extension/instance/projectClass.st
  12. +21 −0 repository/Metacello-MC.package/MetacelloMCBaselineProject.class/README.md
  13. +3 −0  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/class/projectFrom.unconditionalLoad..st
  14. +5 −0 repository/Metacello-MC.package/MetacelloMCBaselineProject.class/class/versionFrom..st
  15. +3 −0  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/bleedingEdge.st
  16. +3 −0  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/currentVersion.st
  17. +3 −0  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/currentVersionAgainst..st
  18. +3 −0  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/development.st
  19. +3 −0  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/hasVersion..st
  20. +3 −0  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/lastVersion.st
  21. +3 −0  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/latestVersion..st
  22. +3 −0  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/latestVersion.st
  23. +3 −0  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/latestVersionMatching..st
  24. +3 −0  .../Metacello-MC.package/MetacelloMCBaselineProject.class/instance/latestVersionMatching.excludedBlessings..st
  25. +3 −0  .../Metacello-MC.package/MetacelloMCBaselineProject.class/instance/latestVersionMatching.includedBlessings..st
  26. +3 −0  ...age/MetacelloMCBaselineProject.class/instance/latestVersionMatching.includedBlessings.excludedBlessings..st
  27. +5 −0 repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/projectReferenceSpec.st
  28. +3 −0  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/singletonVersionName.st
  29. +3 −0  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/stableVersion.st
  30. +3 −0  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/symbolicVersionSymbols.st
  31. +3 −0  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/version.st
  32. +3 −0  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/versions.st
  33. +16 −0 repository/Metacello-MC.package/MetacelloMCBaselineProject.class/properties.json
  34. +2 −2 repository/Metacello-MC.package/monticello.meta/version
  35. +9 −9 repository/Metacello-TestsMC.package/MetacelloBaselineConfigurationTestCase.class/instance/testConstructor.st
  36. +2 −2 repository/Metacello-TestsMC.package/monticello.meta/version
View
15 repository/Metacello-Core.package/MetacelloBaselineConstructor.class/instance/on..st
@@ -1,9 +1,10 @@
initialization
on: aBaselineConfigurationClass
- | pragma |
- self configuration: aBaselineConfigurationClass new.
- pragma := self extractBaselinePragmaFor: aBaselineConfigurationClass.
- project := MetacelloMCProject new.
- self root: project versionSpec.
- self evaluatePragma: pragma.
- ^ self root
+ | pragma versionMap |
+ self configuration: aBaselineConfigurationClass new.
+ pragma := self extractBaselinePragmaFor: aBaselineConfigurationClass.
+ self root: self project versionSpec.
+ self evaluatePragma: pragma.
+ versionMap := Dictionary new.
+ versionMap at: self project singletonVersionName put: self root createVersion.
+ self project map: versionMap
View
3  repository/Metacello-Core.package/MetacelloBaselineConstructor.class/instance/projectClass.st
@@ -0,0 +1,3 @@
+accessing
+projectClass
+ ^ MetacelloMCBaselineProject
View
3  repository/Metacello-Core.package/MetacelloProject.class/instance/errorMap..st
@@ -1,3 +1,4 @@
accessing
errorMap: anObject
- errorMap := anObject
+ errorMap ifNil: [ errorMap := Dictionary new ].
+ errorMap := anObject
View
7 repository/Metacello-Core.package/MetacelloScriptEngine.class/class/baselineNameFrom..st
@@ -0,0 +1,7 @@
+utility
+baselineNameFrom: baseName
+ "Return the fully-qualified configuration class name."
+
+ ^ (baseName indexOfSubCollection: 'BaselineOf') > 0
+ ifTrue: [ baseName ]
+ ifFalse: [ 'BaselineOf' , baseName ]
View
10 repository/Metacello-Core.package/MetacelloScriptEngine.class/instance/getBaselineUnconditionalLoad..st
@@ -0,0 +1,10 @@
+project lookup
+getBaselineUnconditionalLoad: unconditionalLoad
+ | packageSpec |
+ Smalltalk
+ at: self projectBaselinePackageSpec file asSymbol
+ ifPresent: [ :cl |
+ unconditionalLoad
+ ifFalse: [ ^ cl ] ].
+ (packageSpec := self lookupBaselinePackageSpecFrom: self projectBaselinePackageSpec) load.
+ ^ Smalltalk at: packageSpec file asSymbol
View
21 repository/Metacello-Core.package/MetacelloScriptEngine.class/instance/lookupBaselineGofer..st
@@ -0,0 +1,21 @@
+project lookup
+lookupBaselineGofer: baselineName
+ | pkgRef cachedGofer references gf description |
+ pkgRef := GoferPackageReference name: baselineName.
+ description := self repositoryDescription.
+ cachedGofer := self goferCache
+ at: description
+ ifAbsent: [
+ "leverage resolvedReferencesCache in gofer instance, so we don't have to keep reading from network"
+ gf := Gofer new.
+ gf disablePackageCache.
+ gf
+ repository:
+ (self repositorySpec
+ description: description;
+ yourself) createRepository.
+ self goferCache at: description put: gf.
+ gf ].
+ (pkgRef resolveAllWith: cachedGofer) notEmpty
+ ifTrue: [ ^ cachedGofer ].
+ ^ nil
View
13 repository/Metacello-Core.package/MetacelloScriptEngine.class/instance/lookupBaselinePackageSpecFrom..st
@@ -0,0 +1,13 @@
+project lookup
+lookupBaselinePackageSpecFrom: aPackageSpec
+ | baselineGofer packageSpec |
+ true
+ ifTrue: [
+ "this is all about looking things up from the repository path ... and I've decide that the path isn't useful at the moment"
+ ^ aPackageSpec ].
+ (baselineGofer := self lookupBaselineGofer: aPackageSpec file) ifNil: [ ^ aPackageSpec ].
+ packageSpec := aPackageSpec copy
+ repositories: nil;
+ yourself.
+ baselineGofer repositories do: [ :repo | packageSpec repository: (repo asRepositorySpecFor: packageSpec project) ].
+ ^ packageSpec
View
6 repository/Metacello-Core.package/MetacelloScriptEngine.class/instance/projectBaselinePackageSpec.st
@@ -0,0 +1,6 @@
+private
+projectBaselinePackageSpec
+ ^ (projectClass ifNil: [ MetacelloMCProject ]) new packageSpec
+ name: (self class baselineNameFrom: self projectName);
+ repository: self repositorySpec;
+ yourself
View
4 repository/Metacello-Core.package/monticello.meta/version
2 additions, 2 deletions not shown
View
6 repository/Metacello-MC.package/MetacelloAbstractVersionConstructor.extension/instance/project.st
@@ -1,5 +1,5 @@
*metacello-mc-accessing
project
-
- project == nil ifTrue: [ project := MetacelloMCProject new].
- ^project
+ project == nil
+ ifTrue: [ project := self projectClass new ].
+ ^ project
View
3  repository/Metacello-MC.package/MetacelloAbstractVersionConstructor.extension/instance/projectClass.st
@@ -0,0 +1,3 @@
+*metacello-mc-accessing
+projectClass
+ ^ MetacelloMCProject
View
21 repository/Metacello-MC.package/MetacelloMCBaselineProject.class/README.md
@@ -0,0 +1,21 @@
+The **MetacelloMCBaselineProject** is a wrapper for the **BaselineOf **version specification for file-based repositories.
+
+There is a single version in a **MetacelloMCBaselineProject**, named *'baseline'*.
+
+A **BaselineOf** is specified like the following:
+
+```Smalltalk
+baseline: spec
+ <baseline>
+ spec
+ package: 'External-Core';
+ package: 'External-Tests' with: [ spec requires: 'External-Core' ];
+ yourself.
+ spec
+ group: 'Core' with: #('External-Core');
+ group: 'default' with: #('Core');
+ group: 'Tests' with: #('External-Tests');
+ yourself
+```
+
+The `<baseline>` pragma marks the method containing the baseline specification.
View
3  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/class/projectFrom.unconditionalLoad..st
@@ -0,0 +1,3 @@
+scripting
+projectFrom: aScriptingEngine unconditionalLoad: aBool
+ ^ (aScriptingEngine getBaselineUnconditionalLoad: aBool) project
View
5 repository/Metacello-MC.package/MetacelloMCBaselineProject.class/class/versionFrom..st
@@ -0,0 +1,5 @@
+scripting
+versionFrom: aScriptingEngine
+ aScriptingEngine versionString ~~ nil
+ ifTrue: [ ^ super versionFrom: aScriptingEngine ].
+ ^ (self projectFrom: aScriptingEngine) version: 'baseline'
View
3  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/bleedingEdge.st
@@ -0,0 +1,3 @@
+versions
+bleedingEdge
+ ^ nil
View
3  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/currentVersion.st
@@ -0,0 +1,3 @@
+versions
+currentVersion
+ ^ nil
View
3  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/currentVersionAgainst..st
@@ -0,0 +1,3 @@
+versions
+currentVersionAgainst: resolvedPackageAndProjectNames
+ ^ nil
View
3  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/development.st
@@ -0,0 +1,3 @@
+versions
+development
+ ^ nil
View
3  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/hasVersion..st
@@ -0,0 +1,3 @@
+versions
+hasVersion: versionString
+ ^ versionString = 'baseline'
View
3  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/lastVersion.st
@@ -0,0 +1,3 @@
+versions
+lastVersion
+ ^ self version
View
3  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/latestVersion..st
@@ -0,0 +1,3 @@
+versions
+latestVersion: blessing
+ ^ nil
View
3  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/latestVersion.st
@@ -0,0 +1,3 @@
+versions
+latestVersion
+ ^ self version
View
3  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/latestVersionMatching..st
@@ -0,0 +1,3 @@
+versions
+latestVersionMatching: versionPatternString
+ ^ nil
View
3  ...tacello-MC.package/MetacelloMCBaselineProject.class/instance/latestVersionMatching.excludedBlessings..st
@@ -0,0 +1,3 @@
+versions
+latestVersionMatching: versionPatternString excludedBlessings: excluded
+ ^ nil
View
3  ...tacello-MC.package/MetacelloMCBaselineProject.class/instance/latestVersionMatching.includedBlessings..st
@@ -0,0 +1,3 @@
+versions
+latestVersionMatching: versionPatternString includedBlessings: included
+ ^ nil
View
3  .../MetacelloMCBaselineProject.class/instance/latestVersionMatching.includedBlessings.excludedBlessings..st
@@ -0,0 +1,3 @@
+versions
+latestVersionMatching: versionPatternString includedBlessings: included excludedBlessings: excludedBlessings
+ ^ nil
View
5 repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/projectReferenceSpec.st
@@ -0,0 +1,5 @@
+spec classes
+projectReferenceSpec
+ ^ super projectReferenceSpec
+ projectReference: self projectSpec;
+ yourself
View
3  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/singletonVersionName.st
@@ -0,0 +1,3 @@
+versions
+singletonVersionName
+ ^ 'baseline'
View
3  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/stableVersion.st
@@ -0,0 +1,3 @@
+versions
+stableVersion
+ ^ nil
View
3  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/symbolicVersionSymbols.st
@@ -0,0 +1,3 @@
+versions
+symbolicVersionSymbols
+ ^ nil
View
3  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/version.st
@@ -0,0 +1,3 @@
+versions
+version
+ ^ self version: self singletonVersionName
View
3  repository/Metacello-MC.package/MetacelloMCBaselineProject.class/instance/versions.st
@@ -0,0 +1,3 @@
+versions
+versions
+ ^ {(self version)}
View
16 repository/Metacello-MC.package/MetacelloMCBaselineProject.class/properties.json
@@ -0,0 +1,16 @@
+{
+ "category" : "Metacello-MC-Model",
+ "classinstvars" : [
+ ],
+ "classtraitcomposition" : "{}",
+ "classvars" : [
+ ],
+ "commentStamp" : "dkh 5/5/2012 08:47",
+ "instvars" : [
+ ],
+ "name" : "MetacelloMCBaselineProject",
+ "pools" : [
+ ],
+ "super" : "MetacelloMCProject",
+ "traitcomposition" : "{}",
+ "type" : "normal" }
View
4 repository/Metacello-MC.package/monticello.meta/version
2 additions, 2 deletions not shown
View
18 ...itory/Metacello-TestsMC.package/MetacelloBaselineConfigurationTestCase.class/instance/testConstructor.st
@@ -1,13 +1,13 @@
tests
testConstructor
- | version expected repo |
- repo := MetacelloScriptingResource current externalRepository.
- Gofer new
- repository: repo;
- package: 'BaselineOfExternalX';
- load.
- version := (MetacelloBaselineConstructor on: (Smalltalk at: #BaselineOfExternalX)) root.
- expected := 'spec
+ | version expected repo constructor |
+ repo := MetacelloScriptingResource current externalRepository.
+ Gofer new
+ repository: repo;
+ package: 'BaselineOfExternalX';
+ load.
+ version := (constructor := MetacelloBaselineConstructor on: (Smalltalk at: #BaselineOfExternalX)) project version.
+ expected := 'spec
package: ''External-Core'';
package: ''External-Tests'' with: [
spec requires: #(''External-Core'' ). ].
@@ -15,4 +15,4 @@ spec
group: ''Core'' with: #(''External-Core'' );
group: ''default'' with: #(''Core'' );
group: ''Tests'' with: #(''External-Tests'' ).'.
- self assert: version printString = expected
+ self assert: version versionSpec printString = expected
View
4 repository/Metacello-TestsMC.package/monticello.meta/version
2 additions, 2 deletions not shown
Please sign in to comment.
Something went wrong with that request. Please try again.