microsoft / microsoft/vscode-java-debug

Azure Function local debugging for multiple profile in maven

Aperta
#647 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

ai-triaged attach bug buildtool
Lingua principale
TypeScript
Stelle
591
Fork
429
Merge medio
1g 9h
PR unite (30g)
19

Descrizione

Issue Type: Bug

##------------------##----------
Launch.json
{
"name": "Attach to Java Functions dev",
"type": "java",
"request": "attach",
"hostName": "127.0.0.1",
"port": 5005,
"preLaunchTask": "devFunc"
},
{
"name": "Attach to Java Functions test",
"type": "java",
"request": "attach",
"hostName": "127.0.0.1",
"port": 5005,
"preLaunchTask": "testFunc"
}

//#########------------#############
TASK.json
//#######------------------###########
{
"version": "2.0.0",
"tasks": [
{
"label": "devFunc",
"type": "func",
"command": "host start",
"problemMatcher": "$func-watch",
"isBackground": true,
"options": {
"cwd": "${workspaceFolder}/target/azure-functions/sequation-image-resize-functions-dev/"
},
"dependsOn": ["package-dev"]
},
{
"label": "package-dev",
"command": "mvn clean package",
"type": "shell",
"problemMatcher": [
"$func-watch"
],
"isBackground": true
}
,
{
"label": "testFunc",
"type": "func",
"command": "host start",
"problemMatcher": "$func-watch",
"isBackground": true,
"options": {
"cwd": "${workspaceFolder}/target/azure-functions/sequation-image-resize-functions-test/"
},
"dependsOn": ["package-test"]
},
{
"label": "package-test",
"command": "mvn clean package -P test",
"type": "shell"
}
]
}

I have multiple profiles in my maven for each environment that I have eg: dev, test, prod I have configured the tasks to build and run pointing to each profile I have in my maven.

the prelaunch task in Launch.json does not pick up the task based on its name if there are multiple tasks defined in the task.json. I have observed it picks up the task that is defined.

to make it run I have to comment out the multiple tasks and keep just one.

in the above configuration if I comment out the below code it works fine.

//,
// {
// "label": "testFunc",
// "type": "func",
// "command": "host start",
// "problemMatcher": "$func-watch",
// "isBackground": true,
// "options": {
// "cwd": "${workspaceFolder}/target/azure-functions/sequation-image-resize-functions-test/"
// },
// "dependsOn": ["package-test"]
// },
// {
// "label": "package-test",
// "command": "mvn clean package -P test",
// "type": "shell"
// }

Extension version: 0.21.0
VS Code version: Code 1.37.1 (f06011ac164ae4dc8e753a3fe7f9549844d15e35, 2019-08-15T16:17:55.855Z)
OS version: Windows_NT x64 10.0.17763

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (8 x 2112)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.86GB (6.46GB free)
Process Argv
Screen Reader no
VM 0%

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo la configurazione con più voci in Launch.json e TASK.json, usando i nomi preLaunchTask devFunc e testFunc e i relativi comandi dei profili Maven. Traccia il modo in cui il debugger Java risolve preLaunchTask quando sono definite più attività. Il lavoro è completato quando ogni configurazione di avvio avvia l'attività corrispondente al proprio nome invece dell'attività errata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
azure, java, vscode
Ambito
developer-experience, devtools
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.