vscode hbmk2 vcvarsall

User avatar
fgondi
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España
Contact:

vscode hbmk2 vcvarsall

Post by fgondi »

Estiamos,

Estoy empezando a usar vscode.

Me gustaria saber como puedo crear el json para que genere el ejecutable con "vcvarsall.bat" y "hbmk2" con todos los prg que tenga el projecto.

Actualmente las pruebas las estoy realizando ejecutando manualmente un bat.

Code: Select all | Expand

call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
c:\harbour\bin\hbmk2 tutor04.hbp -comp=msvc
tutor04.exe


creando el archivo tutor04.hbp
Pero con esta opción tendría que ir añadiendo uno a uno los prg en el archivo.

Code: Select all | Expand

-gui

-Ic:\fwh\include

tutor04.prg

-Lc:\fwh\lib

-lFiveH32
-lFiveHC32

-lgdiplus
-lole32
-lOleDlg
-lversion

xhb.hbc
hbct.hbc
hbwin.hbc
hbmzip.hbc
hbziparc.hbc
hbfoxpro.hbc

-ldflag=/NODEFAULTLIB:msvcrt

tutor04
Un saludo
Fernando González Diez
ALSIS Sistemas Informáticos
User avatar
Antonio Linares
Site Admin
Posts: 42511
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: vscode hbmk2 vcvarsall

Post by Antonio Linares »

Estimado Fernando,

Estás usando alguna extensión de vscode para la gestión de proyectos ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
fgondi
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España
Contact:

Re: vscode hbmk2 vcvarsall

Post by fgondi »

Estimado Antonio,

He instalado las he ido viendo que en el foro se usan.

- Git
- Spanish Language Pack Para español
- Harbour and xHarbour de Antonino Perricone
- Vscode-Icons
- Clipboard History
- Project Manager
- Task
- CTags
Un saludo
Fernando González Diez
ALSIS Sistemas Informáticos
User avatar
VictorCasajuana
Posts: 269
Joined: Wed Mar 28, 2018 4:38 pm
Location: Vinaròs
Has thanked: 1 time
Contact:

Re: vscode hbmk2 vcvarsall

Post by VictorCasajuana »

--------
¿ Y porque no ?
¿ And why not ?
User avatar
fgondi
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España
Contact:

Re: vscode hbmk2 vcvarsall

Post by fgondi »

Hola,


De momento he construido el archivo .hbp para que llame a todos los prgs de una carpeta.
Sin embargo, esto implica que todas las veces se van a compilar todos los prgs.


Actualmente uso uestudio y sólo compila los prgs que han variado, ya que me facilita las pruebas del executable
Un saludo
Fernando González Diez
ALSIS Sistemas Informáticos
User avatar
Antonio Linares
Site Admin
Posts: 42511
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: vscode hbmk2 vcvarsall

Post by Antonio Linares »

Estimado Fernando,

> Sin embargo, esto implica que todas las veces se van a compilar todos los prgs

Eso no debería ser asi, ya que el make debería comparar las fechas de los PRGs y el EXE resultante y no compilar los PRGs en los que no han habido cambios
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
fgondi
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España
Contact:

Re: vscode hbmk2 vcvarsall

Post by fgondi »

Hola Antonio,

¿Y quién se encarga de comprobarlo?, ¿Hbmk2?

Me imagino que haya que indicar una ruta donde guarde los .obj y/o los .c, y así los pueda usar.
En los ejemplos hbp que he encontrado en el foro, no indican una ruta para guardar estos archivos.
Y al compilar veo que hbmk2 los está generando en la carpeta temporal y luego lo borra.
Un saludo
Fernando González Diez
ALSIS Sistemas Informáticos
User avatar
Antonio Linares
Site Admin
Posts: 42511
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: vscode hbmk2 vcvarsall

Post by Antonio Linares »

Si, debería hacerlo hbmk2

Si borra los archivos temporales, entonces debería comparar la fecha del EXE resultante con los ficheros PRGs

Tambien puedes probar la opción -inc de hbmk2 que si recuerdo bien hace una construcción incremental y asi debería guardar los archivos temporales
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
fgondi
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España
Contact:

Re: vscode hbmk2 vcvarsall

Post by fgondi »

Hola Antonio,

Trabajaré con ello y buscaré los parámetros que necesité.

Muchas gracias.
Un saludo
Fernando González Diez
ALSIS Sistemas Informáticos
User avatar
fgondi
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España
Contact:

Re: vscode hbmk2 vcvarsall

Post by fgondi »

Ya lo tengo totalmente operativo.

En vscode he generado el archivo tasks.json dentro de la carpeta .vscode de la carpeta con el código fuente

Code: Select all | Expand

{
   "version": "2.0.0",
   "tasks": [
    {
        "label": "build",
        "type": "shell",
        "command": ".\\go32.bat",
        "problemMatcher": []
    }
]
}


He generado un bat go32.bat y tt.hbp en el raiz de la carpeta con el código fuente

go32.bat

Code: Select all | Expand

call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
c:\harbour\bin\hbmk2 tt.hbp -comp=msvc


tt.hbp

Code: Select all | Expand

-gui

#Incremental, sólo compila los prgs modificados
-inc

#Generar el ejecutable en otra carpeta
-oD:\Tycwin2\Alges.exe

