Skip to content

Commit

Permalink
574 add support for p11 and remove support for versions 7 8 (#575)
Browse files Browse the repository at this point in the history
Removed support for Pharo versions P7, P8 added for P11
- fixes #574

* Changed CI to use P11-P9, readme updated

- added CI support for P11-P9
- adjusted readme with proper badges

* Added compatibility package for P11 handling ExTonelWriter superclass change

* Fixed method classification

* Fixed baseline with version specific loading
  • Loading branch information
Bajger authored May 16, 2023
1 parent e34570d commit 15fe9f1
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 173 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
smalltalk: [ Pharo64-10, Pharo64-9.0, Pharo64-8.0 ]
smalltalk: [Pharo64-11, Pharo64-10, Pharo64-9.0]
name: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v3
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

[![Build & Unit tests](https://github.com/exercism/pharo-smalltalk/actions/workflows/ci.yml/badge.svg)](https://github.com/exercism/pharo-smalltalk/actions/workflows/ci.yml)
[![GitHub release](https://img.shields.io/github/release/exercism/pharo-smalltalk.svg)](https://github.com/exercism/pharo-smalltalk/releases/latest)
[![Pharo 10](https://img.shields.io/badge/Pharo-10-informational)](https://get.pharo.org)
[![Pharo 9.0](https://img.shields.io/badge/Pharo-9.0-informational)](https://get.pharo.org/64)
[![Pharo 8.0](https://img.shields.io/badge/Pharo-8.0-informational)](https://get.pharo.org/archive/80)
[![Pharo 11](https://img.shields.io/badge/Pharo-11-informational)](https://get.pharo.org)
[![Pharo 10](https://img.shields.io/badge/Pharo-10-informational)](https://get.pharo.org/100+vm)
[![Pharo 9.0](https://img.shields.io/badge/Pharo-9.0-informational)](https://get.pharo.org/90+vm)


This repository is for the development of [Exercism](http://exercism.io) exercises running in the [Pharo Smalltalk](http://pharo.org) programming environment.

Expand Down
29 changes: 11 additions & 18 deletions dev/src/BaselineOfExercism/BaselineOfExercism.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,17 @@ BaselineOfExercism >> baseline: spec [
with: #('ExercismDev' 'ExercismWIP' 'ExercismSystemTests');
group: 'testRunner' with: #('ExercismTestRunner');
group: 'testRunnerTests' with: #('ExercismTestRunnerTests');
group: 'v3' with: #('ExercismV3') ].
spec
for: #'pharo7.x'
do: [ spec
package: 'ExercismPharo70';
"Pharo override/patch methods"
package: 'ExercismTools'
with: [ spec requires: #('ExercismPharo70') ];
package: 'ExercismDev'
with:
[ spec requires: #('Ring2') "For mentoring support of shadow browsing" ] ].
spec
for: #'pharo8.x'
do: [ spec
package: 'ExercismPharo80';
package: 'ExercismTools'
with: [ spec requires: #('ExercismPharo80') ] ].
spec for: #'pharo9.x' do: [ spec package: 'ExercismPharo90' ]
group: 'v3' with: #('ExercismV3')
].
spec for: #'pharo9.x' do: [
spec package: 'ExercismTools' with: [ spec includes: #('ExercismPharo90') ].
spec package: 'ExercismPharo90' ].
spec for: #'pharo11.x' do: [
"ExercismTools must be loaded prior compatibilty package, to overwrite original class definition of ExTonelWriter"
spec package: 'ExercismTools' with: [ spec includes: #('ExercismPharo110') ].
spec package: 'ExercismPharo110' with: [ spec requires: 'ExercismTools' ]
]

]

{ #category : #baselines }
Expand Down
67 changes: 67 additions & 0 deletions dev/src/ExercismPharo110/ExTonelWriter.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
"
I am a TonelWriter that provides finer level control of writing Tonel files for Exercism
"
Class {
#name : #ExTonelWriter,
#superclass : #TonelWriterV1,
#instVars : [
'sourceDirectory'
],
#category : #ExercismPharo110
}

{ #category : #writing }
ExTonelWriter >> mappedSnapshot: aSnapshot [
"extracted from #writeSnapshot: to customise behavior"

|tonelMap extensionDefinitions|
snapshot := aSnapshot.
tonelMap := Dictionary new.

"Tonel export classes with their methods, mapped from their filename to content streams"
(snapshot definitions select: #isClassDefinition)
do: [ :classDef | |filename tonelStream|
filename := classDef exTonelFilename.
tonelStream := WriteStream on: String new.
self writeClass: classDef on: tonelStream.
tonelMap at: filename put: tonelStream ].

"... and method extensions"
extensionDefinitions := (snapshot definitions select: [ :each |
each isMethodDefinition and: [ each isExtensionMethod ] ]) removeDuplicates.

extensionDefinitions do: [ :methodDef | |filename|
filename := methodDef exTonelFilename.
tonelMap at: filename ifAbsentPut: [
(WriteStream on: String new) nextPutAll: 'Extension { #name : #', methodDef className, ' }' ; lf; yourself ].
self writeMethodDefinition: methodDef on: (tonelMap at: filename).
].
^tonelMap

]

{ #category : #private }
ExTonelWriter >> obtainPackageDir: aDefinition [
"Overridden to allow a specific directory to be supplied"

^self sourceDirectory ifNil: [ super obtainPackageDir: aDefinition ]
]

{ #category : #accessing }
ExTonelWriter >> sourceDirectory [
^ sourceDirectory
]

{ #category : #accessing }
ExTonelWriter >> sourceDirectory: anObject [
sourceDirectory := anObject
]

{ #category : #writing }
ExTonelWriter >> writeClass: aClassDefinition on: aStream [
"Not clear on whether this is an override and still needed? ~tma~"

self writeClassDefinition: aClassDefinition on: aStream.
self writeClassSideMethodDefinitions: aClassDefinition on: aStream.
self writeInstanceSideMethodDefinitions: aClassDefinition on: aStream
]
1 change: 1 addition & 0 deletions dev/src/ExercismPharo110/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #ExercismPharo110 }
32 changes: 0 additions & 32 deletions dev/src/ExercismPharo70/ClassNotUnderstood.class.st

This file was deleted.

62 changes: 0 additions & 62 deletions dev/src/ExercismPharo70/DoesNotUnderstandDebugAction.extension.st

This file was deleted.

13 changes: 0 additions & 13 deletions dev/src/ExercismPharo70/ManifestExercismPharo.class.st

This file was deleted.

34 changes: 0 additions & 34 deletions dev/src/ExercismPharo70/UndefinedObject.extension.st

This file was deleted.

1 change: 0 additions & 1 deletion dev/src/ExercismPharo70/package.st

This file was deleted.

8 changes: 0 additions & 8 deletions dev/src/ExercismPharo80/Path.extension.st

This file was deleted.

1 change: 0 additions & 1 deletion dev/src/ExercismPharo80/package.st

This file was deleted.

0 comments on commit 15fe9f1

Please sign in to comment.