redhat-developer / redhat-developer/vscode-java

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

未关闭
#1,486 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Gradle
主要语言
TypeScript
星标
2.3k
派生
547
平均合并
20 小时 1 分钟
30 天内合并 PR
11

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先跟踪为 Gradle 子项目生成 .settings/org.eclipse.buildship.core.prefs 时如何处理 java.import.gradle.home 设置。使用 ${workspaceFolder} 重现多项目设置,并检查生成的首选项路径。变量得到展开且子项目引用根项目的 wrapper 路径即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, typescript
领域
build-system
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。