Skip to content

Commit

Permalink
Move TPCommandServerOption to Pharo specific package
Browse files Browse the repository at this point in the history
  • Loading branch information
gcotelli committed Sep 19, 2023
1 parent 6240a91 commit 4326f17
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 34 deletions.
47 changes: 35 additions & 12 deletions source/BaselineOfLaunchpad/BaselineOfLaunchpad.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,31 @@ BaselineOfLaunchpad >> setUpDependencies: spec [
BaselineOfLaunchpad >> setUpDeploymentPackages: spec [

spec
package: 'Launchpad-Configuration'
with: [ spec requires: #( 'Bell-Deployment' 'INIParser-Deployment' 'Buoy-Deployment' ) ];
package: 'Launchpad-Configuration' with: [
spec requires:
#( 'Bell-Deployment' 'INIParser-Deployment'
'Buoy-Deployment' ) ];
group: 'Deployment' with: 'Launchpad-Configuration'.

spec
package: 'Launchpad-Applications' with: [ spec requires: 'Bell-Deployment' ];
package: 'Launchpad-Applications'
with: [ spec requires: 'Bell-Deployment' ];
group: 'Deployment' with: 'Launchpad-Applications'.

spec
package: 'Launchpad-Commands'
with: [ spec requires: #( 'Launchpad-Applications' 'Launchpad-Configuration' ) ];
package: 'Launchpad-Commands' with: [
spec requires:
#( 'Launchpad-Applications' 'Launchpad-Configuration' ) ];
group: 'Deployment' with: 'Launchpad-Commands'.

spec
package: 'Launchpad-Tracing' with: [ spec requires: 'Launchpad-Applications' ];
package: 'Launchpad-Commands-Pharo'
with: [ spec requires: 'Launchpad-Commands' ];
group: 'Deployment' with: 'Launchpad-Commands-Pharo'.

spec
package: 'Launchpad-Tracing'
with: [ spec requires: 'Launchpad-Applications' ];
group: 'Deployment' with: 'Launchpad-Tracing'
]

Expand Down Expand Up @@ -177,20 +187,33 @@ BaselineOfLaunchpad >> setUpTestPackages: spec [

spec
package: 'Launchpad-Configuration-Tests'
with: [ spec requires: #( 'Launchpad-Configuration' 'Launchpad-SUnit' ) ];
with: [
spec requires: #( 'Launchpad-Configuration'
'Launchpad-SUnit' ) ];
group: 'Tests' with: 'Launchpad-Configuration-Tests'.

spec
package: 'Launchpad-Applications-Tests'
with: [ spec requires: #( 'Launchpad-Applications' 'Launchpad-SUnit' ) ];
with: [
spec requires: #( 'Launchpad-Applications' 'Launchpad-SUnit' ) ];
group: 'Tests' with: 'Launchpad-Applications-Tests'.

spec
package: 'Launchpad-Tracing-Tests' with: [ spec requires: 'Launchpad-Tracing' ];
package: 'Launchpad-Tracing-Tests'
with: [ spec requires: 'Launchpad-Tracing' ];
group: 'Tests' with: 'Launchpad-Tracing-Tests'.

spec
package: 'Launchpad-Commands-Tests'
with: [ spec requires: #( 'Examples' 'Launchpad-Commands' 'Launchpad-SUnit' 'Hyperspace-SUnit' ) ];
group: 'Tests' with: 'Launchpad-Commands-Tests'
package: 'Launchpad-Commands-Tests' with: [
spec requires:
#( 'Examples' 'Launchpad-Commands' 'Launchpad-SUnit'
'Hyperspace-SUnit' ) ];
group: 'Tests' with: 'Launchpad-Commands-Tests'.

spec
package: 'Launchpad-Commands-Pharo-Tests' with: [
spec requires:
#( 'Examples' 'Launchpad-Commands-Pharo'
'Launchpad-SUnit' 'Hyperspace-SUnit' ) ];
group: 'Tests' with: 'Launchpad-Commands-Pharo-Tests'
]
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Class {
#instVars : [
'server'
],
#category : #'Launchpad-Commands-Tests'
#category : #'Launchpad-Commands-Pharo-Tests'
}

{ #category : #running }
Expand Down
1 change: 1 addition & 0 deletions source/Launchpad-Commands-Pharo-Tests/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'Launchpad-Commands-Pharo-Tests' }
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Extension { #name : #LaunchpadStartApplicationCommand }

{ #category : #'*Launchpad-Commands-Pharo' }
LaunchpadStartApplicationCommand >> enableTCPCommandServerListeningOn: listeningPort [

commandServer := TCPCommandServer listeningOn: listeningPort.
commandServer registerCommandNamed: 'SHUTDOWN' executing: [
[
LaunchpadApplication currentlyRunning
stop;
exitSuccess
] forkAt: Processor timingPriority named: 'Launchpad shutdown process'
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Class {
#instVars : [
'command'
],
#category : #'Launchpad-Commands'
#category : #'Launchpad-Commands-Pharo'
}

{ #category : #'instance creation' }
Expand All @@ -13,6 +13,12 @@ LaunchpadTCPCommandServerOption class >> for: aCommand [
^ self new initializeFor: aCommand
]

{ #category : #testing }
LaunchpadTCPCommandServerOption class >> isExtendedStartingOption [

^ true
]

{ #category : #testing }
LaunchpadTCPCommandServerOption >> canHandle: argument [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Class {
'connectionSocket',
'serverProcess'
],
#category : #'Launchpad-Commands'
#category : #'Launchpad-Commands-Pharo'
}

{ #category : #'instance creation' }
Expand Down
1 change: 1 addition & 0 deletions source/Launchpad-Commands-Pharo/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'Launchpad-Commands-Pharo' }
15 changes: 15 additions & 0 deletions source/Launchpad-Commands/LaunchpadOption.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,28 @@ Class {
#category : #'Launchpad-Commands'
}

{ #category : #querying }
LaunchpadOption class >> additionalStartingOptionsFor: startApplicationCommand [

^ self allLeafSubclasses
select: [ :optionClass | optionClass isExtendedStartingOption ]
thenCollect: [ :optionClass |
optionClass for: startApplicationCommand ]
]

{ #category : #testing }
LaunchpadOption class >> isAbstract [

<ignoreForCoverage>
^ self = LaunchpadOption
]

{ #category : #testing }
LaunchpadOption class >> isExtendedStartingOption [

^ false
]

{ #category : #testing }
LaunchpadOption >> canHandle: argument [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,6 @@ LaunchpadStartApplicationCommand >> enableStructuredLogging [
] ensure: [ StandardStreamLogger onStandardError stop ]
]

{ #category : #configuring }
LaunchpadStartApplicationCommand >> enableTCPCommandServerListeningOn: listeningPort [

commandServer := TCPCommandServer listeningOn: listeningPort.
commandServer registerCommandNamed: 'SHUTDOWN' executing: [
[
LaunchpadApplication currentlyRunning
stop;
exitSuccess
] forkAt: Processor timingPriority named: 'Launchpad shutdown process'
]
]

{ #category : #evaluating }
LaunchpadStartApplicationCommand >> evaluateWithin: context [

Expand All @@ -66,12 +53,12 @@ LaunchpadStartApplicationCommand >> evaluateWithin: context [
LaunchpadStartApplicationCommand >> initialize [

super initialize.
options := Array
with: ( LaunchpadHelpOption for: self )
with: ( LaunchpadDebugModeOption for: self )
with: ( LaunchpadSettingsFileOption for: self )
with: ( LaunchpadTCPCommandServerOption for: self )
with: ( LaunchpadStructuredLoggingOption for: self ).
options := OrderedCollection
with: (LaunchpadHelpOption for: self)
with: (LaunchpadDebugModeOption for: self)
with: (LaunchpadSettingsFileOption for: self)
with: (LaunchpadStructuredLoggingOption for: self).
options addAll: (LaunchpadOption additionalStartingOptionsFor: self).
baseConfigurationProvider := NullConfigurationProvider new.
applicationMode := ReleasedApplicationMode new.
commandServer := NullCommandServer new
Expand Down

0 comments on commit 4326f17

Please sign in to comment.