Is it possible to host an Eclipse update site on Github? - java

I am using GitHub to develop an Eclipse plugin. I would like to have a public Eclipse update site for my plugin. Can I use GitHub for this?
I know that GitHub can be used for hosting individual files by using the "raw" links provided on the file information pages.

Forget the Github project releases feature, that won't work as a true update site (see notes at the end).
To achieve what you want, you can create a Github repo, commit/push your p2 repository there and then serve it as an update site, using raw links.
So for example, for the repository:
https://github.com/some-user/some-repository/
you can serve it as an update site using the link:
https://github.com/some-user/some-repository/raw/master/
Notes: Yes, if you open the update site link in a browser, github will give you no file listings, but rather a 404. But that's fine. The Eclipse update site mechanism doesn't need the parent link to be valid. Instead Eclipse will directly look for <update-site URL>/artifacts.jar (or .xml) and from the information in artifacts.jar, it will itself discover the URLs of the other artifacts stored in the update site. AFAIK, at no point does the Eclipse update mechanism need the web server to do file listings of a directory.
Note2: if you use Github project releases, you can only attach a zipped p2 repository to it. That is not a proper update site because it is a static repository: there is no URL to which new releases can be uploaded to. Eclipse won't be able to automatically discover new updates, rather the user will need to download the zip for each new release he/she wants to update to.
(Also with a proper update site, only the necessary artifacts for installation/update/query will be downloaded - a minor advantage)

Github pages are not a proper place for an update site.
Github pages may not properly serve large binary files as explained in this issue. It may be fine if your jars are small but overall they advise against placing binaries there. Instead they recommend placing binaries in the download section of the repository. I'd be happy if this situation changes because it would be very convenient to publish an update site by pushing to github.
For now one would have to use their API to programatically upload files in the download section. Answers to this other question points to some libraries and scripts that uses this API for use within java/maven, perl, ruby, etc.

You may now try it in a release page (July 2013).
See "Publish a project release (binary/source packages) on Github?"
Original answer (January 2013)
I have not tested it, but technically, a p2 repository can be defined in any shared path (either filesystem-shared or web-based-shared)
You should only need to:
generate the right p2 metadata
analyze the p2 repo in case of any issue.
store the all result in a git managed directory and push it to your GitHub repo.

http://pages.github.com/
The Github Pages feature allows you to host arbitrary folders of files without git turning each file into a github page.

I was able to host an Eclipse update site using the GitHub pages feature. I found it difficult to figure out all the pieces I needed, so here's a brief description of the steps I followed.
Build your Eclipse plug-in project, and test it on your local workstation.
Add a feature project, and add your plug in. Also set the description, copyright, and license information.
Configure a publishing source for your repository. I think the /docs folder is the easiest to work with. One way to generate a starting web site is to go to the GitHub repository settings page, and launch the automatic page generator.
Create an update site project nested inside the /docs folder. Put it in an obvious folder, like update.
Create a category, and add the feature to the update project.
Click the Build all button to generate the jar files.
Commit and push all the changes.
Try installing from the update site.
Once the update site works, you can publish your plug in in the Eclipse marketplace. This is optional, it just makes your plug in easier to find.
As others have mentioned, GitHub pages don't support huge binary files, so this will only work for small projects. To see an example, look at my Live Coding in Python project.

No it is not possible anymore, the Downloads API has officially been deprecated.
From the GitHub blog:
However, some projects need to host and distribute large binary files in addition to source archives. If this applies to you, we recommend using one of the many fantastic services that exist exactly for this purpose such as Amazon S3 / Amazon CloudFront or SourceForge. Check out our help article on distributing large binaries.
See this help article on distributing large binaries.

It turns out you absolutely can use GitHub Releases to host a p2 update site.
The main issue is that GitHub Releases hosts all files under a flat directory structure. Eclipse p2 repositories however, are hierarchical by default.
Since Eclipse Tycho (p2 actually), doesn’t allow you to configure a flat p2 repo structure, you need to script it.
The script needs to perform 2 things:
move every file under plugins/ and features/ to the root of the p2 repository,
replace all references to /plugins/ and /features/ with /, in the artifacts.xml file compressed in artifacts.jar and artifacts.xml.xz.
There are probably several ways to do it but in this blog post, you can see an implementation relying on a JBang script to achieve the desired goal:
https://fbricon.github.io/posts/use-github-releases-as-p2-repo/

Related

How to set up a system that reads PMML files which I create using R?

