Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dalehenrich/rowan3example
Project to illustrate the current Rowan 3 project management api
https://github.com/dalehenrich/rowan3example
Last synced: about 1 month ago
JSON representation
Project to illustrate the current Rowan 3 project management api
- Host: GitHub
- URL: https://github.com/dalehenrich/rowan3example
- Owner: dalehenrich
- License: mit
- Created: 2024-11-22T23:22:58.000Z (about 1 month ago)
- Default Branch: master
- Last Pushed: 2024-11-22T23:25:30.000Z (about 1 month ago)
- Last Synced: 2024-11-23T00:22:07.910Z (about 1 month ago)
- Language: Smalltalk
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This project was created using code in the following doit, as an example of the Rowan 3 API:
```
| rowanProjectsHome projectName definedProject resolvedProject className packageName |
"Create a project"
rowanProjectsHome := '/home/dhenrich/projects'.
projectName := 'Rowan3Example'.
className := 'ExampleClass'.
definedProject := (Rowan newProjectNamed: projectName)
projectsHome: rowanProjectsHome;
specName: projectName;
specComponentNames: { 'Core' };
addLoadComponentNamed: 'Core';
addSubcomponentNamed: 'tests/Tests'
condition: 'tests'
toComponentNamed: 'Core';
customConditionalAttributes: {'tests' };
comment: 'I am an example project';
packageConvention: 'Rowan';
yourself.
"Add two packages"
definedProject
addPackagesNamed: {(projectName , '-Core')}
toComponentNamed: 'Core';
addPackageNamed: projectName , '-Tests'
toComponentNamed: 'tests/Tests';
yourself.
"Define a class with a method and add them to a package"
packageName := projectName , '-Core'.
className := projectName , 'Class1'.
((definedProject packageNamed: packageName)
addClassNamed: className
super: 'Object'
instvars: #('ivar1')
category: packageName
comment: 'I am an example class')
addInstanceMethod: 'foo ^1' protocol: 'accessing';
yourself.
"Define a test class with a test method and add them to a package"
packageName := projectName , '-Tests'.
((definedProject packageNamed: packageName)
addClassNamed: projectName , 'TestCase'
super: 'TestCase'
category: packageName
comment: 'I test the example class')
addInstanceMethod: 'test self assert: ' , className , ' new foo = 1'
protocol: 'tests';
yourself.
"Export the project definitions to disk including the load spec"
resolvedProject := definedProject resolveStrict.
resolvedProject
export;
exportLoadSpecification."Read the load spec from disk and load the project"
(RwSpecification fromFile: rowanProjectsHome asFileReference / projectName / 'rowan' / 'specs' / projectName , 'ston')
projectsHome: rowanProjectsHome;
load
```