Build Program: Post-process

The Class

The set_mod_timestamp class is a simple example of an observer that listens for the post-process event of the Incremental Build / Program.

API Documentation

Click HERE to view the API documentation for this class. The complete documentation for all of the classes can be found in the API Reference.

Source Code

Click HERE to view the source code for the class.

Do the Work

The update() method has been modified to perform specific actions for the post process.

Post-Process
Set the modification timestamp of the output file to match that of the source file.
update:
enter aPvxState 

	local psMajor$,psMinor$,source,dest$,enfState,x,destObj,fileObj,projObj,sysType$, \
		utcMTime,secondsIntoDay,dayHours,dayMinutes,daySeconds,julDay,theCmd$

	! Get the Major/Minor codes that identify the current action
	psMajor$=aPvxState'getMajor$(), \
	psMinor$=aPvxState'getMinor$()

	! Check the current state of processing for the ProvideX Event Manager
	enfState=aPvxState'getArgumentValue(_pvxConstants'_iEventNotificationFlag$)

	/*
	 * This observer is for the program build event only; all other events
	 * should be ignored.
	 */
	switch psMajor$ + "|" + psMinor$

	! Build a ProvideX program
	case _pvxConstants'Incremental_Build$ + "|" + _pvxConstants'BuildType_BuildOne$
	case _pvxConstants'Incremental_Build_Alt_Exe$ + "|" + _pvxConstants'BuildType_BuildOne$
	
		switch enfState
		case _pvxConstants'_idePostProcess
			_obj'set_timestamp(aPvxtate)
			break
		end switch
	end switch
return 0