2010-05-24 15:35 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* utils/hbmk2/hbmk2.prg
    + Upped warning level for plugins to -w3.

  * utils/hbmk2/examples/plug_moc.prg
    + Added -inc, -clean and -rebuild (IOW incremental) 
      support for moc plugin. It was tested OK in small 
      example.

  * utils/hbmk2/examples/plug_tpl.prg
    * Minor.
This commit is contained in:
Viktor Szakats
2010-05-24 13:36:22 +00:00
parent 8d46df007c
commit ccc18d5011
4 changed files with 58 additions and 19 deletions

View File

@@ -17,6 +17,18 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-05-24 15:35 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* utils/hbmk2/hbmk2.prg
+ Upped warning level for plugins to -w3.
* utils/hbmk2/examples/plug_moc.prg
+ Added -inc, -clean and -rebuild (IOW incremental)
support for moc plugin. It was tested OK in small
example.
* utils/hbmk2/examples/plug_tpl.prg
* Minor.
2010-05-24 14:17 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* utils/hbmk2/hbmk2.prg
* Moved some local variables to internal hbmk2 structure.

View File

@@ -17,15 +17,20 @@ FUNCTION hbmk2_plugin_moc( hbmk2 )
LOCAL cMOC_BIN
LOCAL aMOC
LOCAL aMOC_Dst
LOCAL cCommand
LOCAL cDst
LOCAL nError
LOCAL tmp
LOCAL tmp, tmp1, tmp2
LOCAL lBuildIt
SWITCH hbmk2[ "cSTATE" ]
CASE "pre_all"
aMOC_Dst := {}
/* Gather input parameters */
aMOC := {}
@@ -76,34 +81,56 @@ FUNCTION hbmk2_plugin_moc( hbmk2 )
cDst := hbmk2_FN_DirExtSet( "moc_" + tmp, hbmk2[ "cWorkDir" ], ".cpp" )
cCommand := cMOC_BIN +;
" " + hbmk2_FN_Escape( hbmk2_PathSepToTarget( hbmk2, tmp ), hbmk2[ "nCmd_Esc" ] ) +;
" -o " + hbmk2_FN_Escape( hbmk2_PathSepToTarget( hbmk2, cDst ), hbmk2[ "nCmd_Esc" ] )
IF hbmk2[ "lTRACE" ]
IF ! hbmk2[ "lQUIET" ]
hbmk2_OutStd( hbmk2, I_( "'moc' command:" ) )
ENDIF
OutStd( cCommand + _OUT_EOL )
IF hbmk2[ "lINC" ] .AND. ! hbmk2[ "lREBUILD" ]
lBuildIt := ! hb_FGetDateTime( cDst, @tmp2 ) .OR. ;
! hb_FGetDateTime( tmp, @tmp1 ) .OR. ;
tmp1 > tmp2
ELSE
lBuildIt := .T.
ENDIF
IF ! hbmk2[ "lDONTEXEC" ] .AND. ( nError := hb_processRun( cCommand ) ) != 0
hbmk2_OutErr( hbmk2, hb_StrFormat( I_( "Error: Running 'moc' executable. %1$s" ), hb_ntos( nError ) ) )
IF ! hbmk2[ "lQUIET" ]
OutErr( cCommand + _OUT_EOL )
IF lBuildIt
cCommand := cMOC_BIN +;
" " + hbmk2_FN_Escape( hbmk2_PathSepToTarget( hbmk2, tmp ), hbmk2[ "nCmd_Esc" ] ) +;
" -o " + hbmk2_FN_Escape( hbmk2_PathSepToTarget( hbmk2, cDst ), hbmk2[ "nCmd_Esc" ] )
IF hbmk2[ "lTRACE" ]
IF ! hbmk2[ "lQUIET" ]
hbmk2_OutStd( hbmk2, I_( "'moc' command:" ) )
ENDIF
OutStd( cCommand + _OUT_EOL )
ENDIF
IF ! hbmk2[ "lIGNOREERROR" ]
cRetVal := "error"
EXIT
IF ! hbmk2[ "lDONTEXEC" ] .AND. ( nError := hb_processRun( cCommand ) ) != 0
hbmk2_OutErr( hbmk2, hb_StrFormat( I_( "Error: Running 'moc' executable. %1$s" ), hb_ntos( nError ) ) )
IF ! hbmk2[ "lQUIET" ]
OutErr( cCommand + _OUT_EOL )
ENDIF
IF ! hbmk2[ "lIGNOREERROR" ]
cRetVal := "error"
EXIT
ENDIF
ELSE
hbmk2_AddInput_CPP( hbmk2, cDst )
AAdd( aMOC_Dst, cDst )
ENDIF
ELSE
hbmk2_AddInput_CPP( hbmk2, cDst )
AAdd( aMOC_Dst, cDst )
ENDIF
NEXT
ENDIF
hbmk2[ "vars" ][ "aMOC_Dst" ] := aMOC_Dst
EXIT
CASE "post_all"
IF ! hbmk2[ "lINC" ] .OR. hbmk2[ "lCLEAN" ]
AEval( hbmk2[ "vars" ][ "aMOC_Dst" ], {| tmp | FErase( tmp ) } )
ENDIF
ENDSWITCH
RETURN cRetVal

View File

@@ -9,7 +9,7 @@
* See COPYING for licensing terms.
*/
FUNCTION hbmk2_plugin_moc( hbmk2 )
FUNCTION hbmk2_plugin_tpl( hbmk2 )
LOCAL cMOC_BIN
LOCAL tmp

View File

@@ -5891,7 +5891,7 @@ STATIC PROCEDURE PlugIn_Load( hbmk )
hb_FNameSplit( cFileName, NIL, NIL, @cExt )
IF Lower( cExt ) == ".prg"
cFile := hb_compileBuf( "", "-n2", "-w0", "-es2", "-q0", cFileName )
cFile := hb_compileBuf( "", "-n2", "-w3", "-es2", "-q0", cFileName )
ELSE
cFile := hb_MemoRead( cFileName )
ENDIF