Skip to content

Commit

Permalink
Issue #261: preparing the gsdevkit_launcher package structure [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
dalehenrich committed Oct 12, 2019
1 parent 918b904 commit 69ca5d0
Show file tree
Hide file tree
Showing 12 changed files with 189 additions and 1 deletion.
2 changes: 1 addition & 1 deletion alt_bin/defHOME_PATH.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
cd "$( dirname "${BASH_SOURCE[0]}" )"
cd ..
export GS_HOME=`pwd`
export PATH="$GS_HOME/alt_bin:$GS_HOME/bin":$PATH
export PATH="$GS_HOME/alt_bin":"$GS_HOME/alt_bin/examples":"$GS_HOME/bin":$PATH

24 changes: 24 additions & 0 deletions alt_bin/examples/error.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env gsdevkit_launcher
"
Example script that signals an error.
"
Class {
#name : 'GsDevKitLauncher_Error',
#superclass : 'AbstractProgram',
#category : 'gsdevKit_launcher-Scripts'
}

{ #category : 'main' }
StLauncher_Error >> main [

Error signal: 'You wanted an error?'.
^ nil
]

{ #category : 'usage' }
StLauncher_Error >> usageExamples: scriptName [

^ scriptName, '
', scriptName, ' -D --
'
]
File renamed without changes.
45 changes: 45 additions & 0 deletions shared/repos/GsDevKit_launcher/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# GsDevKit_launcher
### Intro
This project implements a variant of the [st_launcher project][1].
The st_launcher project provides a mechanism for turning a Tonel class file[2] into an executable shell script.
The following is an example of a hello world gsdevkit_launcher smalltalk script:
``` smalltalk
#!/usr/bin/env gsdevkit_launcher
"
Hello world GsDevKit script
"
Class {
#name : 'GsDevKitLauncher_Hello',
#superclass : 'AbstractProgram',
#category : 'gsdevKit_launcher-Scripts'
}
{ #category : 'main' }
GsDevKitLauncher_Hello >> main [
^'hello world'
]
```
The scripts in gsdevkit_launcher project will be executed against a [GemStone 3.5.0 topaz solo extent][3].
Note that the shebang line: `#!/usr/bin/env gsdevkit_launcher` does a lookup of gsdevKit_launcher in your path.
The `gsdevkit_launcher` shell interpreter is in `$GS_HOME/alt_bin`, so `$GS_HOME/alt_bin` needs to be located in your path.

### Setup for development
```
cd $GS_HOME
git fetch --all
git checkout issue_260
# add alt_bin and alt_bin/examples to your path
. alt_bin/defHome_PATH.env
# test out the example scripts
hello.st
error.st
```



[1]: https://github.com/dalehenrich/st_launcher
[2]: https://github.com/pharo-vcs/tonel#tonel-spec
[3]: https://downloads.gemtalksystems.com/docs/GemStone64/3.5.x/GS64-ReleaseNotes-3.5/2-AdministrationChanges.htm#pgfId-1963111
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/local/bin/smalltalk/gemstone/topaz

input $ROWAN_PROJECTS_HOME/Rowan/platforms/gemstone/topaz/3.5.0/install_1.tpz
input $ROWAN_PROJECTS_HOME/Rowan/platforms/gemstone/topaz/3.5.0/install_2.tpz
input $ROWAN_PROJECTS_HOME/Rowan/platforms/gemstone/topaz/3.5.0/install_3.tpz
input $ROWAN_PROJECTS_HOME/Rowan/platforms/gemstone/topaz/3.5.0/install_4.tpz

iferr_clear

set u SystemUser p swordfish
login

run
"Need to patch AbstractDictionary>>at:ifPresent: to use cull:"
AbstractDictionary
compileMethod: 'at: key ifPresent: aBlock
"Lookup the given key in the receiver. If it is present, answer the value of evaluating the given
block with the value associated with the key. Otherwise, answer nil."

| v |
v := self at: key ifAbsent: [ ^ nil ].
^ aBlock cull: v'
%
commit

run
"install gsdevkit_launcher project"
| url projectSetDefinition |
url := 'file:$ROWAN_PROJECTS_HOME/gsdevkit_launcher/rowan/specs/gsdevkit_launcher.ston'.
projectSetDefinition := (RwComponentProjectDefinition newForUrl: url)
projectHome: '$ROWAN_PROJECTS_HOME';
read.
projectSetDefinition load
%
commit

errorCount
exit

45 changes: 45 additions & 0 deletions shared/repos/GsDevKit_launcher/rowan/components/Core.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
RwComponentLoadConfiguration{
#name : 'Core',
#comment : '',
#version : '0.1.0',
#definedGroupNames : {
'core' : [ ],
'tests' : [ 'core' ]
},
#configurationNames : [
'Properties'
],
#conditionalPackages : {
[
'common'
] : {
'core' : {
#packageNames : [
'st_launcher-Core'
]
},
'tests' : {
#packageNames : [
]
}
},
[
'gs3.[2-]'
] : {
'core' : {
#packageNames : [
'st_launcher-GemStone-Core',
'st_launcher-GemStone-Services',
'st_launcher-GemStone-Kernel'
]
}
}
},
#conditionalPackageMapSpecs : {
'gemstone' : {
'SystemUser' : {
#defaultSymbolDictName : 'Globals'
}
}
}
}
14 changes: 14 additions & 0 deletions shared/repos/GsDevKit_launcher/rowan/projects/st_launcher.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
RwComponentSpecification{
#specName : 'st_launcher',
#version : '0.3.0',
#projectUrl : 'https://github.com/dalehenrich/st_launcher',
#configsPath : 'rowan/components',
#projectsPath : 'rowan/projects',
#repoPath : 'rowan/src',
#specsPath : 'rowan/specs',
#defaultComponentName : 'Core',
#defaultGroupNames : [
'core'
],
#comment : 'Tonel class file shell scripts'
}
14 changes: 14 additions & 0 deletions shared/repos/GsDevKit_launcher/rowan/specs/gsdevkit_launcher.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
RwComponentSpecification{
#specName : 'gsdevkit_launcher',
#version : '0.3.0',
#projectUrl : 'https://github.com/GsDevKit_home',
#configsPath : 'rowan/components',
#projectsPath : 'rowan/projects',
#repoPath : 'rowan/src',
#specsPath : 'rowan/specs',
#defaultComponentName : 'Core',
#defaultGroupNames : [
'tests'
],
#comment : 'GsDevKit_home script support'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
3 changes: 3 additions & 0 deletions shared/repos/GsDevKit_launcher/rowan/src/properties.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
#format : 'filetree',
}
Empty file.

0 comments on commit 69ca5d0

Please sign in to comment.