2010-01-25 17:41 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)

* contrib/hbide/idemisc.prg
  * contrib/hbide/ideprojmanager.prg
  * contrib/hbide/resources/hbide.env
   - Dropped {shell} and {ext} placeholders from hbide.env.
     These are now auto detected, thanks Viktor.
This commit is contained in:
Pritpal Bedi
2010-01-26 01:40:20 +00:00
parent 3aac0d6f21
commit 83dd2dba6b
4 changed files with 80 additions and 16 deletions

View File

@@ -17,6 +17,13 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-01-25 17:41 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbide/idemisc.prg
* contrib/hbide/ideprojmanager.prg
* contrib/hbide/resources/hbide.env
- Dropped {shell} and {ext} placeholders from hbide.env.
These are now auto detected, thanks Viktor.
2010-01-25 12:24 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbide/hbide.prg
! Important Fix.

View File

@@ -1076,3 +1076,54 @@ FUNCTION hbide_buildLinesLabel( nFrom, nTo, nW, nMax )
RETURN s
/*----------------------------------------------------------------------*/
FUNCTION hbide_getShellCommandsTempFile( aCmd )
LOCAL cExt
LOCAL cPrefix
LOCAL fhnd
LOCAL cCmdFileName
LOCAL cCmdFile
LOCAL tmp
#if defined( __PLATFORM__WINDOWS )
cExt := ".bat"
cPrefix := ""
#elif defined( __PLATFORM__OS2 )
cExt := ".cmd"
cPrefix := ""
#elif defined( __PLATFORM__UNIX )
cExt := ".sh"
cPrefix := "#!/bin/sh" + hb_osNewLine()
#endif
IF ! Empty( cExt )
cCmdFile := cPrefix
FOR EACH tmp IN aCmd
cCmdFile += tmp + hb_osNewLine()
NEXT
IF ( fhnd := hb_FTempCreateEx( @cCmdFileName, NIL, NIL, cExt ) ) != F_ERROR
FWrite( fhnd, cCmdFile )
FClose( fhnd )
ENDIF
ENDIF
RETURN cCmdFileName
/*----------------------------------------------------------------------*/
FUNCTION hbide_getShellCommand()
LOCAL cShellCmd
#if defined( __PLATFORM__WINDOWS )
cShellCmd := hb_getenv( "COMSPEC" )
#elif defined( __PLATFORM__OS2 )
cShellCmd := hb_getenv( "COMSPEC" )
#elif defined( __PLATFORM__UNIX )
cShellCmd := ""
#endif
RETURN cShellCmd
/*----------------------------------------------------------------------*/

View File

@@ -170,9 +170,22 @@ METHOD IdeEnvironments:parse( aContents )
/*----------------------------------------------------------------------*/
METHOD IdeEnvironments:prepareBatch( cEnviron )
LOCAL n, cFile := space( 255 ), s, k, nHandle, a_
LOCAL n, s, a_, aCmd
LOCAL cFile := space( 255 )
//LOCAL k, nHandle
IF ( n := ascan( ::aEnvrns, {|e_| e_[ 1 ] == cEnviron } ) ) > 0
aCmd := {}
FOR EACH a_ IN ::aEnvrns[ n, 2 ]
s := a_[ 1 ]
IF s == "content"
aadd( aCmd, a_[ 2 ] )
ENDIF
NEXT
cFile := hbide_getShellCommandsTempFile( aCmd )
#if 0
IF ( nHandle := HB_FTempCreateEx( @cFile, NIL, "ide_", ".bat" ) ) > 0
k := ""
FOR EACH a_ IN ::aEnvrns[ n, 2 ]
@@ -184,6 +197,7 @@ METHOD IdeEnvironments:prepareBatch( cEnviron )
fWrite( nHandle, k )
fClose( nHandle )
ENDIF
#endif
ENDIF
RETURN cFile
@@ -1191,14 +1205,15 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt )
::oProcess:workingPath := ::oProject:wrkDirectory
#if 1
cCmd := "cmd.exe"
cCmd := hbide_getShellCommand()
hbide_dbg( cCmd )
IF empty( ::cBatch )
::oProcess:addArg( "/c " + cExeHbMk2 + " " + cHbpPath + iif( ::lPPO, " -hbraw", "" ) )
::oProcess:addArg( "/C " + cExeHbMk2 + " " + cHbpPath + iif( ::lPPO, " -hbraw", "" ) )
ELSE
::oProcess:addArg( "/c " + ::cBatch + " && " + cExeHbMk2 + " " + cHbpPath + iif( ::lPPO, " -hbraw", "" ) )
::oProcess:addArg( "/C " + ::cBatch + " && " + cExeHbMk2 + " " + cHbpPath + iif( ::lPPO, " -hbraw", "" ) )
ENDIF
#else
cCmd := "cmd.exe /c " + ::cBatch + " && " + cExeHbMk2 + " " + cHbpPath + iif( ::lPPO, " -hbraw", "" )
cCmd := cCmd + ::cBatch + " && " + cExeHbMk2 + " " + cHbpPath + iif( ::lPPO, " -hbraw", "" )
#endif
::oProcess:start( cCmd )

View File

@@ -1,13 +1,9 @@
[ COMMON ]
PLATFORM = win
COMPILER = bcc
SHELL = cmd.exe
EXT = bat
PLATFORM = win
COMPILER = bcc
[ BCC55 5.5.1 Command Line Tools ]
{hb_comp} bcc
{shell} cmd.exe
{ext} bat
{content} set HB_COMPILER=bcc
{content} set PATH=c:\harbour;c:\harbour\bcc\bin;C:\harbour\harbour\bcc\bin;
@@ -20,8 +16,6 @@ EXT = bat
[ MSVC 8.0 ]
{hb_comp} msvc
{shell} cmd.exe
{ext} bat
{content} call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
{content} set PATH=c:\harbour;%ProgramFiles%\Microsoft Visual Studio 9.0\VC\bin;%path%
{content} set PATH=c:\harbour;;C:\harbour\harbour\msvc\bin;%path%
@@ -30,8 +24,6 @@ EXT = bat
[ Pelles C ]
{hb_comp} pocc
{shell} cmd.exe
{ext} bat
{content} set PATH=c:\harbour\pellesc\bin;
{content} set INCLUDE=c:\harbour\pellesc\include;c:\harbour\pellesc\include\win;%INCLUDE%
{content} set LIB=c:\harbour\pellesc\lib;c:\harbour\pellesc\lib\win;%LIB%
@@ -49,7 +41,6 @@ EXT = bat
[ MINGW 4.0.0 Linux - A Skeleton ]
{hb_comp} mingw
{shell}.sh
{content} shell command 1
{content} shell command 2