Rascal Developers Setup Step by Step

Davy Landman edited this page Apr 26, 2017 · 16 revisions

Prequel: Git Setup

Some general git tips, and a few github specific tips.

  • be sure to setup your name in git: git config --global user.name "Rascal Developer #42"

  • be sure to setup your email address: git config --global user.email "rascal.developer42@cwi.nl" (this should match one of the email addresses in your profile)

  • use the ssh URLs, they are easier to use, especially in combination with public keys.

  • make sure you use the ssh over port 443 tunneling trick this will assure you are able to access the repository anywhere :).

  • Run this command git config --global pull.rebase preserve to avoid merge-commits but instead let pull rebase your unpushed commites on top of the remote commits

    • If conflict arises, you have to fix them as before, however, you have to remember to type git rebase --continue instead of git commit
    • If you would want to merge a branch, make sure not to use pull, but use fetch && merge --no-ff.

Binary Build Artifacts

Binary builds (of development snapshots and released versions) of usethesource artifacts are available from our own repository. This implies that if you are interested in contribution to a single usethesource project, it should mostly suffice to check solely that specific source repository. All other dependencies are provided as binary artifacts.

The locations of our binary artifact repository is pre-configured in the build configurations of current usethesource projects. There's nothing more to do. For reference we exemplify how to add usethesource dependencies to other projects. In case you use Maven for dependency management, you have to add another repository location to your pom.xml file:

<repositories>
	<repository>
		<id>usethesource</id>
		<url>http://nexus.usethesource.io/content/repositories/public/</url>
	</repository>
</repositories>

Furthermore, you have to declare the project an version as a dependency. In this example we use capsule version 0.2.0 as an example. To reference this specific version, insert the following snippet in your pom.xml file:

<dependency>
	<groupId>io.usethesource</groupId>
	<artifactId>capsule</artifactId>
	<version>0.2.0</version>
</dependency>

Snippets for other build tools and dependency management systems may vary slightly.

Building and Running Projects

usethesource projects are built independently of your preferred IDE with Maven. The recommended way to import a project in your preferred IDE is to import them as Maven project (e.g., Eclipse offers a "Import existing Maven Project" option).

Running a Rascal REPL

To run the latest version of Rascal from command line, we suggest you to clone the rascal project and start up the REPL by invoking mvn exec:java. Here's a complete example:

git clone git@github.com:usethesource/rascal.git
cd ./rascal

mvn clean package
mvn exec:java

Alternatively, a build of rascal also produces an uber-jar that contains all it's dependencies. To execute the self contained jar, follow the following steps:

git clone git@github.com:usethesource/rascal.git
cd ./rascal

mvn clean package
java -jar ./rascal-current.jar

Building the Rascal Eclipse Plugin

The usethesource/rascal-eclipse project contains the codebase for a Rascal Eclipse plugin. The project consists of a set of OSGi conforming modules that are built with the maven/tycho plugin. The sources can be obtained by executing the following commands:

git clone git@github.com:usethesource/rascal-eclipse.git
cd ./rascal-eclipse

The Rascal Eclipse plugin consists of three sub-modules: 1) rascal-eclipse, 2) rascal-feature, and 3) rascal-update-site.

.
|-- pom.xml
|-- rascal-eclipse
|-- rascal-feature
`-- rascal-update-site

Invoking a build on the top-level module causes a build of all sub-modules.

mvn clean package

Each top level build does produce a build of a p2 update site for the Rascal Eclipse plugin. Both in the ./rascal-update-site/target folder and as rascal-update-site/target/rascal-update-site-${version}.zip ZIP file. The resulting update site can instantly be installed and tested in an Eclipse instance.

@Deprecated Step-by-Step Guide

Clone Projects from github

The following projects should all reside in the same workspace which you use to develop Rascal:

Import into Eclipse

  • Import the above projects as existing projects into Eclipse, and you are all set to:
  • Run a second level Eclipse
  • Or Run as the RascalShell from the rascal-shell project

Compile on commandline

  • In the order given above, type mvn clean install in every cloned project

Install Additional Dependencies

Afterwards there are still some dependencies that have to be installed as Eclipse plug-ins:

You can’t perform that action at this time.
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.
Press h to open a hovercard with more details.