redhat-developer / redhat-developer/vscode-java

Setting java.import.gradle.home in multi-project structure via vscode variable

Aperta
#1,486 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Gradle
Lingua principale
TypeScript
Stelle
2.3k
Fork
546
Merge medio
20h 1m
PR unite (30g)
11

Descrizione

I have a gradle multi-project structure in which the gradle wrapper is only placed in the root project.
Since I want all sub-projects to use the same wrapper (and not e.g. my local installation) I set the java.import.gradle.home in my workspace settings.
Ideally, I want to set this variable as: java.import.gradle.home=${workspaceFolder}/.gradle/...
However, in the generated .settings/org.eclipse.buildship.core.prefs in the subprojects I can see that the path is only copied and the vscode variable ${workspaceFolder} is not expanded.

Is it possible to support vscode variable expansion in the extension?
Are there other ways to set the gradle wrapper path relative to the project path? Currently, I am using the absolute path in my settings file. However, this would need to be updated by other team members.

Environment
  • Operating System: macOS
  • JDK version: 1.11
  • Visual Studio Code version:1.45.1
  • Java extension version: 0.62.0
Steps To Reproduce
  1. Create gradle multi-project
  2. Set java.import.gradle.home using ${workspaceFolder}
Current Result

Vscode variables (e.g. ${workspaceFolder}) used for e.g. java.import.gradle.home are not expanded in the org.eclipse.buildship.core.prefs (hence throwing no such file exception)

Expected Result

Vscode variables are correctly expanded and correct path is shown in org.eclipse.buildship.core.prefs of the subprojects

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 tracciando come viene gestita l'impostazione java.import.gradle.home durante la generazione di .settings/org.eclipse.buildship.core.prefs per i sottoprogetti Gradle. Riproduci la configurazione multiprogetto con ${workspaceFolder} e ispeziona il percorso delle preferenze generato. Il lavoro è completato quando la variabile viene espansa e i sottoprogetti fanno riferimento al percorso del wrapper del progetto root.

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

Valutazione

Stack tecnologico
java, typescript
Ambito
build-system
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.