Skip to content

Commit

Permalink
Merge pull request #54 from moosetechnology/development
Browse files Browse the repository at this point in the history
Merge develoment into master
  • Loading branch information
ClotildeToullec authored Mar 30, 2023
2 parents ec06ad1 + 633301b commit bcadec8
Show file tree
Hide file tree
Showing 56 changed files with 1,808 additions and 242 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
push:
branches: [development, master]
pull_request:
types: [assigned, opened, synchronize, reopened]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
smalltalk: [ Pharo64-10 ]
name: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v2
- uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: ${{ matrix.smalltalk }}
- run: smalltalkci -s ${{ matrix.smalltalk }}
shell: bash
timeout-minutes: 15

14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Fame

![CI](https://github.com/moosetechnology/Fame/workflows/CI/badge.svg?branch=development)

Fame is an meta-modelling framework for executable models.

- [Installation](#installation)
Expand Down Expand Up @@ -31,7 +33,20 @@ Note you can replace the #master by another branch such as #development or a tag

## Documentation

TODO

### Export to mse

To export a model (or metamodel) in the mse format (for example to use FameJava and VerveineJ), execute the following code:

```Smalltalk
'/path/to/file.mse' asFileReference writeStreamDo: [ :writeStream | MyModel metamodel exportOn: writeStream ]
```

### Export to JSON

```Smalltalk
String streamContents: [ :writeStream | MyModel metamodel exportOn: writeStream usingPrinter: FMJSONPrinter ]
```

## Version management

Expand Down
54 changes: 30 additions & 24 deletions src/BaselineOfFame/BaselineOfFame.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,33 @@ Class {

{ #category : #baseline }
BaselineOfFame >> baseline: spec [

<baseline>
spec
for: #common
do: [ "Dependencies"
self
hashtable: spec;
mocketry: spec;
pharoBackwardCompatibility: spec;
iterators: spec;
treeQuery: spec.
spec for: #common do: [ "Dependencies"
self
hashtable: spec;
mocketry: spec;
pharoBackwardCompatibility: spec;
iterators: spec;
treeQuery: spec.

"Packages"
spec
package: 'Fame-Core' with: [ spec requires: #('Hashtable' 'TreeQuery' 'Iterators' 'PharoBackwardCompatibility') ];
package: 'Fame-Rules';
package: 'Fame-ImportExport' with: [ spec requires: #('Fame-Core') ];
package: 'Fame-Example';
package: 'Fame-Tests' with: [ spec requires: #('Fame-Core' 'Fame-ImportExport' 'Fame-Example' 'Mocketry') ];
package: 'Fame-GT' with: [ spec requires: #('Fame-ImportExport') ];
package: 'Fame-Deprecated' with: [ spec requires: #('Fame-ImportExport') ].
"Packages"
spec
package: 'Fame-Core' with: [ spec requires: #( 'Hashtable' 'TreeQuery' 'Iterators' 'PharoBackwardCompatibility' ) ];
package: 'Fame-Rules';
package: 'Fame-ImportExport' with: [ spec requires: #( 'Fame-Core' ) ];
package: 'Fame-Example';
package: 'Fame-Tests' with: [ spec requires: #( 'Fame-Core' 'Fame-ImportExport' 'Fame-Example' 'Mocketry' ) ];
package: 'Fame-Deprecated' with: [ spec requires: #( 'Fame-ImportExport' ) ].

"Groups"
spec
group: 'Core' with: #('Fame-Core' 'Fame-ImportExport' 'Fame-Rules');
group: 'GT' with: #('Core' 'Fame-GT');
group: 'Deprecated' with: #('Core' 'Fame-Deprecated');
group: 'Tests' with: #('Fame-Tests') ]
spec for: #( #'pharo6.x' #'pharo7.x' #'pharo8.x' ) do: [ spec package: 'Fame-GT' with: [ spec requires: #( 'Fame-ImportExport' ) ] ].
spec for: (self pharoVersionsFrom: 9) do: [ spec package: 'Fame-Spec2' with: [ spec requires: #( 'Fame-Core' ) ] ].

"Groups"
spec
group: 'Core' with: #( 'Fame-Core' 'Fame-ImportExport' 'Fame-Rules' );
group: 'Deprecated' with: #( 'Core' 'Fame-Deprecated' );
group: 'Tests' with: #( 'Fame-Tests' ) ]
]

{ #category : #dependencies }
Expand Down Expand Up @@ -69,6 +69,12 @@ BaselineOfFame >> pharoBackwardCompatibility: spec [
spec baseline: 'PharoBackwardCompatibility' with: [ spec repository: 'github://jecisc/PharoBackwardCompatibility:v1.x.x/src' ]
]

{ #category : #accessing }
BaselineOfFame >> pharoVersionsFrom: aVersion [

^ (aVersion to: SystemVersion current major) collect: [ :v | ('pharo' , v asString , '.x') asSymbol ]
]

{ #category : #accessing }
BaselineOfFame >> projectClass [
^ MetacelloCypressBaselineProject
Expand Down
104 changes: 8 additions & 96 deletions src/Fame-Core/FM3Class.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,19 @@ Internal Representation and Key Implementation Points.
"
Class {
#name : #FM3Class,
#superclass : #FM3Element,
#superclass : #FM3Type,
#instVars : [
'isAbstract',
'superclass',
'package',
'implementingClass',
'subclasses',
'traits',
'properties'
'subclasses'
],
#category : #'Fame-Core-Model'
}

{ #category : #meta }
FM3Class class >> annotation [
<FMClass: #Class super: #FM3Element>
<FMClass: #Class super: #FM3Type>
<package: #FM3>

]
Expand All @@ -57,38 +54,7 @@ FM3Class class >> defaultSuperclass [

{ #category : #visiting }
FM3Class >> accept: aVisitor [
aVisitor visitClass: self
]

{ #category : #adding }
FM3Class >> addTraits: aCollection [
self traits addAll: aCollection
]

{ #category : #'accessing-query' }
FM3Class >> allComplexProperties [
^ self allProperties reject: [ :attr | attr type isNotNil and: [ attr type isPrimitive ] ]
]

{ #category : #'accessing-query' }
FM3Class >> allContainerProperties [
^ self allProperties select: #isContainer
]

{ #category : #'accessing-query' }
FM3Class >> allPrimitiveProperties [
^ self allProperties select: [ :attr | attr type isNotNil and: [ attr type isPrimitive ] ]
]

{ #category : #'accessing-query' }
FM3Class >> allProperties [
<FMProperty: #allProperties type: 'FM3.Property'>
<multivalued>
<derived>
| nameDict |
nameDict := Dictionary new: 60. "estimated initial size."
self allPropertiesDo: [ :each | nameDict at: each name ifAbsentPut: [ each ] ].
^ nameDict values asArray
^ aVisitor visitClass: self
]

{ #category : #enumerating }
Expand Down Expand Up @@ -172,16 +138,14 @@ FM3Class >> inheritsFrom: aClass [
{ #category : #initialization }
FM3Class >> initialize [
super initialize.
properties := FMMultivalueLink on: self opposite: #mmClass:.
isAbstract := false.
superclass := self class defaultSuperclass.
subclasses := FMMultivalueLink on: self opposite: #superclass:.
traits := Set new
subclasses := FMMultivalueLink on: self opposite: #superclass:
]

{ #category : #testing }
FM3Class >> isAbstract [
<FMProperty: #abstract type: #Boolean>
<FMProperty: #abstract type: #Boolean defaultValue: false>
^ isAbstract
]

Expand All @@ -207,14 +171,14 @@ FM3Class >> isFM3Class [

{ #category : #testing }
FM3Class >> isPrimitive [
<FMProperty: #primitive type: #Boolean>
<FMProperty: #primitive type: #Boolean defaultValue: false>
<derived>
^ false
]

{ #category : #testing }
FM3Class >> isRoot [
<FMProperty: #root type: #Boolean>
<FMProperty: #root type: #Boolean defaultValue: false>
<derived>
^ false
]
Expand All @@ -229,56 +193,11 @@ FM3Class >> ownerProperties [
^ self allProperties select: #isContainer
]

{ #category : #accessing }
FM3Class >> package [
<FMProperty: #package type: #FM3Package opposite: #classes>
<container>
^ package
]

{ #category : #accessing }
FM3Class >> package: newPackage [
package := FMMultivalueLink
on: self
update: #classes
from: self package
to: newPackage
]

{ #category : #'accessing-query' }
FM3Class >> primitiveProperties [
^ self properties select: [ :attr | attr type isPrimitive ]
]

{ #category : #accessing }
FM3Class >> properties [
<FMProperty: #properties type: 'FM3.Property' opposite: #class>
<multivalued>
^ properties
]

{ #category : #accessing }
FM3Class >> properties: anObject [
properties value: anObject
]

{ #category : #'accessing-query' }
FM3Class >> propertiesNamed: aListOfSymbol [
^ aListOfSymbol collect: [ :each | self propertyNamed: each ]
]

{ #category : #'accessing-query' }
FM3Class >> propertyNamed: aString [
^ self propertyNamed: aString ifAbsent: nil
]

{ #category : #'accessing-query' }
FM3Class >> propertyNamed: aString ifAbsent: aBlock [
self allPropertiesDo: [ :attr | attr name = aString ifTrue: [ ^ attr ] ].

^ aBlock value
]

{ #category : #accessing }
FM3Class >> subclasses [
<FMProperty: #subclasses type: #FM3Class opposite: #superclass>
Expand Down Expand Up @@ -307,13 +226,6 @@ FM3Class >> superclass: newClass [
to: newClass
]

{ #category : #accessing }
FM3Class >> traits [
<FMProperty: #traits type: #FM3Class>
<multivalued>
^ traits
]

{ #category : #accessing }
FM3Class >> withAllSubclasses [
^ self allSubclasses
Expand Down
2 changes: 1 addition & 1 deletion src/Fame-Core/FM3Constant.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ FM3Constant class >> reset [

{ #category : #visiting }
FM3Constant >> accept: aVisitor [
aVisitor visitConstant: self
^ aVisitor visitConstant: self
]

{ #category : #initialization }
Expand Down
34 changes: 33 additions & 1 deletion src/Fame-Core/FM3Element.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ Class {
#name : #FM3Element,
#superclass : #Object,
#instVars : [
'name'
'name',
'metamodel',
'comment'
],
#category : #'Fame-Core-Model'
}
Expand Down Expand Up @@ -55,6 +57,18 @@ FM3Element >> accept: arg1 [
^ self subclassResponsibility
]

{ #category : #accessing }
FM3Element >> comment [

^ comment
]

{ #category : #accessing }
FM3Element >> comment: anObject [

comment := anObject
]

{ #category : #accessing }
FM3Element >> fullName [
<FMProperty: #fullName type: #String>
Expand All @@ -67,11 +81,29 @@ FM3Element >> fullName [
owner fullName ifNotNil: [ :fullName | fullName , '.' , self name ] ]
]

{ #category : #testing }
FM3Element >> hasComment [

^ self comment isNotNil
]

{ #category : #testing }
FM3Element >> hasOwner [
^ self owner isNotNil
]

{ #category : #accessing }
FM3Element >> metamodel [

^ metamodel
]

{ #category : #accessing }
FM3Element >> metamodel: anObject [

metamodel := anObject
]

{ #category : #accessing }
FM3Element >> name [
<FMProperty: #name type: #String>
Expand Down
2 changes: 1 addition & 1 deletion src/Fame-Core/FM3Package.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ FM3Package >> classNamed: aString ifPresent: aBlock ifAbsent: anotherBlock [

{ #category : #accessing }
FM3Package >> classes [
<FMProperty: #classes type: #FM3Class opposite: #package>
<FMProperty: #classes type: #FM3Type opposite: #package>
<multivalued>
^ classes
]
Expand Down
Loading

0 comments on commit bcadec8

Please sign in to comment.