Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/BaselineOfCormas/BaselineOfCormas.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ BaselineOfCormas >> specForBaselines: spec [

spec
baseline: 'RoassalExporters'
with: [ spec repository: 'github://pharo-graphics/RoassalExporters:v1.02' ]
with: [ spec repository: 'github://pharo-graphics/RoassalExporters:v1.02' ].

spec
baseline: 'Phleeter'
with: [ spec repository: 'github://tomooda/Phleeter:main/src' ].

]

Expand All @@ -113,7 +117,8 @@ BaselineOfCormas >> specForGroups: spec [
'Cormas-UI-Tilesets'
'Cormas-SensitivityAnalysis-Tests'
'Cormas-SensitivityAnalysis-UI-Tests');
group: 'default' with: #('SensitivityAnalysisUI')
group: 'default' with: #('SensitivityAnalysisUI');
group: 'deploy' with: #('default' 'Cormas-Application')
]

{ #category : 'specs' }
Expand Down Expand Up @@ -157,5 +162,8 @@ BaselineOfCormas >> specForPackages: spec [
with: [ spec requires: #('Cormas-SensitivityAnalysis' 'Cormas-Mocks' 'Cormas-UI-Translator') ];

package: 'Cormas-SensitivityAnalysis-UI-Tests'
with: [ spec requires: #('Cormas-SensitivityAnalysis-UI') ].
with: [ spec requires: #('Cormas-SensitivityAnalysis-UI') ];

package: 'Cormas-Application'
with: [ spec requires: #('Phleeter') ].
]
125 changes: 125 additions & 0 deletions src/Cormas-Application/CormasCommandLineHandler.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
Class {
#name : 'CormasCommandLineHandler',
#superclass : 'CommandLineHandler',
#category : 'Cormas-Application',
#package : 'Cormas-Application'
}

{ #category : 'accessing' }
CormasCommandLineHandler class >> commandName [

^ 'cormas'
]

{ #category : 'icons' }
CormasCommandLineHandler class >> cormasIcon [

| icon m left right top bottom r logo |
icon := Form extent: 128 @ 128 depth: 32.
m := 4.
left := 4.
right := 128 - 4.
top := 4.
bottom := 128 - 4.
r := 32.
icon getCanvas
fillColor: Color transparent;
fillRectangle: (left + r @ top corner: right - r @ bottom)
color: Color white;
fillRectangle: (left @ (top + r) corner: right @ (bottom - r))
color: Color white;
fillOval: (left @ top extent: r @ r * 2) color: Color white;
fillOval: (right - r - r @ top extent: r @ r * 2)
color: Color white;
fillOval: (left @ (bottom - r - r) extent: r @ r * 2)
color: Color white;
fillOval: (right - r - r @ (bottom - r - r) extent: r @ r * 2)
color: Color white.
logo := (BaselineOfCormas cormasLogo form contentsOfArea:
(0 @ 0 extent: 400 @ 400)) scaledToSize: 124 @ 124.
icon getCanvas translucentImage: logo at: 4 @ -2.
^ icon
]

{ #category : 'utilities' }
CormasCommandLineHandler class >> deploy [

<script>
MCRepositoryGroup allSubInstancesDo: [ :group |
group repositories do: [ :repo | group removeRepository: repo ] ].
IceRepository registry removeAll.
IceCredentialStore current in: [ :store |
store allCredentials do: [ :each | each removeFrom: store ] ].
self currentWorld closeAllWindowsDiscardingChanges.
Deprecation
raiseWarning: false;
showWarning: false.
NoChangesLog install.
"NoPharoFilesOpener install."
FFICompilerPlugin install.
Stdio useNullStreams.
MCCacheRepository uniqueInstance disable.
EpMonitor reset.
SessionManager default registerSystemClassNamed: #FreeTypeFileInfo.
5 timesRepeat: [ "PharoCommandLineHandler forcePreferencesOmission: true"
Smalltalk garbageCollect ]
]

{ #category : 'generating' }
CormasCommandLineHandler class >> generate [

<script: 'CormasCommandLineHandler generate'>
PhleeterOnOSX new
properties: {
(#AppName -> 'Cormas').
(#InfoString
-> 'COmmon pool Ressources and Multi-Agent Simulations').
(#BundleIdentifier -> 'com.github.cormas.cormas').
(#ShortVersion -> '1.0.0').
(#DisplayName -> 'Cormas').
(#IconSetFile
-> ((IceRepository repositoryNamed: 'cormas') location / 'icons'
/ 'Cormas.icns')).
(#DiskIconSetFile
-> ((IceRepository repositoryNamed: 'cormas') location / 'icons'
/ 'Cormas.icns')).
(#DeployPharoExpression -> 'CormasCommandLineHandler deploy').
(#CommandLineHandler -> self commandName).
(#CompanyName -> 'Cormas project') } asDictionary;
targetPlatforms:
#( 'Darwin-arm64' 'Darwin-x86_64' 'Windows-x86_64' );
outputDirectory: FileLocator home / 'src' / 'Cormas' / 'build';
generate
]

{ #category : 'activation' }
CormasCommandLineHandler >> activate [

self
installMenu;
installIcon
]

{ #category : 'initialization' }
CormasCommandLineHandler >> installIcon [

self currentWorld worldState worldRenderer osWindow icon:
self class cormasIcon
]

{ #category : 'initialization' }
CormasCommandLineHandler >> installMenu [

OSWindowDriver current startUp: true.
OSPlatform current isMacOSX ifTrue: [
| main |
main := CocoaMenu new.
main
title: 'MainMenu';
addSubmenu: 'Cormas' with: [ :m |
m
addItemWithTitle: 'Settings...'
action: [ SettingBrowser new open ];
addItemWithTitle: 'Quit' action: [ WorldState quitSession ] ].
main setAsMainMenu ]
]
1 change: 1 addition & 0 deletions src/Cormas-Application/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : 'Cormas-Application' }
Loading