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 <Working Directory> is empty 
              <Working Directory> == <Project Location>
           .hbp will be placed in <Working Directory> as
              <Working Directory>/<Output Name>.hbp
           .hbp will include 
              -workdir=<Working Directory>/${hb_plat}/${hb_compl}

        2. If <Destination Folder> is empty
             <Destination Folder> == <Project Location>
           .hbp will include 
              -o<Destination Folder>/<Output Name>

        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 >
This commit is contained in:
Pritpal Bedi
2010-01-22 23:22:24 +00:00
parent d24c53c741
commit 35ac0b5724
2 changed files with 45 additions and 18 deletions

View File

@@ -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 <Working Directory> is empty
<Working Directory> == <Project Location>
.hbp will be placed in <Working Directory> as
<Working Directory>/<Output Name>.hbp
.hbp will include
-workdir=<Working Directory>/${hb_plat}/${hb_compl}
2. If <Destination Folder> is empty
<Destination Folder> == <Project Location>
.hbp will include
-o<Destination Folder>/<Output Name>
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

View File

@@ -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()