###Gradle
Add this to your project by configuring a dependency as follows:
repositories {
maven {
url "http://dl.bintray.com/itemis/maven"
}
}
dependencies {
mwe2 'com.itemis.xtext:generator-vscode:0.4'
}
###Workflow Configuration
Add the VSCodeExtensionFragment
to the Xtext Generator workflow component.
component = XtextGenerator {
language = StandardLanguage {
...
fragment = com.itemis.xtext.generator.vscode.VSCodeExtensionFragment {
provider = "My Company" // this property is mandatory
// fragment configuration goes here...
}
}
}
###Build & Install
Run gradle install
. Additionally to the language implementation a folder vscode
will be produced within the .ide
project. The folder contains a subproject for the VS Code extension.
To build the extension, go into the vscode
folder and enter gradle startCode
.
The resulting extension is built to vscode/build/<dsl>-<version>.vsix
and installed into VS Code.
##Fragment Configuration
provider
Extension provider name. This is a mandatory property for VS Code extensions. Since there is no reasonable default, this property is also mandatory for the fragment configuration.
Example:
fragment = com.itemis.xtext.generator.vscode.VSCodeExtensionFragment {
provider = "My Company" // this property is mandatory
}
license
Extension License name.
Example:
fragment = com.itemis.xtext.generator.vscode.VSCodeExtensionFragment {
license = "EPL-1.0"
}
debugPort
Specify a port for remote debugging the Xtext server process. This will add Java remote debugging options to the spawned JVM.
Example:
fragment = com.itemis.xtext.generator.vscode.VSCodeExtensionFragment {
debugPort = "8000"
}
javaOptions
Specify additional options for the JVM.
Example:
fragment = com.itemis.xtext.generator.vscode.VSCodeExtensionFragment {
javaOption = "-Xms64M -Xmx256M"
}
versions
Allows to override the versions used for dependencies and build plugins. This is a composite property which has the following contained properties:
Property | Description | Default |
---|---|---|
vscExtension | Version of the resulting extension | 0.1.0 |
xtext | Xtext version | 2.11.0-SNAPSHOT |
vscEngine | VSCode Engine version | ^1.2.0 |
typescript | TypeScript version | ^1.8.10 |
vscode | VS Code version | ^0.11.13 |
vscodeLanguageclient | VS Code Language Client version | ^2.3.0 |
node | Node version | 6.2.2 |
npm | NPM version | 3.10.6 |
nodeGradlePlugin | Version for Gradle plugin com.moowork.node | 0.13 |
shadowJarGradlePlugin | Version for Gradle plugin com.github.johnrengelman.shadow | 1.2.3 |
releaseGradlePlugin | Version for Gradle plugin net.researchgate.release | 2.4.0 |
Example:
fragment = com.itemis.xtext.generator.vscode.VSCodeExtensionFragment {
versions = {
vscExtension = "1.0.0"
node = "6.2.0"
}
}
useTravis
When using Travis CI this flag can be set to generate a .travis.yml
and .travis-publishOnRelease.sh
file.
Example:
fragment = com.itemis.xtext.generator.vscode.VSCodeExtensionFragment {
useTravis = true
}