Skip to content

Commit

Permalink
Issue #261: checkpoint ... starting work on copyScriptClasses.st -- c…
Browse files Browse the repository at this point in the history
…onvert scripts between filetree format (editable in tODE) and tonel format (executable format) [ci skip]
  • Loading branch information
dalehenrich committed Oct 18, 2019
1 parent 513fcf8 commit 76faa2f
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 5 deletions.
45 changes: 45 additions & 0 deletions alt_bin/examples/copyScriptClasses.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env gsdevkit_launcher
"
Copy script classes back and forth between Tonel and FileTree formats.
For the work on https://github.com/GsDevKit/GsDevKit_home/issues/260 it is
convenient/necessary to develop scripts using tODE which currently does not
support reading/writing Tonel format. Of course in order to EXECUTE a tonel
class file-based script, it must be in Tonel format. So this script will do
the work of copying classes back and forth between Monticello FileTree packages
and Rown Tonel packages.
"
Class {
#name : 'GdkL_CopyScriptClasses',
#superclass : 'AbstractGsDevKitProgram',
#category : 'gsdevKit_launcher-Scripts'
}

{ #category : 'private' }
GdkL_CopyScriptClasses >> _projectDefinitionForUrl: rowanSpecUrl [
| projectDef |
projectDef := (self _projectDefinitionClass newForUrl: rowanSpecUrl)
projectHome: '$GS_HOME/shared/repos/';
yourself.
projectDef read.
^ projectDef
]

{ #category : 'private' }
GdkL_CopyScriptClasses >> _projectDefinitionClass [
^ ((AllUsers userWithId: 'SystemUser') objectNamed: 'RwComponentProjectDefinition')
]

{ #category : 'main' }
GdkL_CopyScriptClasses >> main [
| projectDefinition_filetree projectDefinition_tonel |
projectDefinition_filetree := self _projectDefinitionForUrl: 'file:$GS_HOME/shared/repos/GsDevKit_launcher/rowan/specs/gsdevkit_launcher_filetree.ston'.
projectDefinition_tonel := self _projectDefinitionForUrl: 'file:$GS_HOME/shared/repos/GsDevKit_launcher/rowan/specs/gsdevkit_launcher_tonel.ston'.

self halt.

projectDefinition_filetree export.
projectDefinition_tonel export.
]
6 changes: 3 additions & 3 deletions alt_bin/examples/error.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
Example script that signals an error.
"
Class {
#name : 'GsDevKitLauncher_Error',
#name : 'GdkL_Error',
#superclass : 'AbstractGsDevKitProgram',
#category : 'gsdevKit_launcher-Scripts'
}

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

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

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

^ scriptName, '
', scriptName, ' -D --
Expand Down
4 changes: 2 additions & 2 deletions alt_bin/examples/hello.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
Hello world GsDevKit script
"
Class {
#name : 'GsDevKitLauncher_Hello',
#name : 'GdkL_Hello',
#superclass : 'AbstractGsDevKitProgram',
#category : 'gsdevKit_launcher-Scripts'
}

{ #category : 'main' }
GsDevKitLauncher_Hello >> main [
GdkL_Hello >> main [

^'hello world'
]
20 changes: 20 additions & 0 deletions shared/repos/GsDevKit_launcher/rowan/components/Scripts.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
RwComponentLoadConfiguration {
#name : 'Scripts',
#comment : 'copyScriptClasses.st support - tonel/filetree packages',
#version : '0.1.0',
#conditionalPackages : {
[
'common'
] : {
'core' : {
#packageNames : [
'gsdevkit_launcher-Scripts'
]
}
}
},
#conditionalPackageMapSpecs : { },
#definedGroupNames : {
'core' : [ ]
}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : 'gsdevkit_launcher-Scripts' }
4 changes: 4 additions & 0 deletions shared/repos/GsDevKit_launcher/rowan/scripts/properties.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
#format : 'tonel',
#convention : 'RowanHybrid'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
RwComponentSpecification{
#specName : 'GsDevKit_launcher_filetree',
#projectAlias : 'GsDevKit_launcher_filetree',
#projectName : '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 : 'Scripts',
#defaultGroupNames : [
'core'
],
#comment : 'copyScriptClasses.st support - tonel scripts'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
RwComponentSpecification{
#specName : 'GsDevKit_launcher_tonel',
#projectAlias : 'GsDevKit_launcher_tonel',
#projectName : 'GsDevKit_launcher',
#version : '0.3.0',
#projectUrl : 'https://github.com/GsDevKit_home',
#configsPath : 'rowan/components',
#projectsPath : 'rowan/projects',
#repoPath : 'rowan/scripts',
#specsPath : 'rowan/specs',
#defaultComponentName : 'Scripts',
#defaultGroupNames : [
'core'
],
#comment : 'copyScriptClasses.st support - tonel scripts'
}
4 changes: 4 additions & 0 deletions shared/repos/GsDevKit_launcher/rowan/src/properties.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
#format : 'filetree',
#convention : 'RowanHybrid'
}

0 comments on commit 76faa2f

Please sign in to comment.