For the TextGridLab, we use Eclipse for development and Tycho for the build. This page sets you running with setting up your TextGridLab development environment with Eclipse, while TextGridLab Modular Build explains how to set up your tool to be built with Tycho.
You should be able to run TextGridLab locally – especially, you'll need webkit-gtk. You should also have a JDK available, not only a JRE.
Eclipse and Friends
Download the up-to-date (I last tried Oxygen 2) Eclipse IDE for Eclipse Committers from the Eclipse Packages download page. It contains all you need to get started. (If you prefer to re-use an existing Eclipse, you should have at least the PDE (Plugin Development Environment) and m2e (Maven toolbox) installed before you go on).
Unpack and start Eclipse and create a new workspace.
Add TextGridLab to your Target Platform
To develop a part of an Eclipse-based app like the TextGridLab, Eclipse PDE has the concept of a Target Platform. The Target Platform contains everything your code requires to run but you don't actually modify: E.g., all the TextGridLab plug-ins that really are Eclipse parts or originate from some third party. We will setup a target platform that contains the current Nightly version of the TextGridLab first:
- In Eclipse, open the preferences page at Window → Preferences → Plug-in Development → Target Platform
- Add a new target platform. Select Start with an empty target definition. Give it a sensible name, e.g., TextGridLab TP.
- At the Locations tab, add a new location of type Software Site.
- Enter one of the TextGridLab update sites Update Site Management into the Work with field – e.g., http://www.textgridlab.org/updates/nightly – and hit your enter key.
- Select the TextGridLab SDK category.
- The SDK features include the source code you might want for debugging. The TextGridLab Base stuff includes everything that is in the TextGridLab application you can download from textgrid.de.
- You may, at your wish, add additional stuff to your target platform, if you intend to develop against it.
- Click Finish. You are back at the New Target Definition preference page.
- On the Content page, select Manage using: (•) Features.
On the Arguments page, add the following to the VM arguments field:
- Click Finish. You are back at the Target Platform preference page. You may always go back to the previous dialog by selecting the target platform and clicking Edit.
- Click the checkmark in front of your freshly defined target platform and click apply in order to make it the active one.
Note that Eclipse takes quite long for some steps in working with the target platform since it involves parsing large update sites and dowloading lots of plugins to your computer.
You might want to also add the Eclipse SDK and the Marketplace Sources for the target release to your platform – while the respective binary plugins are part of the TextGridLab SDK, the sources are not. Thus adding the Eclipse SDK to your target platform helps you in viewing help or stepping through sources of eclipse stuff. To do so, basically perform steps 4–7 as above, but in steps 4/5 instead:
- use http://download.eclipse.org/releases/luna as the update site
- uncheck the Group by Category checkbox
- type 'Eclipse SDK' in the filter field, check the corresponding entry, clear the filter
- type 'Marketplace' in the filter field, check the sources entry, clear the filter
- OK → will take some time
Create a Run Configuration
In order to run or debug the TextGridLab (with all your tools):
- Run → Run Configurations
- In the list on the left side of the run configurations dialog, select Eclipse Application and click the New button at the top of the list. A new run configuration will be created. Give it a useful Name.
- On the Main tab of the new run configuration, in the Program to run group, choose (•) Run a product and select the product info.textgrid.lab.core.application.base_product from the dropdown list. (If it doesn't show up, you haven't setup your target platform properly – see above.)
You currently need to manually add command line arguments to the Arguments tab of your run configuration. You should add the stuff from a current textgridlab.ini (found in the root folder of a downloaded TextGridLab). You need to at least add the following to the VM Arguments section or TG-search won't work:
- You currently need to configure the AXIOM bundles to autostart (until TG-1822 has been resolved). To do so,
- go to the Plugins tab
- Select Launch with: Plug-ins selected below
- Check all target platform plug-ins plus the relevant stuff from your workspace
- Look for the two AXIOM plugins in the list (use the filter text field), org.apache.ws.commons.axiom.axiom-api and org.apache.ws.commons.axiom.axiom-impl, and select Auto-Start: true for both of them
- OPTIONAL Marketplace:
- If you want to also work with the Marketplace you need to activate "Support software installation in the launched application" in the configuration tab
then you also need the more options from textgridlab.ini in vmargs
- Modify the other options at will and hit Run. The TextGridLab with your stuff inside will start. You can re-use the launch configuration later.
You can also create this run configuration for debugging from the debug menu items.
Work on TextGridLab itself
The following steps checkout the complete TextGridLab. They have been tested on a linux box that has git and maven 3 working at the command line and assume you have a SSH key correctly configured both on your system and on projects.gwdg.de. If you are not sure, type
ssh email@example.com and you should see a list of all projects you have access to. Checking out the complete lab has the advantage that there is a shell script
./build-locally that will build a version of the lab using the components on your disk, so this is great for refactoring activities or building TextGridLab executables before you push to develop. Alternatively, see the next section for a guide to check out individual components.
- To clone the lab, type
git clone -b develop --recursive ssh://firstname.lastname@example.org/dariah-de/tg/textgrid-laboratoryat a terminal window in a suitable folder in your file system. This will create a folder textgrid-laboratory with the lab's source code in all subdirectories.
- cd textgrid-laboratory
The following command will bring all your submodules to the current state of the develop branch:
./setup-push-urls.sh. It will setup suitable push URLs for all the submodules, so you can actually push your changes back to our repository.
Now you could run
./build-locally.sh to actually build the whole TextGridLab from the sources on your disk, if you do that, you'll find readily packaged as well as unpacked versions for various operating systems under
Importing checked-out components into your Eclipse workspace
Now we'll use one of the components (I'll take
core) into the Eclipse workspace we setup before in order to hack on it.
Back to your Eclipse …
- Open the Git perspective from the perspective switcher in the top right corner.
- In the Git Repositories view, select Add an existing local git repository.
- Under Directory, browse for your
textgrid-laboratorydirectory from the last section. Check Look for nested repositories and click Search. Check all results and click Finish. You will now see the main project and all submodules in the Git Repositories view.
- Right-click the
coreentry and select Import Projects from the context menu. Eclipse will show a dialog that lists a bunch of folders, each of which is marked with Import as: Maven.
- Leave everything as is and click Finish.
- The first time you'll do this, Eclipse will ask you to Setup Maven plugin connectors. Accept all suggestions and click Finish. Eclipse will install some components, just accept everything you are asked for.
- After restarting Eclipse, open the Plugin Development perspective from the perspective switcher. You will see your projects in the project explorer. You might want to switch the project explorer's Project Presentation to Hierarchical from its overflow menu (the icon with the triangle pointing downwards).
- Now hack on, the run configuration you configured above should use the code from your workspace.
Alternative: Checkout existing individual TextGridLab projects
The following steps show how to checkout existing TextGridLab projects (using the
core component as an example), e.g., to fix some bugs in TextGridLab proper. Note that you only need checkout those components you wish to modify, it's perfectly possible to develop your own tools without checking out the whole TextGridLab.
The steps assume you have installed m2e and Subclipse and configured Subclipse so it works.
- Setup your development environment (including target platform and run configuration) as outlined above.
- Open the Browse Git Repositories perspective.
- Choose the project you wish to clone from the subprojects of https://projects.gwdg.de/projects/textgrid-laboratory
- Clone the chosen repository from the SSH clone URL. Checkout the branch develop, this is where the main line of development happens.
- From the component directory's context menu, choose Checkout as Maven project
- Finish the wizard and wait ...
- Fix the issues below ...
Note that Eclipse will have automatically added the plugins you just checked out to the run configuration you defined above, so you'll work with the plugins from your workspace and eclipse will take the other plugins from the target platform.
Instead of cloning the repository inside eclipse you may also clone the repo to your local disk using an external git client and add the local repository to the repositories view.
Currently expected errors
- No support for maven-javadoc-plugin
- can be safely ignored.
- JUnit is missing
- either add org.junit to the target platform, e.g., from Eclipse Orbit (TODO detailed instructions)
- or close those projects requiring org.junit, i.e. the *.tests projects
German installation manual
- The following attachment contains a german installation manual.
- This manual was successfully tested under Windows, MacOS and Linux (Ubuntu and Debian). If you use Eclipse Photon, please consider the following information from stackoverflow.
Old Information Follows
Frequently Asked Bugfixes
If there are still compiler errors in the workspace:
- (1.0 only) Check the project info.textgrid.lab.core.tgcrud.client.jaxws in the Package Explorer - is there content in the folder 'generated-src'?
- If not: Switch Build mode to build manually (Menu/Project/Uncheck Build Automatically), hit F5 (Refresh), and maybe trigger a new build. This should work automatically, but it appearently doesn't sometimes. (This step calls wsimport to automatically generate JAXB sources.)
- If the wsimport is not being called (visible in the eclipse console), restart eclipse platform and try again
- Make sure you have set the target platform and edited it to match your individual build platform (See step 'Set the Target Platform' above)
If there is a crash at runtime:
- Error 'UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM'
- Check Eclipse Preferences/Java/Installed JREs/Execution environment/ JavaSE-1.6: Make sure there is an SDK 6 installed
- Modify the .target file to match architecture x86_64, afterwards rebuild workspae