2010-05-24 09:48 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* utils/hbmk2/hbmk2.prg
+ utils/hbmk2/examples/plug_moc.prg
+ Added experimental plugin system. Plugins are written in .prg
or .hrb and can be passed using '-plug=<.prg|.hrb>' option
or simply by passing '.hrb' filename from cmdline or .hbp/.hbm
files. Plugin names without dir component will be searched
in local dir, hbmk2 dir then PATH.
For the details of the calling protocol and available hbmk2
API calls and variables, pls check the example and hbmk2
source code.
Plugin is called from several build stages, in case of multiple
plugins all of them are called at each stage. The plugin
receives the stage name, hbmk2 context and a hash table for
custom variables. The variables are shared between stages and
plugins. Notice that hbmk2 isn't hbrun, so there is a limited
set of the Harbour language which you can use, this also ensures
that the plugins will behave like hbmk2 itself for the most part.
Nothing is finalized.
; The example is the working replica of moc detection logic found
inside hbqt.
This commit is contained in:
@@ -17,6 +17,28 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2010-05-24 09:48 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
+ utils/hbmk2/examples/plug_moc.prg
|
||||
+ Added experimental plugin system. Plugins are written in .prg
|
||||
or .hrb and can be passed using '-plug=<.prg|.hrb>' option
|
||||
or simply by passing '.hrb' filename from cmdline or .hbp/.hbm
|
||||
files. Plugin names without dir component will be searched
|
||||
in local dir, hbmk2 dir then PATH.
|
||||
For the details of the calling protocol and available hbmk2
|
||||
API calls and variables, pls check the example and hbmk2
|
||||
source code.
|
||||
Plugin is called from several build stages, in case of multiple
|
||||
plugins all of them are called at each stage. The plugin
|
||||
receives the stage name, hbmk2 context and a hash table for
|
||||
custom variables. The variables are shared between stages and
|
||||
plugins. Notice that hbmk2 isn't hbrun, so there is a limited
|
||||
set of the Harbour language which you can use, this also ensures
|
||||
that the plugins will behave like hbmk2 itself for the most part.
|
||||
Nothing is finalized.
|
||||
; The example is the working replica of moc detection logic found
|
||||
inside hbqt.
|
||||
|
||||
2010-05-23 20:54 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* utils/hbmk2/hbmk2.pt_BR.po
|
||||
* utils/hbmk2/hbmk2.hu_HU.po
|
||||
|
||||
60
harbour/utils/hbmk2/examples/plug_moc.prg
Normal file
60
harbour/utils/hbmk2/examples/plug_moc.prg
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2010 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* See COPYING for licensing terms.
|
||||
*/
|
||||
|
||||
FUNCTION hbmk2_plugin_moc( cState, hbmk2, hVars )
|
||||
LOCAL cMOC_BIN
|
||||
|
||||
SWITCH cState
|
||||
CASE "pre_c"
|
||||
|
||||
cMOC_BIN := GetEnv( "MOC_BIN" )
|
||||
IF Empty( cMOC_BIN )
|
||||
IF Empty( GetEnv( "HB_QT_MOC_BIN" ) )
|
||||
IF hbmk2[ "cPLAT" ] == "win"
|
||||
cMOC_BIN := GetEnv( "HB_WITH_QT" ) + "\..\bin\moc.exe"
|
||||
IF ! hb_FileExists( cMOC_BIN )
|
||||
hbmk2_OutErr( hbmk2[ "ctx" ], "HB_WITH_QT points to incomplete QT installation. moc executable not found." )
|
||||
RETURN NIL
|
||||
ENDIF
|
||||
ELSE
|
||||
cMOC_BIN := hbmk2_FindInPath( "moc", "/opt/qtsdk/qt/bin" )
|
||||
IF Empty( cMOC_BIN )
|
||||
cMOC_BIN := hbmk2_FindInPath( "moc", "/opt/qtsdk/qt/bin" )
|
||||
IF Empty( cMOC_BIN )
|
||||
hbmk2_OutErr( hbmk2[ "ctx" ], "HB_QT_MOC_BIN not set, could not autodetect" )
|
||||
RETURN NIL
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
hbmk2_OutStd( hbmk2[ "ctx" ], "Using QT 'moc' executable: " + cMOC_BIN + " (autodetected)" )
|
||||
ELSE
|
||||
IF hb_FileExists( GetEnv( "HB_QT_MOC_BIN" ) )
|
||||
cMOC_BIN := GetEnv( "HB_QT_MOC_BIN" )
|
||||
hbmk2_OutStd( hbmk2[ "ctx" ], "Using QT 'moc' executable: " + cMOC_BIN )
|
||||
ELSE
|
||||
hbmk2_OutErr( hbmk2[ "ctx" ], "HB_QT_MOC_BIN points to non-existent file. Make sure to set it to full path and filename of moc executable." )
|
||||
RETURN NIL
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
hVars[ "MOC_BIN" ] := cMOC_BIN
|
||||
|
||||
EXIT
|
||||
CASE "post_all"
|
||||
hbmk2_OutStd( hbmk2[ "ctx" ], "POST_ALL: " + hVars[ "MOC_BIN" ] )
|
||||
OTHERWISE
|
||||
IF hbmk2[ "lTRACE" ]
|
||||
hbmk2_OutStd( hbmk2[ "ctx" ], "@@ Entered plugin: " + cState )
|
||||
ENDIF
|
||||
ENDSWITCH
|
||||
|
||||
RETURN NIL
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user