From 924c97055e208f3c261340a4860b60cd2a8d6806 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 25 May 2010 20:29:55 +0000 Subject: [PATCH] 2010-05-25 22:28 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbide/ideprojmanager.prg ! Fixed output directory issue without the need for an hbmk2 plugin. HBIDE was changing current dir when calling hbmk2, so the detected output filename needs to be rebased from that directory. * contrib/hbide/ideprojmanager.prg - contrib/hbide/idedetect.prg + contrib/hbide/resources/hbmk2_plugin_hbide.prg * Moved plugin to resources directory. - Commented plugin content. * utils/hbmk2/hbmk2.prg * Cleaned up path seps in plugin filenames. --- harbour/ChangeLog | 17 ++++++++++++++- harbour/contrib/hbide/ideprojmanager.prg | 11 +++------- .../hbmk2_plugin_hbide.prg} | 21 +++++++++---------- harbour/utils/hbmk2/hbmk2.prg | 12 +++++------ 4 files changed, 35 insertions(+), 26 deletions(-) rename harbour/contrib/hbide/{idedetect.prg => resources/hbmk2_plugin_hbide.prg} (72%) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6b71536d4a..91872a9501 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,21 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-05-25 22:28 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbide/ideprojmanager.prg + ! Fixed output directory issue without the need for an hbmk2 plugin. + HBIDE was changing current dir when calling hbmk2, so the detected + output filename needs to be rebased from that directory. + + * contrib/hbide/ideprojmanager.prg + - contrib/hbide/idedetect.prg + + contrib/hbide/resources/hbmk2_plugin_hbide.prg + * Moved plugin to resources directory. + - Commented plugin content. + + * utils/hbmk2/hbmk2.prg + * Cleaned up path seps in plugin filenames. + 2010-05-25 12:52 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + contrib/hbide/idedetect.prg + Added: -plugin= plugin to detect output target. @@ -25,7 +40,7 @@ + Implemented: -plugin=( hb_dirBase() + "idedetect.prg" ). This implementation raises the barrier what was ailing hbIDE - since long to detect the executable properly. + since long to detect the executable properly. Thanks Viktor, this is wonderful addition to hbMK2. diff --git a/harbour/contrib/hbide/ideprojmanager.prg b/harbour/contrib/hbide/ideprojmanager.prg index 3352172402..6580dfc23c 100644 --- a/harbour/contrib/hbide/ideprojmanager.prg +++ b/harbour/contrib/hbide/ideprojmanager.prg @@ -1260,7 +1260,7 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt ) aadd( aHbp, "-info" ) aadd( aHbp, "-lang=en" ) aadd( aHbp, "-width=512" ) - aadd( aHbp, "-plugin=" + hb_dirBase() + "idedetect.prg" ) + aadd( aHbp, "-plugin=" + hb_dirBase() + "resources/hbmk2_plugin_hbide.prg" ) IF lRebuild aadd( aHbp, "-rebuild" ) ENDIF @@ -1372,13 +1372,6 @@ METHOD IdeProjManager:finished( nExitCode, nExitStatus, oProcess ) IF ::lLaunch cTmp := ::oOutputResult:oWidget:toPlainText() cExe := "" - IF empty( cExe ) - cTkn := "TARGET (ABSOLUTE): " - IF ( n := at( cTkn, cTmp ) ) > 0 - n1 := hb_at( Chr( 10 ), cTmp, n + len( cTkn ) ) - cExe := StrTran( substr( cTmp, n + len( cTkn ), n1 - n - len( cTkn ) ), Chr( 13 ) ) - ENDIF - ENDIF IF empty( cExe ) cTkn := "hbmk2: Linking... " IF ( n := at( cTkn, cTmp ) ) > 0 @@ -1394,6 +1387,8 @@ METHOD IdeProjManager:finished( nExitCode, nExitStatus, oProcess ) ENDIF ENDIF + cExe := hbide_PathProc( cExe, hbide_pathToOSPath( ::oProject:location ) ) + ::outputText( " " ) IF empty( cExe ) ::outputText( "" + "Executable could not been detected from linker output!" + "" ) diff --git a/harbour/contrib/hbide/idedetect.prg b/harbour/contrib/hbide/resources/hbmk2_plugin_hbide.prg similarity index 72% rename from harbour/contrib/hbide/idedetect.prg rename to harbour/contrib/hbide/resources/hbmk2_plugin_hbide.prg index 0e19b3e30e..f2648e49b7 100644 --- a/harbour/contrib/hbide/idedetect.prg +++ b/harbour/contrib/hbide/resources/hbmk2_plugin_hbide.prg @@ -25,18 +25,17 @@ * */ -FUNCTION hbmk2_plugin_show_target( hbmk2 ) +FUNCTION hbmk2_plugin_show_target( hbmk2 ) - SWITCH hbmk2[ "cSTATE" ] - CASE "post_all" + SWITCH hbmk2[ "cSTATE" ] + CASE "post_all" - IF hbmk2[ "nErrorLevel" ] == 0 - hbmk2_OutStd( hbmk2, "@@ TARGET: " + hbmk2[ "cTARGETTYPE" ] + " : " + hbmk2[ "cTARGETNAME" ] ) - hbmk2_OutStd( hbmk2, "@@ TARGET (ABSOLUTE): " + hbmk2_PathMakeAbsolute( hbmk2[ "cTARGETNAME" ], hbmk2_Macro( hbmk2, "${hb_curdir}" ) ) ) - ENDIF - EXIT +// IF hbmk2[ "nErrorLevel" ] == 0 +// hbmk2_OutStd( hbmk2, "@@ TARGET: " + hbmk2[ "cTARGETTYPE" ] + " : " + hbmk2[ "cTARGETNAME" ] ) +// hbmk2_OutStd( hbmk2, "@@ TARGET (ABSOLUTE): " + hbmk2_PathMakeAbsolute( hbmk2[ "cTARGETNAME" ], hbmk2_Macro( hbmk2, "${hb_curdir}" ) ) ) +// ENDIF + EXIT - ENDSWITCH - - RETURN "" + ENDSWITCH + RETURN "" diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 67b65a0d6c..30c9d6477f 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -2080,9 +2080,9 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) CASE Left( cParamL, Len( "-plugin=" ) ) == "-plugin=" - cParam := PathProc( MacroProc( hbmk, SubStr( cParam, Len( "-plugin=" ) + 1 ), aParam[ _PAR_cFileName ] ), aParam[ _PAR_cFileName ] ) - IF ( tmp := FindInPathPlugIn( PathSepToSelf( cParam ) ) ) != NIL - AAdd( hbmk[ _HBMK_aPLUGIN ], PathSepToTarget( hbmk, tmp ) ) + cParam := PathNormalize( PathProc( PathSepToSelf( MacroProc( hbmk, SubStr( cParam, Len( "-plugin=" ) + 1 ), aParam[ _PAR_cFileName ] ) ), aParam[ _PAR_cFileName ] ) ) + IF ( tmp := FindInPathPlugIn( cParam ) ) != NIL + AAdd( hbmk[ _HBMK_aPLUGIN ], tmp ) ELSE IF hbmk[ _HBMK_lInfo ] hbmk_OutStd( hbmk, hb_StrFormat( I_( "Warning: Plugin not found: %1$s" ), cParam ) ) @@ -7267,9 +7267,9 @@ STATIC FUNCTION HBC_ProcessOne( hbmk, cFileName, nNestingLevel ) CASE Lower( Left( cLine, Len( "plugins=" ) ) ) == "plugins=" ; cLine := SubStr( cLine, Len( "plugins=" ) + 1 ) - cLine := PathProc( MacroProc( hbmk, cLine, cFileName ), FN_DirGet( cFileName ) ) - IF ( tmp := FindInPathPlugIn( PathSepToSelf( cLine ) ) ) != NIL - AAdd( hbmk[ _HBMK_aPLUGIN ], PathSepToTarget( hbmk, tmp ) ) + cLine := PathNormalize( PathProc( PathSepToSelf( MacroProc( hbmk, cLine, cFileName ) ), FN_DirGet( cFileName ) ) ) + IF ( tmp := FindInPathPlugIn( cLine ) ) != NIL + AAdd( hbmk[ _HBMK_aPLUGIN ], tmp ) ELSE IF hbmk[ _HBMK_lInfo ] hbmk_OutStd( hbmk, hb_StrFormat( I_( "Warning: Plugin not found: %1$s" ), cLine ) )