You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 23409d6
Browse filesBrowse the repository at this point in the historyBrowse files
description 'Generates config files for the Visual Studio Code java plugin'
194
-
group 'vscode'
195
-
}
196
-
```
63
+
We recommend you set the following in your [workspace settings](https://code.visualstudio.com/docs/getstarted/settings)
197
64
198
-
Then run `gradlew vscode`. This will generate
199
-
*`javaconfig.json`
200
-
*`build/classpath.txt`
65
+
### java.externalDependencies
201
66
202
-
### Gradle Android build
67
+
If you are using external dependencies, you should specify them in `.vscode/settings.xml` in the following format:
203
68
204
-
For Android gradle project, put the above tasks in the `android` method of your `build.gradle`:
205
-
```gradle
206
-
android {
207
-
...
208
-
// add the vscode tasks inside the android method
209
-
task vscodeClasspathFile {
210
-
...
69
+
```json
70
+
{
71
+
"java.externalDependencies": [
72
+
// Maven format
73
+
"junit:junit:jar:4.12:test",
74
+
// Gradle-style format is also allowed
75
+
"junit:junit:4.12"
76
+
]
211
77
}
212
78
```
213
79
214
-
Currently, the generated `classpath.txt` does not contain android platform library, e.g., `/opt/android-sdk-linux/platforms/android-23/android.jar`. You would need to add it manually. See issue #23.
215
-
216
-
### SBT (Lightbend Activator)
80
+
Your build tools should be able to generate this list for you:
217
81
218
-
Add this to your `build.sbt` file to generate `classpath.txt` every time you execute the `compile` or `run` tasks. This has been tested with Lightbend Activator/sbt 0.13.11.
82
+
#### List maven dependencies:
219
83
220
-
```scala
221
-
valgenClasspath= taskKey[String]("Generate classpath.txt for use with VS Code.")
84
+
```mvn dependency:list```
222
85
223
-
genClasspath := {
224
-
vallog= streams.value.log
225
-
valcp:Seq[File] = (dependencyClasspath in Compile).value.files
226
-
227
-
valfile= baseDirectory.value /"classpath.txt"
228
-
log.info("Writing classpath details to: "+ file.getAbsolutePath)
0 commit comments