Skip to content

Commit

Permalink
Fixes for Github release v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eMaringolo committed Apr 7, 2020
1 parent 7b5ab44 commit cc569ec
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 14 deletions.
Binary file modified envy/Tonel.dat
Binary file not shown.
11 changes: 6 additions & 5 deletions source/.configmaps
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[
{
#applications : [
'AbtShellProgramStarterApp' : '1.0',
'TonelBaseApp' : '1.1',
'TonelFileSystem' : '1.23',
'TonelLoaderModel' : '1.54',
'TonelLoaderModel' : '1.55',
'TonelReaderModel' : '1.49',
'TonelTools' : '1.10',
'TonelWriterModel' : '1.50'
'TonelWriterModel' : '1.52'
],
#conditions : [
{
Expand All @@ -17,7 +18,7 @@
}
],
#name : 'Tonel',
#versionName : '1.48',
#versionName : '1.50',
#comment : ''
},
{
Expand All @@ -30,13 +31,13 @@
{
#condition : 'true',
#requiredMaps : [
'Tonel' : '1.48',
'Tonel' : '1.50',
'z.ST: SUnit' : 'V 9.2.1 [457]'
]
}
],
#name : 'Test Tonel',
#versionName : '1.0',
#versionName : '1.1',
#comment : ''
}
]
35 changes: 35 additions & 0 deletions source/AbtShellProgramStarterApp/AbtShellProgramStarter.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"
I start commands launched from the shell/command of my host OS.
"
Class {
#name : 'AbtShellProgramStarter',
#superclass : 'AbtProgramStarter',
#instVars : [
'currentDirectory',
'stdoutPath'
],
#pools : [
'CfsConstants'
],
#category : 'AbtShellProgramStarterApp'
}

