Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include server packages into vsix #182

Merged
merged 1 commit into from
Apr 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ before_install:
- npm install -g typescript

install:
- wget http://download.eclipse.org/jdtls/snapshots/jdt-language-server-latest.tar.gz
- mkdir server
- tar -xvzf jdt-language-server-latest.tar.gz -C ./server
- rm jdt-language-server-latest.tar.gz
- npm install
- npm run vscode:prepublish
- npm install -g vsce
Expand Down
2 changes: 1 addition & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ vsc-extension-quickstart.md
undefined/**
CONTRIBUTING.md
.vscode-test/**
server/**
**/**.vsix
17 changes: 10 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@ This assumes that you are starting on the `vscode-java` directory

```bash
$ cd ..\vscode-java
$ npm run-script build-server
$ npm run build-server
```
You can run faster builds by calling the `build-server-mac`, `build-server-win` or `build-server-linux` script instead, depending on your OS. These commands run Maven in offline mode, so you might need to run `build-server` at least once, to fetch all the dependencies.
You can run faster server builds during development by calling `./node_modules/.bin/gulp dev_server` script instead, this will build server binaries that are required by your host OS only. You can also use `npm run watch-server` which will build and place them on the extension for Java changes. These commands run Maven in offline mode, so you might need to run `build-server` at least once, to fetch all the dependencies.

