redhat-developer / redhat-developer/vscode-java

[gradle] Accessing files in build directory

オープン
#279 コメント 4 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Gradle upstream
主要言語
TypeScript
スター
2.3k
フォーク
546
平均マージ
20時間 1分
マージ済み PR(30日)
11

説明

[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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、相対 build.num パスを使って Gradle ビルドを再現し、${projectDir}/build.num 形式と比較します。VS Code Java extension が Gradle をどのように起動するかを調査し、相対パスがビルドディレクトリを基準に解決されるようになり、他のビルドを壊さないことを修正で確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, vscode
領域
build-system
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。