|
| 1 | +Extension { #name : 'RwRowanSample12TestProjectLibraryGenerator' } |
| 2 | + |
| 3 | +{ #category : '*rowan-testsv4' } |
| 4 | +RwRowanSample12TestProjectLibraryGenerator >> _addDefinitionsFor_0007: resolvedProject [ |
| 5 | + "Start with spec_0000. The class RowanSample12ConcreteClass1 has a superclass AbstractRowanSample9V4BridgeClass1 from the project RowanSample9. This project requires RowanSample9V4:spec_0069. The method #foo is defined in RowanSample12ConcreteClass1." |
| 6 | + |
| 7 | + | className packageName requiredLoadSpec requiredSpecName requiredProjectName componentName requiredRevision requiredComponentName | |
| 8 | + componentName := 'Core'. |
| 9 | + packageName := projectName , '-' , componentName. |
| 10 | + className := projectName , 'ConcreteClass1'. |
| 11 | + requiredProjectName := 'RowanSample9V4'. |
| 12 | + requiredComponentName := 'Bridge'. |
| 13 | + requiredSpecName := requiredProjectName , '_' , requiredComponentName. |
| 14 | + requiredRevision := 'spec_0069'. |
| 15 | + |
| 16 | + resolvedProject |
| 17 | + addPackagesNamed: {packageName} toComponentNamed: componentName; |
| 18 | + removeComponentNames: {'Tests'}; |
| 19 | + removeComponentNamed: 'tests/Tests'; |
| 20 | + yourself. |
| 21 | + (resolvedProject componentNamed: componentName) |
| 22 | + addProjectNamed: requiredSpecName. |
| 23 | + ((resolvedProject packageNamed: packageName) |
| 24 | + addClassNamed: className |
| 25 | + super: 'Abstract', requiredProjectName, 'BridgeClass1' |
| 26 | + instvars: #() |
| 27 | + category: packageName |
| 28 | + comment: 'I am an example class') |
| 29 | + addInstanceMethod: 'foo ^1' protocol: 'accessing'; |
| 30 | + yourself. |
| 31 | + |
| 32 | + resolvedProject projectsRoot ensureCreateDirectory. |
| 33 | + requiredLoadSpec := RwLoadSpecificationV2 new |
| 34 | + specName: requiredSpecName; |
| 35 | + projectName: requiredProjectName; |
| 36 | + revision: requiredRevision; |
| 37 | + gitUrl: '[email protected]:dalehenrich/' , requiredProjectName , '.git'; |
| 38 | + componentNames: {requiredComponentName}; |
| 39 | + customConditionalAttributes: {'tests'}; |
| 40 | + gemstoneSetDefaultSymbolDictNameTo: RwRowanSample12Test _sampleSymbolDictionaryName1; |
| 41 | + yourself. |
| 42 | + requiredLoadSpec exportTo: resolvedProject projectsRoot. |
| 43 | + |
| 44 | + ^ resolvedProject |
| 45 | +] |
| 46 | + |
| 47 | +{ #category : '*rowan-testsv4' } |
| 48 | +RwRowanSample12TestProjectLibraryGenerator >> _addDefinitionsFor_0008: resolvedProject [ |
| 49 | + "Start with spec_0000. The class RowanSample12ConcreteClass1 subclasses AbstractRowanSample9V4ParentClass1 in RowanSample9V4:spec_0069, component Parent. RowanSample9V4. RowanSample9V4:spec_0069 componant Parent has the test. This spec requires RowanSample9V4:spec_0069." |
| 50 | + |
| 51 | + | className packageName requiredLoadSpec requiredSpecName requiredProjectName componentName requiredRevision requiredComponentName | |
| 52 | + componentName := 'Core'. |
| 53 | + packageName := projectName , '-' , componentName. |
| 54 | + className := projectName , 'ConcreteClass1'. |
| 55 | + requiredProjectName := 'RowanSample9V4'. |
| 56 | + requiredComponentName := 'Parent'. |
| 57 | + requiredSpecName := requiredProjectName , '_' , requiredComponentName. |
| 58 | + requiredRevision := 'spec_0069'. |
| 59 | + |
| 60 | + resolvedProject |
| 61 | + addPackagesNamed: {packageName} toComponentNamed: componentName; |
| 62 | + removeComponentNames: {'Tests'}; |
| 63 | + removeComponentNamed: 'tests/Tests'; |
| 64 | + yourself. |
| 65 | + (resolvedProject componentNamed: componentName) |
| 66 | + addProjectNamed: requiredSpecName. |
| 67 | + ((resolvedProject packageNamed: packageName) |
| 68 | + addClassNamed: className |
| 69 | + super: 'Abstract', requiredProjectName, 'ParentClass1' |
| 70 | + instvars: #() |
| 71 | + category: packageName |
| 72 | + comment: 'I am an example class') |
| 73 | + addInstanceMethod: 'foo ^1' protocol: 'accessing'; |
| 74 | + yourself. |
| 75 | + |
| 76 | + resolvedProject projectsRoot ensureCreateDirectory. |
| 77 | + requiredLoadSpec := RwLoadSpecificationV2 new |
| 78 | + specName: requiredSpecName; |
| 79 | + projectName: requiredProjectName; |
| 80 | + revision: requiredRevision; |
| 81 | + gitUrl: '[email protected]:dalehenrich/' , requiredProjectName , '.git'; |
| 82 | + componentNames: {requiredComponentName}; |
| 83 | + customConditionalAttributes: {'tests'}; |
| 84 | + gemstoneSetDefaultSymbolDictNameTo: RwRowanSample12Test _sampleSymbolDictionaryName1; |
| 85 | + yourself. |
| 86 | + requiredLoadSpec exportTo: resolvedProject projectsRoot. |
| 87 | + |
| 88 | + ^ resolvedProject |
| 89 | +] |
| 90 | + |
| 91 | +{ #category : '*rowan-testsv4' } |
| 92 | +RwRowanSample12TestProjectLibraryGenerator >> genSpec_0007: commitMessage [ |
| 93 | + "Start with spec_0000. The class RowanSample12ConcreteClass1 has a superclass AbstractRowanSample9BridgeClass1 from the project RowanSample9V4. This project requires RowanSample9V4:spec_0069. The method #foo is defined in RowanSample12ConcreteClass1. Based on spec_0006" |
| 94 | + |
| 95 | + "https://github.com/GemTalk/Rowan/issues/705" |
| 96 | + |
| 97 | + "The method is idempotent with respect to the branches involved, UNLESS something |
| 98 | + has explicitly changed within the model or the disk format of artefacts." |
| 99 | + |
| 100 | + | indexCard definedProject resolvedRepository specName postfix derivedFrom title | |
| 101 | + postfix := '0007'. |
| 102 | + specName := 'spec_' , postfix. |
| 103 | + derivedFrom := 'spec_0000'. |
| 104 | + title := 'Start with spec_0000. The class RowanSample12ConcreteClass1 has a superclass AbstractRowanSample9BridgeClass1 from the project RowanSample9V4. This project requires RowanSample9V4:spec_0069. The method #foo is defined in RowanSample12ConcreteClass1. Based on spec_0006'. |
| 105 | + |
| 106 | + indexCard := (self |
| 107 | + _createCard: postfix |
| 108 | + specName: specName |
| 109 | + title: title |
| 110 | + index: 7 |
| 111 | + derivedFrom: derivedFrom |
| 112 | + comment: 'jigsaw puzzle class relationships') |
| 113 | + rowanIssues: #(705); |
| 114 | + yourself. |
| 115 | + definedProject := (self _createDefinedProject: self projectName) |
| 116 | + specName: specName; |
| 117 | + revision: derivedFrom; |
| 118 | + gitUrl: self projectUrl; |
| 119 | + specComponentNames: {'Core'}; |
| 120 | + customConditionalAttributes: {}; |
| 121 | + packageConvention: 'Rowan'; |
| 122 | + comment: title; |
| 123 | + gemstoneSetDefaultSymbolDictNameTo: self _sampleSymbolDictionaryName1; |
| 124 | + yourself. |
| 125 | + |
| 126 | + resolvedRepository := self |
| 127 | + _genSpecFor: specName |
| 128 | + definedProject: definedProject |
| 129 | + addDefinitions: [ :resolvedProject | self _addDefinitionsFor_0007: resolvedProject ]. |
| 130 | + |
| 131 | + self |
| 132 | + _finishCommitAndPush: specName |
| 133 | + loadSpecification: resolvedRepository loadSpecification |
| 134 | + indexCard: indexCard |
| 135 | + derivedFrom: (derivedFrom copyReplaceAll: 'spec' with: 'index') |
| 136 | + resolvedRepository: resolvedRepository |
| 137 | + commitMessage: commitMessage |
| 138 | +] |
| 139 | + |
| 140 | +{ #category : '*rowan-testsv4' } |
| 141 | +RwRowanSample12TestProjectLibraryGenerator >> genSpec_0008: commitMessage [ |
| 142 | + "Start with spec_0000. The class RowanSample12ConcreteClass1 subclasses AbstractRowanSample9ParentClass1 in RowanSample9:spec_0069, component Parent. RowanSample9V4. RowanSample9V4:spec_0069 componant Parent has the test. This spec requires RowanSample9V4:spec_0069. Based on spec_0005" |
| 143 | + |
| 144 | + "https://github.com/GemTalk/Rowan/issues/705" |
| 145 | + |
| 146 | + "The method is idempotent with respect to the branches involved, UNLESS something |
| 147 | + has explicitly changed within the model or the disk format of artefacts." |
| 148 | + |
| 149 | + | indexCard definedProject resolvedRepository specName postfix derivedFrom title | |
| 150 | + postfix := '0008'. |
| 151 | + specName := 'spec_' , postfix. |
| 152 | + derivedFrom := 'spec_0000'. |
| 153 | + title := 'Start with spec_0000. The class RowanSample12ConcreteClass1 subclasses AbstractRowanSample9ParentClass1 in RowanSample9:spec_0069, component Parent. RowanSample9V4. RowanSample9V4:spec_0069 componant Parent has the test. This spec requires RowanSample9V4:spec_0069. Based on spec_0005'. |
| 154 | + |
| 155 | + indexCard := (self |
| 156 | + _createCard: postfix |
| 157 | + specName: specName |
| 158 | + title: title |
| 159 | + index: 5 |
| 160 | + derivedFrom: derivedFrom |
| 161 | + comment: 'jigsaw puzzle class relationships') |
| 162 | + rowanIssues: #(705); |
| 163 | + yourself. |
| 164 | + definedProject := (self _createDefinedProject: self projectName) |
| 165 | + specName: specName; |
| 166 | + revision: derivedFrom; |
| 167 | + gitUrl: self projectUrl; |
| 168 | + specComponentNames: {'Core'}; |
| 169 | + customConditionalAttributes: {}; |
| 170 | + packageConvention: 'Rowan'; |
| 171 | + comment: title; |
| 172 | + yourself. |
| 173 | + |
| 174 | + resolvedRepository := self |
| 175 | + _genSpecFor: specName |
| 176 | + definedProject: definedProject |
| 177 | + addDefinitions: [ :resolvedProject | self _addDefinitionsFor_0005: resolvedProject ]. |
| 178 | + |
| 179 | + self |
| 180 | + _finishCommitAndPush: specName |
| 181 | + loadSpecification: resolvedRepository loadSpecification |
| 182 | + indexCard: indexCard |
| 183 | + derivedFrom: (derivedFrom copyReplaceAll: 'spec' with: 'index') |
| 184 | + resolvedRepository: resolvedRepository |
| 185 | + commitMessage: commitMessage |
| 186 | +] |
0 commit comments