From 69ca5d0724340bcdbafd0105d24365ed6d675139 Mon Sep 17 00:00:00 2001 From: Dale Henrichs Date: Sat, 12 Oct 2019 14:39:39 -0700 Subject: [PATCH] Issue #261: preparing the gsdevkit_launcher package structure [ci skip] --- alt_bin/defHOME_PATH.env | 2 +- alt_bin/examples/error.st | 24 ++++++++++ alt_bin/{ => examples}/hello.st | 0 shared/repos/GsDevKit_launcher/README.md | 45 +++++++++++++++++++ .../gemstone/bin/bootstrap_install.tpz | 39 ++++++++++++++++ .../rowan/components/Core.ston | 45 +++++++++++++++++++ .../rowan/projects/st_launcher.ston | 14 ++++++ .../rowan/specs/gsdevkit_launcher.ston | 14 ++++++ .../properties.st | 2 + .../properties.st | 2 + .../GsDevKit_launcher/rowan/src/properties.st | 3 ++ shared/repos/GsDevKit_launcher/src/README.md | 0 12 files changed, 189 insertions(+), 1 deletion(-) create mode 100755 alt_bin/examples/error.st rename alt_bin/{ => examples}/hello.st (100%) create mode 100644 shared/repos/GsDevKit_launcher/README.md create mode 100755 shared/repos/GsDevKit_launcher/bootstrapping/gemstone/bin/bootstrap_install.tpz create mode 100644 shared/repos/GsDevKit_launcher/rowan/components/Core.ston create mode 100644 shared/repos/GsDevKit_launcher/rowan/projects/st_launcher.ston create mode 100644 shared/repos/GsDevKit_launcher/rowan/specs/gsdevkit_launcher.ston create mode 100644 shared/repos/GsDevKit_launcher/rowan/src/gsdevkit_launcher-Core.package/properties.st create mode 100644 shared/repos/GsDevKit_launcher/rowan/src/gsdevkit_launcher-Scripts.package/properties.st create mode 100644 shared/repos/GsDevKit_launcher/rowan/src/properties.st delete mode 100644 shared/repos/GsDevKit_launcher/src/README.md diff --git a/alt_bin/defHOME_PATH.env b/alt_bin/defHOME_PATH.env index e353f05b..7deb7864 100644 --- a/alt_bin/defHOME_PATH.env +++ b/alt_bin/defHOME_PATH.env @@ -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 diff --git a/alt_bin/examples/error.st b/alt_bin/examples/error.st new file mode 100755 index 00000000..b681c109 --- /dev/null +++ b/alt_bin/examples/error.st @@ -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 -- +' +] diff --git a/alt_bin/hello.st b/alt_bin/examples/hello.st similarity index 100% rename from alt_bin/hello.st rename to alt_bin/examples/hello.st diff --git a/shared/repos/GsDevKit_launcher/README.md b/shared/repos/GsDevKit_launcher/README.md new file mode 100644 index 00000000..c4634666 --- /dev/null +++ b/shared/repos/GsDevKit_launcher/README.md @@ -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 diff --git a/shared/repos/GsDevKit_launcher/bootstrapping/gemstone/bin/bootstrap_install.tpz b/shared/repos/GsDevKit_launcher/bootstrapping/gemstone/bin/bootstrap_install.tpz new file mode 100755 index 00000000..09911ed9 --- /dev/null +++ b/shared/repos/GsDevKit_launcher/bootstrapping/gemstone/bin/bootstrap_install.tpz @@ -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 + diff --git a/shared/repos/GsDevKit_launcher/rowan/components/Core.ston b/shared/repos/GsDevKit_launcher/rowan/components/Core.ston new file mode 100644 index 00000000..d8cae662 --- /dev/null +++ b/shared/repos/GsDevKit_launcher/rowan/components/Core.ston @@ -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' + } + } + } +} diff --git a/shared/repos/GsDevKit_launcher/rowan/projects/st_launcher.ston b/shared/repos/GsDevKit_launcher/rowan/projects/st_launcher.ston new file mode 100644 index 00000000..833ac39f --- /dev/null +++ b/shared/repos/GsDevKit_launcher/rowan/projects/st_launcher.ston @@ -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' +} diff --git a/shared/repos/GsDevKit_launcher/rowan/specs/gsdevkit_launcher.ston b/shared/repos/GsDevKit_launcher/rowan/specs/gsdevkit_launcher.ston new file mode 100644 index 00000000..f390fdea --- /dev/null +++ b/shared/repos/GsDevKit_launcher/rowan/specs/gsdevkit_launcher.ston @@ -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' +} diff --git a/shared/repos/GsDevKit_launcher/rowan/src/gsdevkit_launcher-Core.package/properties.st b/shared/repos/GsDevKit_launcher/rowan/src/gsdevkit_launcher-Core.package/properties.st new file mode 100644 index 00000000..fc950284 --- /dev/null +++ b/shared/repos/GsDevKit_launcher/rowan/src/gsdevkit_launcher-Core.package/properties.st @@ -0,0 +1,2 @@ +{ +} diff --git a/shared/repos/GsDevKit_launcher/rowan/src/gsdevkit_launcher-Scripts.package/properties.st b/shared/repos/GsDevKit_launcher/rowan/src/gsdevkit_launcher-Scripts.package/properties.st new file mode 100644 index 00000000..fc950284 --- /dev/null +++ b/shared/repos/GsDevKit_launcher/rowan/src/gsdevkit_launcher-Scripts.package/properties.st @@ -0,0 +1,2 @@ +{ +} diff --git a/shared/repos/GsDevKit_launcher/rowan/src/properties.st b/shared/repos/GsDevKit_launcher/rowan/src/properties.st new file mode 100644 index 00000000..d2cb6440 --- /dev/null +++ b/shared/repos/GsDevKit_launcher/rowan/src/properties.st @@ -0,0 +1,3 @@ +{ + #format : 'filetree', +} diff --git a/shared/repos/GsDevKit_launcher/src/README.md b/shared/repos/GsDevKit_launcher/src/README.md deleted file mode 100644 index e69de29b..00000000