redhat-developer / redhat-developer/vscode-java
[gradle] Accessing files in build directory
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 546
- Avg merge
- 20h 1m
- Merged PRs (30d)
- 11
Description
[provide a description of the issue]
Environment
- Operating System: macOS Sierra
- JDK version: JDK 8
- Visual Studio Code version: 1.15
- Java extension version: 0.8.0
Steps To Reproduce
I track a build number using a text file in the build project directory, e.g., 'build.num'
First, the file can't be found using this code:
def buildNumber = new File("build.num").text.toInteger() + 1
It looks like gradle isn't being run in the same directory as the build.gradle file. So I changed the code to this:
def buildNumber = new File("${projectDir}/build.num").text.toInteger() + 1
Now the 'build.num' file is being found. The same problem exists when referencing any files from a relative location.
Current Result
File Not Found
Expected Result
Build should work the same as if running it from the build directory.
Additional Informations
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Gradle build with the relative build.num path and compare it with the ${projectDir}/build.num form. Inspect how the VS Code Java extension launches Gradle and verify that the fix makes relative paths resolve from the build directory without breaking other builds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, vscode
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100