From 35ac0b57245593558d03f8e563fcc17a3264363a Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Fri, 22 Jan 2010 23:22:24 +0000 Subject: [PATCH] 2010-01-22 15:07 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbide/ideprojmanager.prg % Changed the behavior of placement of project components. 1 If is empty == .hbp will be placed in as /.hbp .hbp will include -workdir=/${hb_plat}/${hb_compl} 2. If is empty == .hbp will include -o/ This has facilitated to build projects from any location. < Example follows on the mailing-list taking Angel Pais's recent sent hbXBP based small application which bears the 99% Xbase++ code > --- harbour/ChangeLog | 20 +++++++++++ harbour/contrib/hbide/ideprojmanager.prg | 43 ++++++++++++++---------- 2 files changed, 45 insertions(+), 18 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 980045523d..3d37965e17 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,26 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-22 15:07 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbide/ideprojmanager.prg + % Changed the behavior of placement of project components. + 1 If is empty + == + .hbp will be placed in as + /.hbp + .hbp will include + -workdir=/${hb_plat}/${hb_compl} + + 2. If is empty + == + .hbp will include + -o/ + + This has facilitated to build projects from any location. + < Example follows on the mailing-list taking Angel Pais's + recent sent hbXBP based small application which bears + the 99% Xbase++ code > + 2010-01-22 23:46 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/rdd/dbf1.c ! fixed trailing character in empty DBF file - thanks to Saulius diff --git a/harbour/contrib/hbide/ideprojmanager.prg b/harbour/contrib/hbide/ideprojmanager.prg index c24e2348c3..a833498312 100644 --- a/harbour/contrib/hbide/ideprojmanager.prg +++ b/harbour/contrib/hbide/ideprojmanager.prg @@ -141,6 +141,13 @@ METHOD IdeProject:new( aProps ) ::dotHbp := "" ::compilers := "" + IF empty( ::destination ) + ::destination := ::location + ENDIF + IF empty( ::wrkDirectory ) + ::wrkDirectory := ::location + ENDIF + FOR EACH a_ IN ::metaData a_[ 2 ] := hbide_pathNormalized( a_[ 2 ], .f. ) NEXT @@ -904,8 +911,7 @@ METHOD IdeProjManager:promptForPath( cObjPathName, cTitle, cObjFileName, cObjPat /*----------------------------------------------------------------------*/ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt ) - LOCAL cOutput, cErrors, cHbpPath, qStringList, oEdit - LOCAL cTmp, nResult, cTargetFN + LOCAL cOutput, cErrors, cHbpPath, qStringList, oEdit, cHbpFN, cTmp, nResult, cTargetFN LOCAL aHbp := {} DEFAULT lLaunch TO .F. @@ -933,14 +939,14 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt ) ::oProject := ::getProjectByTitle( cProject ) - cTargetFN := hbide_pathToOSPath( ::oProject:location + ::pathSep + ; - iif( empty( ::oProject:outputName ), "_temp", ::oProject:outputName ) ) - /* - * Creates a temporary file to avoid erase the file. Hbp correct this project. - * 26/12/2009 - 04:17:56 - vailtom - */ - //cHbpPath := cTargetFN + iif( ::lPPO, '.' + hb_md5( hb_ntos( seconds() ) ), "" ) + ".hbp" - cHbpPath := cTargetFN + iif( ::lPPO, '._tmp', "" ) + ".hbp" + cTargetFN := hbide_pathToOSPath( ::oProject:destination + ::pathSep + ; + iif( empty( ::oProject:outputName ), "_temp", ::oProject:outputName ) ) + + cHbpFN := hbide_pathToOSPath( ::oProject:wrkDirectory + ::pathSep + ; + iif( empty( ::oProject:outputName ), "_temp", ::oProject:outputName ) ) + + //cHbpPath := cHbpFN + iif( ::lPPO, '.' + hb_md5( hb_ntos( seconds() ) ), "" ) + ".hbp" + cHbpPath := cHbpFN + iif( ::lPPO, '._tmp', "" ) + ".hbp" IF !( ::lPPO ) IF ::oProject:type == "Lib" @@ -961,6 +967,7 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt ) aadd( aHbp, " " ) IF !( ::lPPO ) aadd( aHbp, "-o" + cTargetFN ) + aadd( aHbp, "-workdir=" + ::oProject:wrkDirectory + "/${hb_plat}/${hb_comp}" ) ENDIF aadd( aHbp, "-q" ) aadd( aHbp, "-trace" ) @@ -1045,7 +1052,7 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt ) ENDIF qStringList:append( cHbpPath ) // - ::qProcess:setWorkingDirectory( ::oProject:wrkDirectory() ) + ::qProcess:setWorkingDirectory( ::oProject:wrkDirectory ) // ::qProcess:start( "hbmk2", qStringList ) #endif @@ -1165,7 +1172,7 @@ METHOD IdeProjManager:readProcessInfo( nMode, i, ii ) * 03/01/2010 - 09:24:50 */ METHOD IdeProjManager:launchProject( cProject ) - LOCAL qProcess, cTargetFN, cTmp, aPrj, n + LOCAL qProcess, cTargetFN, cTmp, oProject IF empty( cProject ) cProject := ::oPM:getCurrentProject() @@ -1174,13 +1181,13 @@ METHOD IdeProjManager:launchProject( cProject ) RETURN Self ENDIF - n := ascan( ::aProjects, {|e_, x| x := e_[ 3 ], x[ 1, 2, PRJ_PRP_TITLE ] == cProject } ) - aPrj := ::aProjects[ n,3 ] + oProject := ::getProjectByTitle( cProject ) + + cTargetFN := hbide_pathToOSPath( oProject:destination + ::pathSep + ; + iif( empty( oProject:outputName ), "_temp", oProject:outputName ) ) - cTargetFN := aPrj[ PRJ_PRP_PROPERTIES, 2, PRJ_PRP_LOCATION ] + ::pathSep + aPrj[ PRJ_PRP_PROPERTIES, 2, PRJ_PRP_OUTPUT ] - cTargetFN := hbide_pathToOSPath( cTargetFN ) #ifdef __PLATFORM__WINDOWS - IF aPrj[ PRJ_PRP_PROPERTIES, 2, E_qPrjType ] == "Executable" + IF::oProject:type == "Executable" cTargetFN += '.exe' ENDIF #endif @@ -1188,7 +1195,7 @@ METHOD IdeProjManager:launchProject( cProject ) IF !hb_FileExists( cTargetFN ) cTmp := "Launch application error: file not found " + cTargetFN + "!" - ELSEIF aPrj[ PRJ_PRP_PROPERTIES, 2, E_qPrjType ] == "Executable" + ELSEIF ::oProject:type == "Executable" cTmp := "Launch application " + cTargetFN + "... " qProcess := QProcess():new()