For the past few days I'm stuck at trying to pass a PMML file with .xml extension that I created using R and pmml package. After creating a iris.xml PMML file I have no where to go, actually I don't know what to look for. And then I saw Alex Guazzelli's video here, where he tells us to use ADAPA from Zementis to run the PMML files that are created from R.
What I took away from the video is,
I want to do something similar as shown, like uploading my PMML file at some place and input my test files frequently to get the corresponding predicted values.
ADAPA looks great, but looks like it also costs some money. So I would like to look for an alternative, which might not be as user friendly as ADAPA.
Then I found this page where the author says,
So the first step was to get the engine running. I experienced some small problems but Scott fixed them very fast and offered a new war file ready for deployment inside tomcat. It can be obtained under http://code.google.com/p/openscoring/. If you still encounter some problems you could also try my war file. It was built with java version “1.6.0_26” and tested under tomcat 7. After installing the war file using the management console, you could test it by sending a POST request in XML like the following to ‘http://localhost:8080/OpenScoring/Scoring’
Then I found jpmml. The problem here is the package names are very confusing, I don't know which one to install. In fact I don't know how to install each of them. I have basic knowledge of Java, apparently it isn't helpful in the current scenario.
Desperately looking forward for any kind of help.
How do the data flows in your application look like? Zementis' ADAPA is a standalone web service, which lets you do scoring in a request/response fashion. This works for web applications, but is clearly sub-optimal if you're looking to score larger amounts of data.
The JPMML project provides "PMML runtimes" for most popular big data frameworks. For example, if your application is tied to Apache Spark, then you would go for the JPMML-Spark project, if tied to Apache Hive/Pig, then for the JPMML-Pig project, etc. For a simple REST web service you should check out the Openscoring project, which is functionally identical to Zementis' ADAPA.
All JPMML projects can be built from their source checkout using Apache Maven by issuing the following command:
mvn clean install
Some JPMML projects also have their binaries distributed via the Maven Central repository. If you're looking for the Openscoring WAR file, then you need to search for "openscoring-webapp" and on the results page click the "download WAR" link (at the time of writing this, you would get openscoring-webapp-1.2.12.war). This is a standard WAR file that can be dropped to the auto deploy folder of your favourite Java web server (Tomcat?) as it is. The REST API of the web service is fully documented in the README file of the Openscoring project.

Java - retrieve sources from changeset (Team Foundation Server 2010)

Does exists any JAR which allow my JSF application:
Connect with TFS url (like tfs.company.com.br\server);
Pass destination directory and changeset as parameters;
"Download" all sources from changeset in my destination directory;
Important: we don't have any workItem, we just use TFS as repository.
I've searched for it in Google, but I just have found jars for Jenkins which allows me to make a job for it. That's not exactly what I want.
Once you've downloaded the TFS Java SDK, have a look at a an introductory post to see how you make calls to TFS using the TFS Object Model.
That sample is about work items, but once you understand the object model you should be able to work out how to make calls related to version control. Also, as the object model is consistent between Java and .NET, you should be able to look at a C# example that does something similar to what you want and adapt those as needed.

Dart: How to setup a project

