diff --git a/envy/Tonel.dat b/envy/Tonel.dat index 775d34f..260aad8 100755 Binary files a/envy/Tonel.dat and b/envy/Tonel.dat differ diff --git a/source/.configmaps b/source/.configmaps index c1fff96..dd33bba 100644 --- a/source/.configmaps +++ b/source/.configmaps @@ -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 : [ { @@ -17,7 +18,7 @@ } ], #name : 'Tonel', - #versionName : '1.48', + #versionName : '1.50', #comment : '' }, { @@ -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 : '' } ] \ No newline at end of file diff --git a/source/AbtShellProgramStarterApp/AbtShellProgramStarter.class.st b/source/AbtShellProgramStarterApp/AbtShellProgramStarter.class.st new file mode 100644 index 0000000..5452f00 --- /dev/null +++ b/source/AbtShellProgramStarterApp/AbtShellProgramStarter.class.st @@ -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 +] diff --git a/source/AbtShellProgramStarterApp/AbtShellProgramStarterApp.class.st b/source/AbtShellProgramStarterApp/AbtShellProgramStarterApp.class.st new file mode 100644 index 0000000..08336e7 --- /dev/null +++ b/source/AbtShellProgramStarterApp/AbtShellProgramStarterApp.class.st @@ -0,0 +1,5 @@ +Class { + #name : 'AbtShellProgramStarterApp', + #superclass : 'Application', + #category : 'AbtShellProgramStarterApp' +} diff --git a/source/AbtShellProgramStarterApp/package.st b/source/AbtShellProgramStarterApp/package.st new file mode 100644 index 0000000..eaf8bbb --- /dev/null +++ b/source/AbtShellProgramStarterApp/package.st @@ -0,0 +1,12 @@ +Package { + #name : 'AbtShellProgramStarterApp', + #vaPrerequisites : ['AbtRunProgramStarterApp'], + #vaSubApplications : [ + { + #condition : '\'WIN32s\' = (System image subsystemType: \'OS\')', + #subapps : [ + 'AbtShellProgramStarterWinPlatformSubApp' + ] + } +] +} diff --git a/source/AbtShellProgramStarterWinPlatformSubApp/AbtShellProgramStarter.extension.st b/source/AbtShellProgramStarterWinPlatformSubApp/AbtShellProgramStarter.extension.st new file mode 100644 index 0000000..eb6fbb6 --- /dev/null +++ b/source/AbtShellProgramStarterWinPlatformSubApp/AbtShellProgramStarter.extension.st @@ -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 +] diff --git a/source/AbtShellProgramStarterWinPlatformSubApp/AbtShellProgramStarterWinPlatformSubApp.class.st b/source/AbtShellProgramStarterWinPlatformSubApp/AbtShellProgramStarterWinPlatformSubApp.class.st new file mode 100644 index 0000000..f02abd2 --- /dev/null +++ b/source/AbtShellProgramStarterWinPlatformSubApp/AbtShellProgramStarterWinPlatformSubApp.class.st @@ -0,0 +1,5 @@ +Class { + #name : 'AbtShellProgramStarterWinPlatformSubApp', + #superclass : 'SubApplication', + #category : 'AbtShellProgramStarterWinPlatformSubApp' +} diff --git a/source/AbtShellProgramStarterWinPlatformSubApp/package.st b/source/AbtShellProgramStarterWinPlatformSubApp/package.st new file mode 100644 index 0000000..243e9f5 --- /dev/null +++ b/source/AbtShellProgramStarterWinPlatformSubApp/package.st @@ -0,0 +1,4 @@ +Package { + #name : 'AbtShellProgramStarterWinPlatformSubApp', + #vaParent : 'AbtShellProgramStarterApp' +} diff --git a/source/TonelLoaderModel/TonelLoaderGitParentBaseEditionStrategy.class.st b/source/TonelLoaderModel/TonelLoaderGitParentBaseEditionStrategy.class.st index 2b0308c..117f9d4 100644 --- a/source/TonelLoaderModel/TonelLoaderGitParentBaseEditionStrategy.class.st +++ b/source/TonelLoaderModel/TonelLoaderGitParentBaseEditionStrategy.class.st @@ -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. diff --git a/source/TonelWriterModel/TonelWriter.class.st b/source/TonelWriterModel/TonelWriter.class.st index 52851af..f32e319 100644 --- a/source/TonelWriterModel/TonelWriter.class.st +++ b/source/TonelWriterModel/TonelWriter.class.st @@ -6,7 +6,8 @@ Class { 'lineDelimiter', 'clearsSourcesDirectory', 'applications', - 'configurationMaps' + 'configurationMaps', + 'autoLoad' ], #classVars : [ 'LineDelimiter' @@ -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' } @@ -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 ] @@ -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 [ @@ -212,7 +246,8 @@ TonelWriter >> initializeOn: aFileSystem [ fileSystem := aFileSystem. lineDelimiter := self class lineDelimiter. - clearsSourcesDirectory := true + clearsSourcesDirectory := true. + autoLoad := true ] { #category : 'Accessing' }