Skip to content

Commit

Permalink
Merge branch 'development' into improve-UMLDocumentor-RoassalBackend
Browse files Browse the repository at this point in the history
  • Loading branch information
jecisc authored Jun 11, 2024
2 parents 0c383d0 + 5eddf95 commit 00423c8
Show file tree
Hide file tree
Showing 14 changed files with 317 additions and 16 deletions.
10 changes: 10 additions & 0 deletions src/Famix-MetamodelBuilder-Core/FamixMetamodelGenerator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ FamixMetamodelGenerator class >> composedMetaModels [
^ self allSubclasses select: [ :mm | mm isAbstract not and: [ mm isComposed ] ]
]

{ #category : #generation }
FamixMetamodelGenerator class >> deleteMetaModel [
<script>
<ignoreForCoverage>

"Remove the package that was generated by this generator.
This is used to cleanup existing code and testing"
self packageName asPackage removeFromSystem
]

{ #category : #generation }
FamixMetamodelGenerator class >> generate [
<script>
Expand Down
6 changes: 6 additions & 0 deletions src/Famix-MetamodelBuilder-Core/FmxClassRemoval.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ FmxClassRemoval >> classToRemove: anObject [
class := anObject
]

{ #category : #testing }
FmxClassRemoval >> isRemoval [

^ true
]

{ #category : #printing }
FmxClassRemoval >> printOn: aStream [

Expand Down
6 changes: 6 additions & 0 deletions src/Famix-MetamodelBuilder-Core/FmxCodeChange.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ FmxCodeChange class >> isAbstract [
FmxCodeChange >> apply [
self subclassResponsibility
]

{ #category : #testing }
FmxCodeChange >> isRemoval [

^ false
]
57 changes: 41 additions & 16 deletions src/Famix-MetamodelBuilder-Core/FmxMBRealRingEnvironment.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ Class {

{ #category : #accessing }
FmxMBRealRingEnvironment >> apply [

self collectChangesToApply.
changesToApply do: #apply
changesToApply select: [ :e | e isRemoval ] thenDo: #apply.
changesToApply select: [ :e | e isRemoval not ] thenDo: #apply
]

{ #category : #testing }
Expand Down Expand Up @@ -41,25 +43,48 @@ FmxMBRealRingEnvironment >> compile: aSource in: aClass classified: aProtocol pa
]

{ #category : #installing }
FmxMBRealRingEnvironment >> recordAdoptionOfClassDefinitionFrom: realClass to: anRGClass [
FmxMBRealRingEnvironment >> recordAdoptionOfClassDefinitionFrom: currentClass to: anRGClassModel [

| currentCustomSlots currentCustomSlotNames modelSlotDefinitions currentGeneratedSlots modelGeneratedSlots slotRemovals |
(currentClass needToAdaptTo: anRGClassModel) ifFalse: [ ^ self ].

"We are updating a class installed in the system (currentClass) to a new representation defined in the model (anRGClass).
This has to be done in order to allow updating the class at run time"

currentGeneratedSlots := currentClass generatedSlots.
currentCustomSlots := currentClass localSlots copyWithoutAll:
currentGeneratedSlots.
currentCustomSlotNames := currentCustomSlots collect: #name.

modelGeneratedSlots := anRGClassModel slots reject: [ :each |
currentCustomSlotNames includes: each name ].

modelSlotDefinitions := (modelGeneratedSlots collect:
#definitionString) asOrderedCollection.
modelSlotDefinitions addAll:
(currentCustomSlots collect: #definitionString).
modelSlotDefinitions := modelSlotDefinitions sorted.

| customSlots customSlotNames slotDefinitions |
(realClass needToAdaptTo: anRGClass) ifFalse: [ ^ self ].
slotRemovals := currentGeneratedSlots reject: [ :e |
modelGeneratedSlots anySatisfy: [ :current |
current name = e name ] ].

customSlots := realClass localSlots copyWithoutAll: realClass generatedSlots.
customSlotNames := customSlots collect: #name.
slotDefinitions := ((anRGClass slots reject: [ :each | customSlotNames includes: each name ]) collect: #definitionString) asOrderedCollection.
slotDefinitions addAll: (customSlots collect: #definitionString).
slotDefinitions := slotDefinitions sorted.
slotRemovals ifNotEmpty: [
changesToApply add: (FmxSlotRemovals slots: slotRemovals) ].

self
recordClassAdditionFromClass: anRGClass
traits: (self traitStringFrom: realClass to: anRGClass)
slots: '{' , (slotDefinitions joinUsing: '. ') , '}'
classSlots: '{' , ((realClass class localSlots collect: #definitionString) joinUsing: ' . ') , '}'
sharedVariables: '{' , ((realClass classVarNames collect: [ :each | '#' , each ]) joinUsing: ' ') , '}'
package: realClass package name
tag: realClass packageTag name
recordClassAdditionFromClass: anRGClassModel
traits: (self traitStringFrom: currentClass to: anRGClassModel)
slots: '{' , (modelSlotDefinitions joinUsing: '. ') , '}'
classSlots:
'{' , ((currentClass class localSlots collect: #definitionString)
joinUsing: ' . ') , '}'
sharedVariables:
'{'
, ((currentClass classVarNames collect: [ :each | '#' , each ])
joinUsing: ' ') , '}'
package: currentClass package name
tag: currentClass packageTag name
]

{ #category : #installing }
Expand Down
6 changes: 6 additions & 0 deletions src/Famix-MetamodelBuilder-Core/FmxMethodRemovals.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ FmxMethodRemovals >> apply [
self selectors do: [ :selector | class removeSelector: selector ]
]

{ #category : #testing }
FmxMethodRemovals >> isRemoval [

^ true
]

{ #category : #accessing }
FmxMethodRemovals >> selectors [
^ selectors
Expand Down
47 changes: 47 additions & 0 deletions src/Famix-MetamodelBuilder-Core/FmxSlotRemovals.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
"
Description
--------------------
I represent a the removal of slots from a class when updating an already generated metamodel.
"
Class {
#name : #FmxSlotRemovals,
#superclass : #FmxCodeChange,
#instVars : [
'slots'
],
#category : #'Famix-MetamodelBuilder-Core-Changes'
}

{ #category : #'as yet unclassified' }
FmxSlotRemovals class >> slots: aCollection [

^ self new
slots: aCollection;
yourself
]

{ #category : #accessing }
FmxSlotRemovals >> apply [

slots do: [ :e | e owningClass removeInstVarNamed: e name ]
]

{ #category : #testing }
FmxSlotRemovals >> isRemoval [

^ true
]

{ #category : #accessing }
FmxSlotRemovals >> slots [

^ slots
]

{ #category : #accessing }
FmxSlotRemovals >> slots: anObject [

slots := anObject
]
24 changes: 24 additions & 0 deletions src/Famix-TestGenerators/FamixTest9BisGenerator.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Class {
#name : #FamixTest9BisGenerator,
#superclass : #FamixTest9Generator,
#category : #'Famix-TestGenerators'
}

{ #category : #accessing }
FamixTest9BisGenerator class >> packageName [

^ #'Famix-Test9-Entities'
]

{ #category : #accessing }
FamixTest9BisGenerator class >> prefix [

^ #'FamixTest9'
]

{ #category : #definition }
FamixTest9BisGenerator >> defineRelations [

"Here everything is the same except for the entities on the relation"
subclass *- superclass
]
47 changes: 47 additions & 0 deletions src/Famix-TestGenerators/FamixTest9Generator.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Class {
#name : #FamixTest9Generator,
#superclass : #FamixBasicInfrastructureGenerator,
#instVars : [
'superclass',
'subclass'
],
#category : #'Famix-TestGenerators'
}

{ #category : #accessing }
FamixTest9Generator class >> packageName [

^ #'Famix-Test9-Entities'
]

{ #category : #accessing }
FamixTest9Generator class >> prefix [

^ #'FamixTest9'
]

{ #category : #testing }
FamixTest9Generator class >> shouldBeUpToDateInLatestMoose [

"This generator is used dynamically by the tests"
^ false
]

{ #category : #definition }
FamixTest9Generator >> defineClasses [

superclass := self builder newClassNamed: #MySuperclass.
subclass := self builder newClassNamed: #MySubclass
]

{ #category : #definition }
FamixTest9Generator >> defineHierarchy [

subclass --|> superclass
]

{ #category : #definition }
FamixTest9Generator >> defineRelations [

subclass *- subclass
]
8 changes: 8 additions & 0 deletions src/Famix-Traits/FamixTAssociation.trait.st
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ FamixTAssociation >> asAssociationTo: anEntity [
^ self
]

{ #category : #printing }
FamixTAssociation >> displayFullStringOn: aStream [

self source displayFullStringOn: aStream.
aStream nextPutAll: ' -> '.
self target displayFullStringOn: aStream
]

{ #category : #printing }
FamixTAssociation >> displayStringOn: aStream [

Expand Down
17 changes: 17 additions & 0 deletions src/Famix-Traits/FamixTInvocation.trait.st
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,23 @@ FamixTInvocation >> candidates: anObject [
candidates value: anObject
]

{ #category : #printing }
FamixTInvocation >> displayFullStringOn: aStream [

self sender
ifNotNil: [ self sender displayFullStringOn: aStream ]
ifNil: [ aStream nextPut: $? ].
aStream nextPutAll: ' -> '.
self receiver
ifNotNil: [ :rcvr | self receiver displayFullStringOn: aStream ]
ifNil: [ aStream nextPut: $? ].
aStream nextPutAll: '.'.

self signature
ifNotNil: [ aStream nextPutAll: (self signature truncateWithElipsisTo: 40) ]
ifNil: [ aStream nextPutAll: ' ? ' ]
]

{ #category : #printing }
FamixTInvocation >> displayStringOn: aStream [

Expand Down
7 changes: 7 additions & 0 deletions src/Moose-Core/MooseAbstractGroup.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,13 @@ MooseAbstractGroup >> collectAsSet: aBlock [
^ self entities collectAsSet: aBlock
]

{ #category : #enumerating }
MooseAbstractGroup >> collectWithIndex: aBlock [

^ self entities
collectWithIndex: aBlock
]

{ #category : #accessing }
MooseAbstractGroup >> commonSuperclass [
^ self entityStorage commonSuperclass
Expand Down
77 changes: 77 additions & 0 deletions src/Moose-Core/MooseIcons.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,39 @@ MooseIcons class >> mooseDown [
offset: 0 @ 0 ]
]

{ #category : #'icon creation' }
MooseIcons class >> mooseDragAndDrop [

<mooseIcon>
^ self icons at: #mooseDragAndDrop ifAbsentPut: [
Form
extent: 16 @ 16
depth: 32
fromArray:
#( 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1056964608 2130706432
0 2130706432 1056964608 1056964608 1056964608 1056964608
2130706432 0 2130706432 2130706432 0 0 0 0 2130706432
0 0 0 0 0 0 0 0 0 0 2130706432 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 2130706432 0 0 0 0 0 0 0 0 0 0 2130706432
0 0 0 0 1056964608 0 0 0 0 0 0 0 0 0 0 1056964608 0 0 0 0 1056964608
0 0 0 0 0 0 0 0 0 0 2130706432 0 0 0 0 1056964608 0 0 0 1056964608
2130706432 2130706432 2130706432 2130706432 2130706432
2130706432 2130706432 2130706432 2130706432 0 0 1056964608
0 0 0 4278190080 2130706432 2130706432 2130706432 2130706432
2130706432 2130706432 2130706432 2130706432 3204448256
0 0 2130706432 0 0 0 4278190080 0 0 1056964608 0 0 0 0 0 2130706432
0 0 2130706432 2130706432 0 1056964608 4278190080 0 0 2130706432
3204448256 0 0 0 0 2130706432 0 0 1056964608 2130706432
0 1056964608 4278190080 0 0 2130706432 4278190080 3204448256
0 0 0 2130706432 0 0 0 0 0 0 4278190080 0 0 2130706432
2130706432 2130706432 0 0 0 2130706432 0 0 0 0 0 0 4278190080
0 0 0 0 2130706432 0 0 0 2130706432 0 0 0 0 0 0 4278190080
2130706432 2130706432 2130706432 2130706432 2130706432
2130706432 2130706432 2130706432 4278190080 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 )
offset: 0 @ 0 ]
]

{ #category : #'icon creation' }
MooseIcons class >> mooseEditor [

Expand Down Expand Up @@ -2112,6 +2145,50 @@ MooseIcons class >> mooseFame [
offset: 0 @ 0 ]
]

{ #category : #'icon creation' }
MooseIcons class >> mooseFilter [

<mooseIcon>
^ self icons at: #mooseFilter ifAbsentPut: [
Form
extent: 16 @ 16
depth: 32
fromArray:
#( 0 2130706432 2130706432 2130706432 2130706432 2130706432
2130706432 2130706432 2130706432 2130706432 1056964608
0 0 0 0 0 2130706432 3204448256 2130706432 2130706432
2130706432 2130706432 2130706432 2130706432 2130706432
4278190080 4278190080 1056964608 0 0 0 0 2130706432
2130706432 0 0 0 0 0 0 0 4278190080 4278190080 4278190080
1056964608 0 0 0 2130706432 2130706432 2130706432 4278190080
4278190080 4278190080 4278190080 4278190080 0 4278190080
4278190080 4278190080 4278190080 0 0 0 2130706432 2130706432
0 0 0 0 0 0 0 0 0 0 4278190080 0 0 0 2130706432 2130706432
1056964608 2130706432 2130706432 2130706432 2130706432
2130706432 2130706432 2130706432 0 0 4278190080 0 0 0 2130706432
2130706432 1056964608 2130706432 2130706432 2130706432
2130706432 2130706432 2130706432 2130706432 0 0 0 0 0 0 2130706432
2130706432 0 0 0 0 0 2130706432 4278190080 4278190080
4278190080 4278190080 4278190080 4278190080 4278190080
4278190080 2130706432 2130706432 2130706432 4278190080
4278190080 4278190080 2130706432 0 3204448256 4278190080
4278190080 4278190080 4278190080 4278190080 4278190080
3204448256 2130706432 2130706432 0 0 0 0 0 0 0 3204448256
4278190080 4278190080 4278190080 4278190080 3204448256
0 2130706432 2130706432 1056964608 2130706432 2130706432
2130706432 2130706432 2130706432 2130706432 0 3204448256
4278190080 4278190080 3204448256 0 0 2130706432 2130706432
1056964608 2130706432 2130706432 2130706432 2130706432
2130706432 2130706432 0 0 4278190080 4278190080 0 0 0 2130706432
2130706432 0 0 0 0 0 0 0 0 0 4278190080 4278190080 0 0 0 2130706432
3204448256 2130706432 2130706432 2130706432 2130706432
2130706432 2130706432 2130706432 0 0 4278190080 4278190080
0 0 0 0 2130706432 2130706432 2130706432 2130706432
2130706432 2130706432 2130706432 2130706432 0 0 4278190080
1056964608 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 )
offset: 0 @ 0 ]
]

{ #category : #'icon creation' }
MooseIcons class >> mooseFolder [

Expand Down
Loading

0 comments on commit 00423c8

Please sign in to comment.