Since my attempt to set up a Dart project myself I think I miss something fundamental since I didn't succeeded. So I still need the help of the community.
Coming from GWT I am used to a single application forming a single JS file which is ran and will augment a HTML element once it is recognized by the application.
There will be usually two JS files, one for the user-frontend and the web applications backend application.
I want a solution with an incremental build during development time (which I guess Dart offers when used in Dartium)
I have an inhouse web framework that I want to be started and used to send the Dart files for the Dartium session. How this will integrate and interfere with the debug sessions?
Update regarding web framework:
The web framework is a component based rendering engine, including database and uses its own resource management including everything http related like setting the cache flags etc. Its about 1.5 MB with 1200+ tests. Its simply everything you need starting with a simple servlet. Its also using an embedded jetty.
The relevance here is that I need to know how the debugger connects to Dartium and how it finds the files once an instance is running and delivered a html file containing dartium sources, so how can I start my own web server at a given port and still have dartium debug capabilities?
Update regarding the former answers:
I tried it but after two days gave up to learn more and do some other stuff. I just don't know why it is just not possible to add a simple file to the root package of my Dart module like the good old package.html (javadoc) fil. I then just add the Dart libaries to my project and the Dart plugin adds the required Dart nature to the project and creates a builder entry, done. Why do I have to do all the fuzz. Or even better why cant I just annotate my Module's main class to form a module and so I can replace the extra file completely?
I guess the Dart plugin has a model of the Dart code already so discovery is done on the fly in Eclipse.
I also do not know why I cant put my dart code in a dart source folder like src/dart/main and src/dart/test.
Or is this possible? I am still trying to get this done. I will use a fresh Eclipse 3.8 install and check if I can get Dartium to work. Just installing the plugin seams not to do the trick.
Update regarding the JS generation:
I cannot understand why Dart is not offering an incremental build of JS files. Even if it is a single file. It should not be that hard to debundle the given compile steps. I guess it will be something like compile each source file independently and link those together, do some tree shaking and done. Would be awesome if this can be made possible. Remember one can hold a model of the output file in memory (or on disk) and know what part of the js relates to what source file. Then just look up the link symbol tables and write back the part that has changed.
For me the killer feature for Dart would be the ease of configuration as I outlined and the incremental build of JS files making co-developing in JS a no-brainer. I guess in the end both JS files will be just about 750kb combined. So all the stuff with additional compression would not force me to upgrade my 8GB memory or will stress my SSD at all (350MB/sec for writes in burst mode).
Is there any work planed on this? Would be great to have Dart as the final solution for JS creation but to be honest I do not understand why GWT is the way to create JS this way. An incremental build and easy setup for GWT would be also welcome.
Seems not to be a question ...
In Dart you have usually one JS file because Dart on the server runs native (without transpiling)
With Dartium you don't have a build at all because it also runs Dart natively.
You build to JavaScript only for deployment (and of course to test the build output before deployment).
The debugging is done by Dartium itself (you can use the Chrome DevTools debugger without DartEditor if you want). DartEditor access the debugger API of Dartium and acts as a remote display/control.
Debugging web clients loaded from other webservers is supported.
What might cause some work is setting up your custom web server so that it forwards requests to source files to pub serve the web server used by DartEditor (or standalone).
pub serve runs transformers (on the fly code transformations/generation). Some framework depend on transformers being run on the code to make it functional.
I have no idea what this means but I don't use Eclipse/Dart plugin.
[Update regarding the former answers] I tried it but after two
days gave up to learn more and do some other stuff. I just dont
know why it is just not possible to add a simple file to the
root package of my module like the good old package.html file
for the java docs and then all i do is add the Dart libaries
to my project and the Dart plugin adds the nature to it and
creates a builder entry, done. Why do I have to do all the fuzz.
Or even better why cant I just annotate my Module's main class
to form a module and so I can replace the extra files?
To integrate Dart with your Java project create the Dart project independent from your project and move the Dart build output to a directory where you have your other static files.
While development configure your web server to forward to pub serve as explained above.
As already stated in my first answer, this
[Update regarding the JS generation] I can not understand why
dartium is not offering an incremental build of JS files. Even
if it is a single file. It should not be that hard to debundle
the given compile steps. I guess it will be something like
compile a single file and link those then the magical tree
shake and done
is irrelevant. You don't do anything with JavaScript while developing.
If you load the page with a non-Dartium browser pub serve will serve
built JavaScript instead of Dart. Incremental build is in the works
to improve responsiveness. But incremental build is not available
for file generation (would make sense anyway IMHO).

Backing up Java?

I'm currently using Java and I'm looking for a program that saves a new version of what I'm doing each time I compile. I don't mind if it doesn't run, I can go in and edit the class name to make it match the .java name afterwards. As I'm a beginner, I keep getting caught by overextending myself and then breaking the project I'm working on irreparably. I'm just looking for a way to go back to a safe state.
I'm sure their are programs for this, but because I don't know the collective noun for them, finding one is next to impossible.
All help is much appreciated.
What you're looking for is revision control. This works independent of the language you're dealing with, since all the VCS is concerned with is the state of the software at a particular snapshot in time.
Some recommendations:
Subversion
Git
Mercurial
IntelliJ IDEA also comes with a built-in local revision system, which allows you to visit a particular file's history. It'd still be preferable to use either Git or Subversion.
There are also sites that you can host your project on to better preserve your project, such as Github or Google Code. Github uses...Git, but Google Code will allow you to use a few others, such as Subversion and Mercurial.
Use a Dropbox folder. If you use Eclipse, just put the entire folder in the Dropbox folder, and you are set to go with a backup-ed IDE.
Added bonus: access your project from anywhere.
You could also use GitHub, but then your source code will be open to the community unless you pay for one of their "plans".
Also, consider using Bitbucket, which isn't known as well, but is free. (Thanks to A--C for that alternative to GitHub)

Is there a tool to see check-ins for all projects in Subversion by commit date and commit person

I want to know If there are any plug-ins or tools to see the files commited to the subversion by date and committer.
we are using subversion. It will be nice, If its like a web app.
Please suggest If there are any other alternative ways to do this also.
Its for my manager. So cannot be through eclipse. :)
websvn offers a nice access to svn via web.
It offers RSS feed support so your boss gets notified on every commit.
As a commercial tool fisheye might be worth a look.
Have you tried displaying the SVN log, using any SVN client (like TortoiseSVN, I guess your PHB is using Windows)? You can easily see the time, comments and author of any given SVN commit there...
See:
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-showlog.html
Since TortoiseSVN integrates nicely into Windows Explorer, even your manager should be able to use it...
That being said, it's trivial to access the log information, for example using pysvn, and displaying it in a simple GUI, if selecting and opening the revision log via the context menu is asking too much in your given use case...
You can also take a look at svnmonitor. It will keep checking for new changes, and notify the user (this can be configured)
Trac is a wiki and issue tracking system that works well with subversion. As an example, click on the project's Browse Source link.

Categories