Skip to content

Commit

Permalink
Add GToolkitPrerequisites
Browse files Browse the repository at this point in the history
  • Loading branch information
chisandrei committed May 15, 2024
1 parent 3def3fe commit 603a4e9
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,69 +9,13 @@ Class {

{ #category : #baselines }
BaselineOfGToolkitForPharo9 >> baseline: spec [

<baseline>

spec for: #common do: [
spec postLoadDoIt: #postLoadGToolkit:.
spec
baseline: 'GToolkit'
baseline: 'GToolkitPrerequisites'
with: [ spec repository: 'github://feenkcom/gtoolkit:main/src' ].
spec
package: 'GToolkit-Pharo9-Deprecations';
package: 'GToolkit-Pharo9-Debugger';
package: 'GToolkit-Pharo9-Subscriptions';
package: 'GToolkit-Pharo9-Iceberg';
package: 'GToolkit-PharoMigrations';
package: 'GToolkit-Pharo9' with: [
spec requires:
#( 'GToolkit-Pharo9-Deprecations'
'GToolkit-Pharo9-Debugger'
'GToolkit-Pharo9-Subscriptions'
'GToolkit-Pharo9-Iceberg'
'GToolkit-PharoMigrations'
'GToolkit' ) ] ]
]

{ #category : #baselines }
BaselineOfGToolkitForPharo9 >> postLoadGToolkit: spec [
(PostLoaded isNotNil and: [ PostLoaded ]) ifTrue: [ ^ self ].
PostLoaded := true.

self
forPharo11AndPharo12: [
#(#FinalizationRegistryEntry #WeakKeyAssociation) do: [ :aClassName |
aClassName asClass classSide
compile: 'leJsonV4Name
^ nil' classified: 'serialisation' ].

RBInlineMethodRefactoring addSlot: #inlineClass.
RBInlineMethodRefactoring compile: 'inlineClass
^ inlineClass
ifNil: [ inlineClass := ( sourceMessage receiver name = ''super''
ifTrue: [ class superclass ]
ifFalse: [ class ] ) whoDefinesMethod: self inlineSelector
]
ifNotNil: [ inlineClass ]' classified: 'transforming'.

RBInlineMethodFromComponentRefactoring compile: 'inlineClass
| imps |
inlineClass ifNotNil: [ ^ inlineClass ].
imps := ( self model allImplementorsOf: self inlineSelector ) asOrderedCollection.
imps size = 1
ifTrue: [ ^ inlineClass := imps first ].
imps ifEmpty: [ self refactoringFailure: ''Nobody defines a method named '' , self inlineSelector ].
inlineClass := self requestImplementorToInline: imps.
inlineClass ifNil: [ self refactoringFailure: ''No implementor selected'' ].
^ inlineClass' classified: 'transforming'.

]
forPharo10: [
#Ephemeron asClass classSide
compile: 'leJsonV4Name
^ nil' classified: 'serialisation'].
baseline: 'GToolkit'
with: [ spec repository: 'github://feenkcom/gtoolkit:main/src' ] ]
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Class {
#name : #BaselineOfGToolkitPrerequisites,
#superclass : #BaselineOf,
#classVars : [
'PostLoaded'
],
#category : #BaselineOfGToolkitPrerequisites
}

{ #category : #accessing }
BaselineOfGToolkitPrerequisites >> baseline: spec [

<baseline>
spec for: #common do: [
spec postLoadDoIt: #postLoadGToolkit:.
spec
package: 'GToolkit-Pharo9-Deprecations';
package: 'GToolkit-Pharo9-Debugger';
package: 'GToolkit-Pharo9-Subscriptions';
package: 'GToolkit-Pharo9-Iceberg';
package: 'GToolkit-PharoMigrations';
package: 'GToolkit-Pharo9' ]
]

{ #category : #accessing }
BaselineOfGToolkitPrerequisites >> postLoadGToolkit: spec [
(PostLoaded isNotNil and: [ PostLoaded ]) ifTrue: [ ^ self ].
PostLoaded := true.

self
forPharo11AndPharo12: [
#(#FinalizationRegistryEntry #WeakKeyAssociation) do: [ :aClassName |
aClassName asClass classSide
compile: 'leJsonV4Name
^ nil' classified: 'serialisation' ].

RBInlineMethodRefactoring addSlot: #inlineClass.
RBInlineMethodRefactoring compile: 'inlineClass
^ inlineClass
ifNil: [ inlineClass := ( sourceMessage receiver name = ''super''
ifTrue: [ class superclass ]
ifFalse: [ class ] ) whoDefinesMethod: self inlineSelector
]
ifNotNil: [ inlineClass ]' classified: 'transforming'.

RBInlineMethodFromComponentRefactoring compile: 'inlineClass
| imps |
inlineClass ifNotNil: [ ^ inlineClass ].
imps := ( self model allImplementorsOf: self inlineSelector ) asOrderedCollection.
imps size = 1
ifTrue: [ ^ inlineClass := imps first ].
imps ifEmpty: [ self refactoringFailure: ''Nobody defines a method named '' , self inlineSelector ].
inlineClass := self requestImplementorToInline: imps.
inlineClass ifNil: [ self refactoringFailure: ''No implementor selected'' ].
^ inlineClass' classified: 'transforming'.

]
forPharo10: [
#Ephemeron asClass classSide
compile: 'leJsonV4Name
^ nil' classified: 'serialisation'].
]
1 change: 1 addition & 0 deletions src/BaselineOfGToolkitPrerequisites/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #BaselineOfGToolkitPrerequisites }

0 comments on commit 603a4e9

Please sign in to comment.