{ #category : 'accessing' }
AbtShellProgramStarter >> currentDirectory [
^currentDirectory
]

{ #category : 'accessing' }
AbtShellProgramStarter >> currentDirectory: aStringOrNil [
currentDirectory := aStringOrNil
]

{ #category : 'accessing' }
AbtShellProgramStarter >> stdoutPath [
^stdoutPath
]

{ #category : 'accessing' }
AbtShellProgramStarter >> stdoutPath: anObject [
stdoutPath := anObject
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Class {
#name : 'AbtShellProgramStarterApp',
#superclass : 'Application',
#category : 'AbtShellProgramStarterApp'
}
12 changes: 12 additions & 0 deletions source/AbtShellProgramStarterApp/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Package {
#name : 'AbtShellProgramStarterApp',
#vaPrerequisites : ['AbtRunProgramStarterApp'],
#vaSubApplications : [
{
#condition : '\'WIN32s\' = (System image subsystemType: \'OS\')',
#subapps : [
'AbtShellProgramStarterWinPlatformSubApp'
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Extension {
#name : 'AbtShellProgramStarter'
}

{ #category : '*AbtShellProgramStarterWinPlatformSubApp',
#vaCategories : ['AbtRun-API'] }
AbtShellProgramStarter >> startProgram [
"Start the receiver's program. If the program cannot be started,
answer false."

| input cmdLine rc startUpInfo processInformation |

(self programName == nil or: [self programName = '']) ifTrue: [^false].
cmdLine := 'cmd /c ', self programName.
((input := self programInput) == nil or: [input = '']) ifFalse: [
cmdLine := cmdLine , ' ' , input.
self stdoutPath isEmptyOrNil ifFalse: [
cmdLine := cmdLine, ' > ', self stdoutPath
]
].

(startUpInfo := OSStartupinfo new)
dwFlags: StartfUseshowwindow;
wShowWindow: SwHide.

rc :=
OS
createProcess: nil
lpszCommandLine: cmdLine
lpsaProcess: Null
lpsaThread: Null
fInheritHandles: false
fdwCreate: CreateNoWindow
lpvEnvironment: Null
lpszCurDir: self currentDirectory
lpsiStartInfo: startUpInfo
lppiProcInfo: (processInformation := OSProcessInformation new).

self lastError: (
rc
ifTrue: [
processInformation hProcess closeHandle.
processInformation hThread closeHandle.
0]
ifFalse: [OS getLastError]).
^rc
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Class {
#name : 'AbtShellProgramStarterWinPlatformSubApp',
#superclass : 'SubApplication',
#category : 'AbtShellProgramStarterWinPlatformSubApp'
}
4 changes: 4 additions & 0 deletions source/AbtShellProgramStarterWinPlatformSubApp/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Package {
#name : 'AbtShellProgramStarterWinPlatformSubApp',
#vaParent : 'AbtShellProgramStarterApp'
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ TonelLoaderGitParentBaseEditionStrategy >> initializeParentCommitId [
| execOkay mustWait outfile readStream |

execOkay := self executeGitCommand.
(Delay forMilliseconds: 250) wait.

"We put a long enough delay to ensure the output file will be found."
(Delay forMilliseconds: 2000) wait.
[
readStream :=
CfsFileStream read: (self loader repositoryPath append: self tempGitOutputPath) asString.
Expand Down
51 changes: 43 additions & 8 deletions source/TonelWriterModel/TonelWriter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Class {
'lineDelimiter',
'clearsSourcesDirectory',
'applications',
'configurationMaps'
'configurationMaps',
'autoLoad'
],
#classVars : [
'LineDelimiter'
Expand Down Expand Up @@ -68,13 +69,24 @@ TonelWriter class >> packageLabel [
]

{ #category : 'Configuring' }
TonelWriter >> addApplicationsFromConfigurationMaps [
"Enter the new method definition below and click 'Resume'."
TonelWriter >> addApplication: emApplication [

^self applications add: emApplication
]

self configurationMaps do: [:configMap |
configMap applicationNames do: [:name | | application |
application := (Smalltalk at: name asSymbol).
(self applications includes: application) ifFalse: [self applications add: application]]]
{ #category : 'Configuring' }
TonelWriter >> addApplicationsFromConfigurationMaps [

self configurationMaps do:
[:configMap |
configMap applicationNames do:
[:name |
| emApplication |
emApplication := Smalltalk classAt: name asSymbol ifAbsent: [
self error: ('<1p> is not loaded in the image.' expandMacrosWith: name)
].
(self applications includes: emApplication)
ifFalse: [self addApplication: emApplication]]]
]

{ #category : 'accessing' }
Expand All @@ -86,6 +98,15 @@ TonelWriter >> addConfigurationMap: anEmConfigurationMap [
'You can only add one Configuration Map for <1p>.'
expandMacrosWith: anEmConfigurationMap name)].

anEmConfigurationMap isLoaded
ifFalse: [
self autoLoad
ifTrue: [anEmConfigurationMap loadWithRequiredMaps]
ifFalse: [
self error: ('The config map <1p> must be loaded before exporting it to Tonel.' expandMacrosWith: anEmConfigurationMap)
]
].

self configurationMaps add: anEmConfigurationMap
]

Expand Down Expand Up @@ -153,6 +174,19 @@ TonelWriter >> applications: anObject [
applications := anObject
]

{ #category : 'accessing' }
TonelWriter >> autoLoad [
"Answer whether receiver will load applications or config maps that are not loaded
before writing them in Tonel format."

^autoLoad
]

{ #category : 'accessing' }
TonelWriter >> autoLoad: aBoolean [
autoLoad := aBoolean
]

{ #category : 'Utility' }
TonelWriter >> clearSourcesDirectory [

Expand Down Expand Up @@ -212,7 +246,8 @@ TonelWriter >> initializeOn: aFileSystem [

fileSystem := aFileSystem.
lineDelimiter := self class lineDelimiter.
clearsSourcesDirectory := true
clearsSourcesDirectory := true.
autoLoad := true
]

{ #category : 'Accessing' }
Expand Down

0 comments on commit cc569ec

Please sign in to comment.