#Ruta para guardar los obj y c
-workdir=D:\Obj\fiveVSCode\Alges\vRelease\

#RC
D:\five\Alges\rc\Alges.rc
D:\five\comun\rc\comun.rc
D:\five\comun\rc\manifest_new.rc
 
#PRG
# ------ MODULO PRINCIPAL -------
D:\Five\Alges\prg\*.prg

# ------ SOURCES -----------------
D:\Five\Comun\Incluir_New\*.prg

#INCLUDES
-Ic:\fwh\include
-ID:\five\include

#LIBRERIAS DE PROPIAS
-LD:\Obj\fiveVSCode\Lib
-lExtAlsis

#LIBRERIAS DE FIVEWIN
-Lc:\fwh\lib
-lFiveH32
-lFiveHC32

#LIBRECIAS VISUAL STUDIO
-lgdiplus
-lole32
-lOleDlg
-lversion

#LIBRERIAS DE HARBOUR
-lpng
-lgtgui
-lhbtipssl
-llibeay32
-lssleay32
-lminizip
-lace32

#HBC DE HARBOUR
xhb.hbc
hbct.hbc
hbwin.hbc
hbmzip.hbc
hbziparc.hbc
hbtip.hbc
hbssl.hbc
hbnf.hbc
rddads.hbc

-ldflag=/NODEFAULTLIB:MSVCRT
 
Un saludo
Fernando González Diez
ALSIS Sistemas Informáticos
User avatar
Antonio Linares
Site Admin
Posts: 42511
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: vscode hbmk2 vcvarsall

Post by Antonio Linares »

Excelente Fernando!!!

Muy buen trabajo!

Muchas gracias por compartirlo :-)

un abrazo,
regards, saludos

Antonio Linares
www.fivetechsoft.com
Horizon
Posts: 1323
Joined: Fri May 23, 2008 1:33 pm
Has thanked: 4 times

Re: vscode hbmk2 vcvarsall

Post by Horizon »

fgondi wrote:Ya lo tengo totalmente operativo.

En vscode he generado el archivo tasks.json dentro de la carpeta .vscode de la carpeta con el código fuente

Code: Select all | Expand

{
   "version": "2.0.0",
   "tasks": [
    {
        "label": "build",
        "type": "shell",
        "command": ".\\go32.bat",
        "problemMatcher": []
    }
]
}


He generado un bat go32.bat y tt.hbp en el raiz de la carpeta con el código fuente

go32.bat

Code: Select all | Expand

call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
c:\harbour\bin\hbmk2 tt.hbp -comp=msvc


tt.hbp

Code: Select all | Expand

-gui

#Incremental, sólo compila los prgs modificados
-inc

#Generar el ejecutable en otra carpeta
-oD:\Tycwin2\Alges.exe

#Ruta para guardar los obj y c
-workdir=D:\Obj\fiveVSCode\Alges\vRelease\

#RC
D:\five\Alges\rc\Alges.rc
D:\five\comun\rc\comun.rc
D:\five\comun\rc\manifest_new.rc
 
#PRG
# ------ MODULO PRINCIPAL -------
D:\Five\Alges\prg\*.prg

# ------ SOURCES -----------------
D:\Five\Comun\Incluir_New\*.prg

#INCLUDES
-Ic:\fwh\include
-ID:\five\include

#LIBRERIAS DE PROPIAS
-LD:\Obj\fiveVSCode\Lib
-lExtAlsis

#LIBRERIAS DE FIVEWIN
-Lc:\fwh\lib
-lFiveH32
-lFiveHC32

#LIBRECIAS VISUAL STUDIO
-lgdiplus
-lole32
-lOleDlg
-lversion

#LIBRERIAS DE HARBOUR
-lpng
-lgtgui
-lhbtipssl
-llibeay32
-lssleay32
-lminizip
-lace32

#HBC DE HARBOUR
xhb.hbc
hbct.hbc
hbwin.hbc
hbmzip.hbc
hbziparc.hbc
hbtip.hbc
hbssl.hbc
hbnf.hbc
rddads.hbc

-ldflag=/NODEFAULTLIB:MSVCRT
 


Thank you for your sharing.

Can you be more specific for "Task" and "CTags" extensions? There are several extensions.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
User avatar
fgondi
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España
Contact:

Re: vscode hbmk2 vcvarsall

Post by fgondi »

Task -> actboy168
ctags -> jaydenlin
Un saludo
Fernando González Diez
ALSIS Sistemas Informáticos
User avatar
Antonio Linares
Site Admin
Posts: 42511
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: vscode hbmk2 vcvarsall

Post by Antonio Linares »

Estimado Fernando,

Podrias poner algunas capturas de pantalla, ó un gif animado, para ilustrar mejor lo que has hecho como lo usas ?

Mostrando la instalación de las extensiones, creación de un proyecto, etc

Te estaríamos muy agradecidos. Cuando tengas tiempo :-)

un abrazo
regards, saludos

Antonio Linares
www.fivetechsoft.com
Horizon
Posts: 1323
Joined: Fri May 23, 2008 1:33 pm
Has thanked: 4 times

Re: vscode hbmk2 vcvarsall

Post by Horizon »

fgondi wrote:Task -> actboy168
ctags -> jaydenlin


Thank you Fernando.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Post Reply