From 678f8c14acfef00a19fcf15a80e21ef67569cb07 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Tue, 25 May 2010 19:56:03 +0000 Subject: [PATCH] 2010-05-25 12:52 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + contrib/hbide/idedetect.prg + Added: -plugin= plugin to detect output target. * contrib/hbide/ideprojmanager.prg + Implemented: -plugin=( hb_dirBase() + "idedetect.prg" ). This implementation raises the barrier what was ailing hbIDE since long to detect the executable properly. Thanks Viktor, this is wonderful addition to hbMK2. --- harbour/ChangeLog | 12 +++++++ harbour/contrib/hbide/idedetect.prg | 42 ++++++++++++++++++++++++ harbour/contrib/hbide/ideprojmanager.prg | 27 +++++---------- 3 files changed, 62 insertions(+), 19 deletions(-) create mode 100644 harbour/contrib/hbide/idedetect.prg diff --git a/harbour/ChangeLog b/harbour/ChangeLog index eec142c3d9..6b71536d4a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,18 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-05-25 12:52 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + + contrib/hbide/idedetect.prg + + Added: -plugin= plugin to detect output target. + + * contrib/hbide/ideprojmanager.prg + + Implemented: -plugin=( hb_dirBase() + "idedetect.prg" ). + + This implementation raises the barrier what was ailing hbIDE + since long to detect the executable properly. + + Thanks Viktor, this is wonderful addition to hbMK2. + 2010-05-25 21:12 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg * '-plug=' option renamed to '-plugin=' diff --git a/harbour/contrib/hbide/idedetect.prg b/harbour/contrib/hbide/idedetect.prg new file mode 100644 index 0000000000..0e19b3e30e --- /dev/null +++ b/harbour/contrib/hbide/idedetect.prg @@ -0,0 +1,42 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * + * Copyright 1999-2010 Viktor Szakats (harbour.01 syenar.hu) + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit + * their web site at http://www.gnu.org/). + * + */ + +FUNCTION hbmk2_plugin_show_target( hbmk2 ) + + 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 + + ENDSWITCH + + RETURN "" + diff --git a/harbour/contrib/hbide/ideprojmanager.prg b/harbour/contrib/hbide/ideprojmanager.prg index baff516a2b..3352172402 100644 --- a/harbour/contrib/hbide/ideprojmanager.prg +++ b/harbour/contrib/hbide/ideprojmanager.prg @@ -1260,6 +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" ) IF lRebuild aadd( aHbp, "-rebuild" ) ENDIF @@ -1371,6 +1372,13 @@ 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 @@ -1439,25 +1447,6 @@ METHOD IdeProjManager:launchProject( cProject, cExe ) ENDIF cTargetFN := hbide_pathToOSPath( cTargetFN ) - #if 0 - IF !empty( cExe ) - hb_fNameSplit( cExe, , , @cExt ) - ENDIF - IF !empty( cExt ) .AND. lower( cExt ) == ".exe" - cTargetFN := cExe - ELSE - cTargetFN := hbide_pathFile( oProject:destination, iif( empty( oProject:outputName ), "_temp", oProject:outputName ) ) - #ifdef __PLATFORM__WINDOWS - IF oProject:type == "Executable" - cTargetFN += '.exe' - ENDIF - #endif - IF !hb_FileExists( cTargetFN ) - cTargetFN := oProject:launchProgram - ENDIF - ENDIF - #endif - IF ! hb_FileExists( cTargetFN ) cTmp := "Launch error: file not found - " + cTargetFN