Skip to content

Commit

Permalink
Issue #4: update createStone.solo to attempt to load tode (see Issue #5)
Browse files Browse the repository at this point in the history
  • Loading branch information
dalehenrich committed Jun 4, 2023
1 parent 05134f0 commit d3a771f
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 9 deletions.
58 changes: 50 additions & 8 deletions bin/createStone.solo
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@ EXAMPLES
$basename --help
$basename -D
$basename --debugGem
$basename --registry=bosch --template=minimal --root=/export/bosch1/users/dhenrich/_stones/stones bosch_370 3.7.0
$basename -f --registry=bosch --template=minimal --root=/export/bosch1/users/dhenrich/_stones/stones bosch_370 3.7.0
# extent0.dbf, SystemUser
$basename --force --registry=gsdevkit --template=minimal gs_366 3.6.6
# extent0.rowan.dbf, SystemUser
$basename -f --registry=bosch --template=minimal_rowan rowan_366 3.6.6
# extent0.seaside.dbf, tODE installed, DataCurator
$basename --force --registry=gsdevkit --template=default_seaside tode_366 3.6.6
# extent0.seaside.dbf, no tODE installed, DataCurator
$basename --force --registry=gsdevkit --template=minimal_seaside seaside_366 3.6.6
-----
%
specs
Expand Down Expand Up @@ -71,6 +77,20 @@ RwLoadSpecificationV2 {
}
]
%
method
loadTode: stoneSpec
"not currently functioning GsHostProcess issue? ... ERROR message: /usr/bin/env: ‘bash’: No such file or directory"
| commandLine |
commandLine := (self scriptPath asFileReference parent / 'loadTode.stone') pathString.
commandLine
add: ' --projectDirectory=', stoneSpec stonesRegistry projectDirectory;
add: ' -- ';
add: ' -I ', (stoneSpec rootDir / '.topazini') pathString;
yourself.
stoneSpec class
executeCommandLine: commandLine
andInput: nil
%
doit
| registryClass stonesRegistry gemstoneVersion stoneName rootDir stoneSpec stoneSpecClass |
self preDoitSpecLoad: [:spec |
Expand All @@ -85,7 +105,10 @@ doit
ifNotNil: [:rootPath | rootPath asFileReference ]
ifNil: [ stonesRegistry stonesDirectory asFileReference ].
self positionalArgs size ~= 2
ifTrue: [ self error: 'Expected 2 positional arguments: <stone-name> <gemstone-version>, only got ', self positionalArgs size printString ].
ifTrue: [
self error:
'Expected 2 positional arguments: <stone-name> <gemstone-version>, only got ',
self positionalArgs size printString ].
stoneName := self positionalArgs at: 1.
gemstoneVersion := self positionalArgs at: 2.
stoneSpecClass := self globalNamed: 'GDKStoneSpec'.
Expand All @@ -96,16 +119,29 @@ doit
gemstoneVersionString: gemstoneVersion.
stoneSpec
parentRegistryName: self registry;
parentRegistryPath: '$', (self globalNamed: 'GDKGsDevKit_stonesBase') dataHomeEnvVar, '/' , (stonesRegistry registryFile relativeTo: stonesRegistry class base_data_home) pathString;
parentRegistryPath:
'$',
(self globalNamed: 'GDKGsDevKit_stonesBase') dataHomeEnvVar,
'/' ,
(stonesRegistry registryFile relativeTo: stonesRegistry class base_data_home)
pathString;
yourself.
(stoneSpec registryFile exists or: [stoneSpec rootDir exists])
ifTrue: [
(stoneSpec rootDir exists)
ifTrue: [
self force
ifFalse: [ self error: 'A stone is already present at ', stoneSpec rootDir pathString printString, '. Use --force to clean up.'].
ifFalse: [
self error:
'A stone is already present at ',
stoneSpec rootDir pathString printString,
'. Use --force to clean up.'].
stoneSpec destroyStoneStructure ]
ifFalse: [ self error: 'A stone with the name ', stoneName printString, ' already exists. Not yet implemented' ] ].
ifFalse: [
self error:
'A stone with the name ',
stoneName printString,
' already exists. Not yet implemented' ] ].
stoneSpec createStoneStructureUsing: stonesRegistry.
stoneSpec registryDir ensureCreateDirectory.
stoneSpec export.
Expand All @@ -114,7 +150,13 @@ doit
stoneSpec class
symbolicLink: stoneSpec registryPath
linkName: stoneSpec rootDir / '.GDKStoneSpec.ston'.
self start
ifTrue: [ stoneSpec startStone: self ].
(self start or: [ stoneSpec isTodeEnabled ])
ifTrue: [
stoneSpec startStone: self withSuperDoitOptions: false.
stoneSpec isTodeEnabled
ifTrue: [
"not currently functioning GsHostProcess issue? ... ERROR message: /usr/bin/env: ‘bash’: No such file or directory
self loadTode: stoneSpec
" ] ].
^ stoneSpec
%
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
other
initialization
initializeForExport
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
isTodeEnabled
^ false
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
isTodeEnabled
stoneDirectorySpec ifNil: [ ^ false ].
^ stoneDirectorySpec isTodeEnabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
isTodeEnabled
^ self tode notNil

0 comments on commit d3a771f

Please sign in to comment.