Adotei um esquema de trabalho que estou achando legal.
Talvez seja necessário pra Sefazclass, não sei se o Harbour 3.2 está seguindo o mesmo esquema.
Vale a pena entender, porque vale pra qualquer lib.
Postar por parte.

Moderador: Moderadores
compr=yes
strip=yes
prgflags= -m -n -ge1 -w3 -es2
libpaths=d:/cdrom/fontes/integra/sefazclass d:/cdrom/fontes/integra/josequintas d:\cvsfiles\allgui\allgui
mt=yes
Description=any
libs=hbhpdf.hbc hbzebra.hbc hbwin.hbc hbct.hbc sefazclass
libpaths=lib\${hb_plat}\${hb_comp}
Description=any
libs=josequintas sefazclass.hbc
libs=sefazclass.hbc hbhpdf.hbc hbwin.hbc hbzebra.hbc gtwvg.hbc hbct.hbc hbtip.hbc
libpaths=lib\${hb_plat}\${hb_comp}
incpaths=include
incpaths=..\..\build
Description=hmge.hbc
incpaths=..\hmge\include
libs=allgui.hbc hmge
REQUEST errorsys
#include "directry.ch"
FUNCTION Main( ... )
LOCAL cDateTime, cTxt, nBuildNum, cFileName, cLastPath, aParams
SetMode( 38, 132 )
aParams := hb_AParams()
cFileName := hb_FNameDir( hb_ProgName() ) + hb_FNameName( hb_ProgName() )
cDateTime := Dtos( Date() ) + Substr( Time(), 1, 2 ) + Substr( Time(), 4, 2 )
cTxt := MemoRead( cFileName + ".xml" )
nBuildNum := Val( XmlNode( cTxt, "BuildNum" ) ) + 1
cLastPath := XmlNode( cTxt, "LastPath" )
IF ! Upper( cLastPath ) == Upper( hb_cwd() )
DeleteContent( "c:\temp", .F. )
ENDIF
cTxt := "#define JOSEQUINTAS_VERSAO " + ["] + Transform( cDateTime, "@R 9999.99.99.9999" ) + ["] + hb_Eol()
cTxt += "#define JOSEQUINTAS_VERSAO_RC " + Transform( cDateTime, "@R 9999,99,99,9999" ) + hb_Eol()
hb_MemoWrit( cFileName + ".ch", cTxt )
cTxt := XmlTag( "BuildNum", Ltrim( Str( nBuildNum ) ) ) + hb_Eol()
cTxt += XmlTag( "LastPath", hb_cwd() ) + hb_Eol()
cTxt += XmlTag( "BuildDate", Dtos( Date() ) ) + hb_Eol()
cTxt += XmlTag( "BuildTime", Time() ) + hb_Eol()
hb_MemoWrit( cFileName + ".xml", cTxt )
Compile( aParams )
RETURN NIL
STATIC FUNCTION DeleteContent( cFolder, lDeleteFolder )
LOCAL oFiles, oFile
hb_Default( lDeleteFolder, .F. )
? "Delete " + cFolder
oFiles := Directory( "c:\temp\*.*" )
FOR EACH oFile IN oFiles
IF oFile[ F_ATTR ] == "D"
IF oFile[ F_NAME ] != "." .AND. oFile[ F_NAME ] != ".."
DeleteContent( cFolder + "\" + oFile[ F_NAME ], .T. )
ENDIF
ELSE
? "Deleting " + cFolder + "\" + oFile[ F_NAME ]
fErase( cFolder + "\" + oFile[ F_NAME ] )
ENDIF
NEXT
IF lDeleteFolder
DirRemove( cFolder )
ENDIF
RETURN NIL
FUNCTION HB_GT_SYS()
REQUEST HB_GT_WVG_DEFAULT
RETURN NIL
STATIC FUNCTION Compile( aParams )
LOCAL oElement, cPath, cCmd
cPath := Upper( hb_cwd() )
AAdd( aParams, "-m" )
AAdd( aParams, "-n" )
AAdd( aParams, "-w3" )
AAdd( aParams, "-es2" )
AAdd( aParams, "-workdir=c:\temp" )
AAdd( aParams, "-compr" )
AAdd( aParams, "-strip" )
AAdd( aParams, "-mt" )
AAdd( aParams, "-quiet" )
AAdd( aParams, "-ge1" )
AAdd( aParams, "-I" + hb_FNameDir( hb_ProgName() ) )
DO CASE
CASE "\HMGE\" $ cPath ; AAdd( aParams, "hmge.hbc" )
CASE "\HMG3\" $ cPath ; AAdd( aParams, "hmg3.hbc" )
CASE "\OOHG" $ cPath ; AAdd( aParams, "oohg.hbc" )
CASE "\HWGUI\" $ cPath ; AAdd( aParams, "hwgui.hbc" )
ENDCASE
cCmd := "hbmk2"
IF Len( Directory( "*.hbp" ) ) != 0
cCmd += " *.hbp"
ELSEIF Len( Directory( "*.prg" ) ) != 0
cCmd += " *.prg *.rc"
ELSEIF Upper( hb_cwd() ) == "D:\CDROM\FONTES\INTEGRA\JOSEQUINTAS\"
LIBJosequintas()
cCmd += " *.hbp"
ELSE
? hb_cwd()
Inkey(0)
ENDIF
FOR EACH oElement IN aParams
cCmd += " " + oElement
NEXT
cCmd := ;
hb_ProgName() + " %*" + hb_Eol() + ;
cCmd + hb_Eol()
DO CASE
CASE "\INTEGRA\" $ cPath .AND. File( "jpa.exe" ); cCmd += "if not errorlevel 1 assina jpa.exe" + hb_Eol()
CASE "\HAROLDO\" $ cPath .AND. File( "hl.exe" ); cCmd += "if not errorlevel 1 assina hl.exe" + hb_Eol()
CASE "\LABOROIL\" $ cPath .AND. File( "nfe.exe" ); cCmd += "if not errorlevel 1 assina nfe.exe" + hb_Eol()
CASE "\SJPA\" $ cPath .AND. File( "..\sjpa.exe" ); cCmd += "if not errorlevel 1 assina ..\sjpa.exe" + hb_Eol()
CASE "\BUILD\" $ cPath .AND. File( "build.exe" ); cCmd += "if not errorlevel 1 assina build.exe" + hb_Eol()
ENDCASE
hb_MemoWrit( "d:\tools\util\c.bat", cCmd )
RETURN NIL
STATIC FUNCTION LIBJoseQuintas()
LOCAL aDir, oElement, cTxt
? "LIB JOSEQUINTAS"
cTxt := ;
"Description=any" + hb_Eol() + ;
"libs=josequintas sefazclass.hbc" + hb_Eol() + ;
"libs=sefazclass.hbc hbhpdf.hbc hbwin.hbc hbzebra.hbc gtwvg.hbc hbct.hbc hbtip.hbc" + hb_Eol() + ;
"libpaths=lib\${hb_plat}\${hb_comp}" + hb_Eol() + ;
"incpaths=include" + hb_Eol() + ;
"incpaths=..\..\build" + hb_Eol()
hb_MemoWrit( "josequintas.hbc", cTxt )
cTxt := ""
aDir := Directory( "source\*.*", "D" )
FOR EACH oElement IN aDir
IF "D" $ oElement[ F_ATTR ] .AND. ! oElement[ F_NAME ] $ ".,.."
cTxt += "source\" + Lower( oElement[ 1 ] ) + "\*.prg" + hb_Eol()
ENDIF
NEXT
FOR EACH oElement IN { ;
"-workdir=c:\temp", ;
"-hblib", ;
"-olib\${hb_plat}\${hb_comp}\${hb_name}", ;
"-hbx=${hb_name}", ;
"-w3", ;
"-es2", ;
"-m", ;
"-n" }
cTxt += oElement + hb_Eol()
NEXT
hb_MemoWrit( "josequintas.hbp", cTxt )
RETURN NIL
<BuildNum>6710</BuildNum>
<LastPath>d:\cdrom\FONTES\INTEGRA\</LastPath>
<BuildDate>20170731</BuildDate>
<BuildTime>18:49:09</BuildTime>
<BuildNum>7094</BuildNum>
<LastPath>d:\cdrom\FONTES\LABOROIL\</LastPath>
<BuildDate>20170805</BuildDate>
<BuildTime>11:58:29</BuildTime>
hazael escreveu:Outra coisa, não sei se conhece, mas se o seus projetos tiverem o arquivo: proj.hbp então só precirará compilar assim: hbmk2 proj sem precisar adicionar nada, eu uso para todos projetos e é muito prático
hazael escreveu:é isso que o hbmk2 faz em muitos caso
hazael escreveu:Bem, notei outra coisa, se for adicionar imagem (logo), vai perceber que em cada documento tem um formato diferente... o ideal seria manter tudo igual sem achatar, ou esticar, senão fica distorcido.
Retornar para Contribuições, Dicas e Tutoriais
Usuários vendo este fórum: Nenhum usuário registrado online e 24 visitantes