This will build and place the binaries under the `server` folder. Alternately you can download
and unzip a pre-built server. For pre-built server information refer to eclipse.jdt.ls
project.
This will build and place the binaries under the `server` folder. Alternately you can download and use the latest snapshot build from [Eclipse ™ JDT Language Server](https://github.com/eclipse/eclipse.jdt.ls) project with the following
Copy link
Collaborator

@fbricon fbricon Apr 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


```bash
$ cd ..\vscode-java
$ ./node_modules/.bin/gulp download_server
```

## Sideloading

Expand All @@ -53,11 +56,11 @@ You can create a binary that you can sideload to your VS Code installation.
$ npm install
```
4. Optionally, follow the instruction to build the server.
5. See documentation on [extension installation](https://github.com/Microsoft/vscode-docs/blob/master/docs/extensions/install-extension.md)
5. See documentation on [extension installation](https://github.com/Microsoft/vscode-docs/blob/master/docs/extensions/publish-extension.md)
on ways to sideload or share.

# Reporting issues
If you encounter a problem and know it is caused by eclipse.jdt.ls, then please open a bug report over [there](https://github.com/eclipse/eclipse.jdt.ls/issues).
In doubt, you can report issues in the [vscode-java issue tracker](https://github.com/redhat-developer/vscode-java/issues).

Try to collect as much informations as you can to describe the issue and help us reproduce the problem. Head over to the [troubleshooting page](https://github.com/redhat-developer/vscode-java/wiki/Troubleshooting#enable-logging) to see how to collect useful logging informations.
Try to collect as much informations as you can to describe the issue and help us reproduce the problem. Head over to the [troubleshooting page](https://github.com/redhat-developer/vscode-java/wiki/Troubleshooting#enable-logging) to see how to collect useful logging informations.
44 changes: 8 additions & 36 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,14 @@ def buildVscodeExtension(){
sh "npm run vscode:prepublish"
}

def updateArchiveDownloadUrl(url){
def downloadConfig = readJSON file: 'server_archive.json'
downloadConfig.production.url = url
writeJSON file:'server_archive.json', json: downloadConfig
}

node('rhel7'){
stage 'Build JDT LS'
git url: 'https://github.com/eclipse/eclipse.jdt.ls.git'
def mvnHome = tool 'maven-3.3.9'
sh "${mvnHome}/bin/mvn clean verify -B -U -fae -e -Pserver-distro"

stage 'Upload Server to staging'
def files = findFiles(glob: '**/org.eclipse.jdt.ls.product/distro/**.tar.gz')
sh "rsync -Pzrlt --rsh=ssh --protocol=28 ${files[0].path} [email protected]:/downloads_htdocs/jbosstools/jdt.ls/staging"
stash name: 'server_distro',includes :files[0].path
env.stageUrl = 'http://download.jboss.org/jbosstools/jdt.ls/staging/' + files[0].name

}

node('rhel7'){
Expand All @@ -38,14 +28,15 @@ node('rhel7'){
deleteDir()
git url: 'https://github.com/redhat-developer/vscode-java.git'

stage 'Update server archive url to staging'
updateArchiveDownloadUrl(env.stageUrl)

stage 'install vscode-java build requirements'
installBuildRequirements()

stage 'Build vscode-java'
buildVscodeExtension()
unstash 'server_distro'
def files = findFiles(glob: '**/org.eclipse.jdt.ls.product/distro/**.tar.gz')
sh "mkdir ./server"
sh "tar -xvzf ${files[0].path} -C ./server"

stage 'Test vscode-java for staging'
wrap([$class: 'Xvnc']) {
Expand All @@ -59,39 +50,20 @@ node('rhel7'){
stage 'Upload vscode-java to staging'
def vsix = findFiles(glob: '**.vsix')
sh "rsync -Pzrlt --rsh=ssh --protocol=28 ${vsix[0].path} [email protected]:/downloads_htdocs/jbosstools/jdt.ls/staging"
stash excludes:'server/, .vscode-test/, **.vsix, target/' , name:'extension_source'
stash name:'vsix', includes:files[0].path
}

node('rhel7'){
if(publishToMarketPlace.equals('true')){
timeout(time:5, unit:'DAYS') {
input message:'Approve deployment?', submitter: 'bercan'
}
stage 'Upload Server to release'
unstash 'server_distro'
def files = findFiles(glob: '**/org.eclipse.jdt.ls.product/distro/**.tar.gz')
sh "rsync -Pzrlt --rsh=ssh --protocol=28 ${files[0].path} [email protected]:/downloads_htdocs/tools/static/vscode"
def prodUrl = 'http://download.jboss.org/jbosstools/static/vscode/' + files[0].name

stage 'Checkout vscode-java for release build'
deleteDir()
unstash 'extension_source'

stage 'Update server archive url to release'
updateArchiveDownloadUrl(prodUrl)
archive includes:"server_archive.json"

stage 'install vscode-java build requirements'
installBuildRequirements()

stage 'Test vscode-java for release'
wrap([$class: 'Xvnc']) {
sh "npm test --silent"
}

stage "Publish to Marketplace"
unstash vsix;
withCredentials([[$class: 'StringBinding', credentialsId: 'vscode_java_marketplace', variable: 'TOKEN']]) {
sh 'vsce publish -p ${TOKEN}'
def vsix = findFiles(glob: '**.vsix')
sh 'vsce publish -p ${TOKEN} --packagePath ${vsix[0].path}'
}
archive includes:"**.vsix"
}//if publishMarketPlace
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,15 @@ The following settings are supported:

Troubleshooting
===============
1. Due to size restrictions on the marketplace extension downloads additional required parts check that they
are downloaded under `~/.vscode/extensions/redhat.java-0.2.0/server` folder.
You should see a folder named `plugins`.

2. Check the status of the language tools on the lower right corner (marked with A on image below).
1. Check the status of the language tools on the lower right corner (marked with A on image below).
It should show ready (thumbs up) as on the image below. You can click on the status and open the
language tool logs for further information in case of a failure.

![ status indicator ](https://raw.githubusercontent.com/redhat-developer/vscode-java/master/images/statusMarker.png)

3. Read the [troubleshooting guide](https://github.com/redhat-developer/vscode-java/wiki/Troubleshooting) for collecting informations about issues you might encounter.
2. Read the [troubleshooting guide](https://github.com/redhat-developer/vscode-java/wiki/Troubleshooting) for collecting informations about issues you might encounter.

4. Report any problems you face to the [project](https://github.com/redhat-developer/vscode-java/issues).
3. Report any problems you face to the [project](https://github.com/redhat-developer/vscode-java/issues).

Contributing
===============
Expand Down
47 changes: 46 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,54 @@
'use strict';
const gulp = require('gulp');
const gulp_tslint = require('gulp-tslint');
const cp = require('child_process');
const decompress = require('gulp-decompress');
const download = require('gulp-download');

//...
gulp.task('tslint', () => {
return gulp.src(['**/*.ts', '!**/*.d.ts', '!node_modules/**'])
.pipe(gulp_tslint())
.pipe(gulp_tslint.report());
});
});

gulp.task('download_server', ()=>
{
download("http://download.eclipse.org/jdtls/snapshots/jdt-language-server-latest.tar.gz")
.pipe(decompress())
.pipe(gulp.dest('./server'))
});

gulp.task('build_server', ()=>
{
cp.execSync('mvn -f ../eclipse.jdt.ls/pom.xml -Pserver-distro clean package', {stdio:[0,1,2]} );
gulp.src('../eclipse.jdt.ls/org.eclipse.jdt.ls.product/distro/*.tar.gz')
.pipe(decompress())
.pipe(gulp.dest('./server'))
});

gulp.task('dev_server', ()=>
{
let isWin = /^win/.test(process.platform);
let isMac = /^darwin/.test(process.platform);
let isLinux = /^linux/.test(process.platform);
let command = 'mvn -f ../eclipse.jdt.ls/pom.xml -Pserver-distro,fast -o clean package ';
if(isLinux){
command +='-Denvironment.os=linux -Denvironment.ws=gtk -Denvironment.arch=x86_64';
}
if(isMac){
command += '-Denvironment.os=macosx -Denvironment.ws=cocoa -Denvironment.arch=x86_64';
}else
if(isWin){
command += '-Denvironment.os=win32 -Denvironment.ws=win32 -Denvironment.arch=x86_64';
}
console.log('executing '+command);
cp.execSync(command, {stdio:[0,1,2]} );
gulp.src('../eclipse.jdt.ls/org.eclipse.jdt.ls.product/distro/*.tar.gz')
.pipe(decompress())
.pipe(gulp.dest('./server'))
});

gulp.task('watch_server',()=>{
gulp.watch('../eclipse.jdt.ls/org.eclipse.jdt.ls.core/**/*.java',['dev_server']);
})
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,9 @@
"compile": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install",
"test": "node ./node_modules/vscode/bin/test",
"build-server": "mvn -f ../eclipse.jdt.ls/pom.xml -Pvscode-build clean package",
"build-server-mac": "mvn -f ../eclipse.jdt.ls/pom.xml -Pvscode-build,fast -Denvironment.os=macosx -Denvironment.ws=cocoa -Denvironment.arch=x86_64 clean package -o",
"build-server-win": "mvn -f ../eclipse.jdt.ls/pom.xml -Pvscode-build,fast -Denvironment.os=win32 -Denvironment.ws=win32 -Denvironment.arch=x86_64 clean package -o",
"build-server-linux": "mvn -f ../eclipse.jdt.ls/pom.xml -Pvscode-build,fast -Denvironment.os=linux -Denvironment.ws=gtk -Denvironment.arch=x86_64 clean package -o",
"tslint": "gulp tslint"
"build-server": "./node_modules/.bin/gulp build_server",
"watch-server": "./node_modules/.bin/gulp watch_server",
"tslint": "./node_modules/.bin/gulp tslint"
},
"devDependencies": {
"typescript": "^2.2.1",
Expand All @@ -129,18 +127,18 @@
"@types/glob":"5.0.30",
"gulp" :"^3.9.1",
"gulp-tslint": "^7.1.0",
"tslint" : "^4.4.2"
"tslint" : "^4.4.2",
"gulp-decompress":"2.0.1",
"gulp-download":"0.0.1"
},
"dependencies": {
"vscode-languageclient": "^3.2.0",
"find-java-home": "0.1.4",
"http-proxy-agent": "^1.0.0",
"https-proxy-agent": "^1.0.0",
"tmp" : "^0.0.31",
"decompress": "^4.0.0",
"progress-stream": "^1.2.0",
"path-exists":"^3.0.0",
"expand-home-dir":"^0.0.3",
"glob":"^7.1.1"
}
}
}
133 changes: 0 additions & 133 deletions src/downloadManager.ts

This file was deleted.

Loading