-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
do filetree conversion on this project ...
- Loading branch information
1 parent
e0710c5
commit 0c80847
Showing
26 changed files
with
257 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"packageExtension" : ".package", | ||
"Metadata" : "false" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"noMethodMetaData" : true, | ||
"separateMethodMetaAndSource" : false, | ||
"useCypressPropertiesFile" : true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"noMethodMetaData" : true, | ||
"separateMethodMetaAndSource" : false, | ||
"useCypressPropertiesFile" : true } |
5 changes: 5 additions & 0 deletions
5
filetree/T2F2T-Conversion-Core.package/T2F2TConversion.class/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Rowan-based scripts for converting package repositories from Tonel to Filetree and Filetree to Tonel format . | ||
|
||
See project readme (https://github.com/GsDevKit/T2F2T-Conversion#t2f2t-conversion) and shell script man page (https://github.com/GsDevKit/T2F2T-Conversion/blob/master/docs/man.txt) for additional details. | ||
|
||
test "quoted strings" in a comment |
3 changes: 3 additions & 0 deletions
3
filetree/T2F2T-Conversion-Core.package/T2F2TConversion.class/class/_projectName.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
private | ||
_projectName | ||
^ 'T2F2T-Conversion' |
5 changes: 5 additions & 0 deletions
5
filetree/T2F2T-Conversion-Core.package/T2F2TConversion.class/class/executeCommandLine.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
command-line | ||
executeCommandLine | ||
| stdout | | ||
stdout := GsFile stdout. | ||
self new processCommandLine: GsFile stdout |
9 changes: 9 additions & 0 deletions
9
...ree/T2F2T-Conversion-Core.package/T2F2TConversion.class/instance/_copyPackagesFrom.to..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
filetree/tonel commands | ||
_copyPackagesFrom: sourceProject to: targetProject | ||
sourceProject | ||
readPackageNamesBlock: [ :packageName | | ||
"read all of the packages" | ||
true ]. | ||
targetProject packagesRoot ensureCreateDirectory. | ||
targetProject packages: sourceProject packages. | ||
targetProject exportPackages |
27 changes: 27 additions & 0 deletions
27
...stance/_createProject.packageConvention.root.t2f2tDir.packageDir.componentName.format..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
create command | ||
_createProject: projectName packageConvention: packageConvention root: root t2f2tDir: t2f2tDir packageDir: packageDir componentName: componentName format: format | ||
| project resolvedProject | | ||
project := (Rowan newProjectNamed: projectName) | ||
packageConvention: packageConvention; | ||
packageFormat: format; | ||
diskUrl: 'file://' , root pathString; | ||
projectSpecFile: t2f2tDir , '/' , format , '.ston'; | ||
specName: format; | ||
componentsPath: t2f2tDir , '/components'; | ||
packagesPath: packageDir; | ||
projectsPath: t2f2tDir , '/projects'; | ||
specsPath: t2f2tDir , '/specs'; | ||
projectSpecPath: t2f2tDir; | ||
projectSpecName: format; | ||
yourself. | ||
|
||
project addTopLevelComponentNamed: componentName. | ||
|
||
resolvedProject := project resolve. | ||
Rowan projectTools createV2 | ||
createResolvedProjectRepository: resolvedProject repository. | ||
resolvedProject | ||
exportProjectSpecification; | ||
exportProjects; | ||
exportComponents; | ||
exportLoadSpecification |
3 changes: 3 additions & 0 deletions
3
filetree/T2F2T-Conversion-Core.package/T2F2TConversion.class/instance/_manPagePath.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
private | ||
_manPagePath | ||
^ 'docs/man.txt' |
7 changes: 7 additions & 0 deletions
7
filetree/T2F2T-Conversion-Core.package/T2F2TConversion.class/instance/_message.to..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
private | ||
_message: message to: stdout | ||
stdout | ||
lf; | ||
nextPutAll: message; | ||
nextPutAll: '. See help (t2t2t.sh --help) for details'; | ||
lf |
29 changes: 29 additions & 0 deletions
29
...Conversion-Core.package/T2F2TConversion.class/instance/convertTo.packagesUsing.stdout..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
filetree/tonel commands | ||
convertTo: targetFormat packagesUsing: t2f2tPath stdout: stdout | ||
| t2f2tRoot tonelProject filetreeProject targetProject sourceProject | | ||
t2f2tRoot := t2f2tPath asFileReference. | ||
t2f2tRoot exists | ||
ifFalse: [ | ||
^ self | ||
error: | ||
'The t2f2t metadata directory ' , t2f2tRoot printString , ' does not exist.' | ||
to: stdout ]. | ||
tonelProject := Rowan | ||
projectFromUrl: 'file://' , (t2f2tRoot / 'specs' / 'tonel.ston') pathString. | ||
filetreeProject := Rowan | ||
projectFromUrl: 'file://' , (t2f2tRoot / 'specs' / 'filetree.ston') pathString. | ||
targetFormat = 'tonel' | ||
ifTrue: [ | ||
targetProject := tonelProject. | ||
sourceProject := filetreeProject ] | ||
ifFalse: [ | ||
targetFormat = 'filetree' | ||
ifTrue: [ | ||
targetProject := filetreeProject. | ||
sourceProject := tonelProject ] | ||
ifFalse: [ | ||
self | ||
error: | ||
'unknown format ' , targetFormat printString , '. Should be [ tonel | filetree]' | ||
to: stdout ] ]. | ||
self _copyPackagesFrom: sourceProject to: targetProject |
3 changes: 3 additions & 0 deletions
3
...ion-Core.package/T2F2TConversion.class/instance/convertToFiletreePackagesUsing.stdout..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
filetree/tonel commands | ||
convertToFiletreePackagesUsing: t2f2tPath stdout: stdout | ||
^ self convertTo: 'filetree' packagesUsing: t2f2tPath stdout: stdout |
3 changes: 3 additions & 0 deletions
3
...ersion-Core.package/T2F2TConversion.class/instance/convertToTonelPackagesUsing.stdout..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
filetree/tonel commands | ||
convertToTonelPackagesUsing: t2f2tPath stdout: stdout | ||
^ self convertTo: 'tonel' packagesUsing: t2f2tPath stdout: stdout |
31 changes: 31 additions & 0 deletions
31
...ateForProject.t2f2t.tonel.filetree.projectName.componentName.packageConvention.stdout..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
create command | ||
createForProject: projectRootPath t2f2t: t2f2tDir tonel: tonelPackageDir filetree: filetreePackageDir projectName: projectName componentName: componentName packageConvention: packageConvention stdout: stdout | ||
| projectRoot t2f2tRoot | | ||
projectRoot := projectRootPath asFileReference. | ||
projectRoot exists | ||
ifFalse: [ | ||
^ self | ||
error: | ||
'The project directory ' , projectRootPath printString , ' does not exist.' | ||
to: stdout ]. | ||
t2f2tRoot := projectRoot. | ||
|
||
(projectRoot / tonelPackageDir) ensureCreateDirectory. | ||
self | ||
_createProject: projectName | ||
packageConvention: packageConvention | ||
root: t2f2tRoot | ||
t2f2tDir: t2f2tDir | ||
packageDir: tonelPackageDir | ||
componentName: componentName | ||
format: 'tonel'. | ||
|
||
(projectRoot / filetreePackageDir) ensureCreateDirectory. | ||
self | ||
_createProject: projectName | ||
packageConvention: packageConvention | ||
root: t2f2tRoot | ||
t2f2tDir: t2f2tDir | ||
packageDir: filetreePackageDir | ||
componentName: componentName | ||
format: 'filetree' |
11 changes: 11 additions & 0 deletions
11
...e.package/T2F2TConversion.class/instance/createForProject.t2f2t.tonel.filetree.stdout..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
create command | ||
createForProject: projectRootPath t2f2t: t2f2tDir tonel: tonelPackageDir filetree: filePackageDir stdout: stdout | ||
^ self | ||
createForProject: projectRootPath | ||
t2f2t: t2f2tDir | ||
tonel: tonelPackageDir | ||
filetree: filePackageDir | ||
projectName: 't2f2tMeta' | ||
componentName: 'Core' | ||
packageConvention: 'Monticello' | ||
stdout: stdout |
3 changes: 3 additions & 0 deletions
3
filetree/T2F2T-Conversion-Core.package/T2F2TConversion.class/instance/debug..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
debug: object | ||
debug := object |
3 changes: 3 additions & 0 deletions
3
filetree/T2F2T-Conversion-Core.package/T2F2TConversion.class/instance/debug.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
debug | ||
^ debug ifNil: [ false ] |
5 changes: 5 additions & 0 deletions
5
filetree/T2F2T-Conversion-Core.package/T2F2TConversion.class/instance/error.to..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error handling | ||
error: errorMessage to: stdout | ||
self debug | ||
ifTrue: [ ^ super error: errorMessage ]. | ||
self _message: errorMessage to: stdout |
63 changes: 63 additions & 0 deletions
63
filetree/T2F2T-Conversion-Core.package/T2F2TConversion.class/instance/processCommandLine..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
command-line support | ||
processCommandLine: stdout | ||
| args scriptArgStart command commandArgs argIndex argsSize | | ||
args := System commandLineArguments. | ||
scriptArgStart := args indexOf: '--'. | ||
commandArgs := {}. | ||
command := nil. | ||
scriptArgStart = 0 | ||
ifTrue: [ | ||
^ self | ||
error: | ||
'topaz solo launched without '' -- '', so it is not possible to process command line arguments' | ||
to: stdout ]. | ||
|
||
argIndex := scriptArgStart + 1. "arg after initial --" | ||
argsSize := args size. | ||
[ argIndex <= argsSize ] | ||
whileTrue: [ | ||
| arg | | ||
arg := args at: argIndex. | ||
argIndex := argIndex + 1. | ||
arg = '--help' | (arg = '-h') | ||
ifTrue: [ ^ self usageMessage: stdout ]. | ||
command | ||
ifNil: [ | ||
(#('create' 'filetree' 'tonel' '--debug') includes: arg) | ||
ifFalse: [ | ||
^ self | ||
error: | ||
'UNKNOWN command ' , arg printString | ||
, '. Command should be one of [create | filetree | tonel ]' | ||
to: stdout ]. | ||
arg = '--debug' | ||
ifTrue: [ self debug: true ] | ||
ifFalse: [ command := arg ] ] | ||
ifNotNil: [ commandArgs add: arg ] ]. | ||
command = 'create' | ||
ifTrue: [ | ||
commandArgs size ~= 4 | ||
ifTrue: [ | ||
^ self | ||
error: | ||
'expected 4 positional arguments for create command (project-root, t2f2t-data-dir, tonel-pkg-dir, and filetree-pkg-dir), got ' | ||
, commandArgs size printString | ||
to: stdout ]. | ||
^ self | ||
createForProject: (commandArgs at: 1) | ||
t2f2t: (commandArgs at: 2) | ||
tonel: (commandArgs at: 3) | ||
filetree: (commandArgs at: 4) | ||
stdout: stdout ]. | ||
commandArgs size ~= 1 | ||
ifTrue: [ | ||
^ self | ||
error: | ||
'expected 1 positional arguments for ' , command | ||
, ' command (t2f2t-data-dir), got ' , commandArgs size printString | ||
to: stdout ]. | ||
|
||
command = 'filetree' | ||
ifTrue: [ ^ self convertToFiletreePackagesUsing: (commandArgs at: 1) stdout: stdout ]. | ||
command = 'tonel' | ||
ifTrue: [ ^ self convertToTonelPackagesUsing: (commandArgs at: 1) stdout: stdout ] |
10 changes: 10 additions & 0 deletions
10
filetree/T2F2T-Conversion-Core.package/T2F2TConversion.class/instance/usageMessage..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
command-line support | ||
usageMessage: stdout | ||
| root read | | ||
root := (Rowan projectNamed: self class _projectName) repositoryRoot. | ||
read := ReadStreamPortable on: (root / self _manPagePath) contents. | ||
[ read atEnd ] | ||
whileFalse: [ | ||
stdout | ||
nextPutAll: read nextLine; | ||
lf ] |
14 changes: 14 additions & 0 deletions
14
filetree/T2F2T-Conversion-Core.package/T2F2TConversion.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "T2F2T-Conversion-Core", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"debug" ], | ||
"name" : "T2F2TConversion", | ||
"pools" : [ | ||
], | ||
"super" : "Object", | ||
"type" : "normal" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
#format : 'filetree', | ||
#convention : 'RowanHybrid' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters