-
Notifications
You must be signed in to change notification settings - Fork 2
Setup
Note: /home/alex/reconfigurator is an example base folder. Feel free to place your files wherever you like.
1.1. Install the prerequisites: Git, the Java Development Kit and Bison (for XTC).
$ apt-get install git default-jdk bison
2.1. Download, extract and launch Eclipse IDE for Java and DSL Developers. This version of Eclipse has support for Xtend. Also add a workspace folder.
$ cd /home/alex/reconfigurator
$ wget -O eclipse-dsl-neon-1a-linux-gtk-x86_64.tar.gz "http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/neon/1a/eclipse-dsl-neon-1a-linux-gtk-x86_64.tar.gz&r=1"
$ tar -xf eclipse-dsl-neon-1a-linux-gtk-x86_64.tar.gz
$ mkdir workspace
$ eclipse/eclipse &
2.2. Set the /home/alex/reconfigurator/workspace as the default workspace.
3.1. Download the C-Reconfigurator source.
$ cd /home/alex/reconfigurator
$ mkdir c-reconfigurator
$ git clone https://github.com/models-team/c-reconfigurator.git c-reconfigurator
3.2. Launch or go to Eclipse.
$ eclipse/eclipse &
3.3. Create a new Java Project.
- Press Shift+Alt+N and select Java Project.
- Write reconfigurator into the "Project name" textbox.
- Click the "Finish" button.
3.4. Convert to Xtext project.
- Right-click the reconfigurator project, select the "Configure" menu and click the "Convert to Xtext Project" button.
- Right-click the reconfigurator project, select the "Build path" menu and click the "Add Libraries" button.
- Select "Xtend Library", click the "Next" button, click the "Finish" button.
3.5. Set up the source folder.
- Expand the reconfigurator project.
- Right-click on the src folder and click the "Delete" button. Then click the "OK" button to confirm.
- Right-click the reconfigurator project, select the "Build Path" menu and click the "Link Source" button.
- Write /home/alex/reconfigurator/c-reconfigurator/src into the "Linked folder location" textbox.
- Write src into the "Folder name" textbox.
- Click the "Finish" button.
- Let Eclipse build the project.
3.6. Add required jars.
- Right-click the reconfigurator project, select the "Build Path" menu and click the "Add External Archives" button.
- In the pop up navigate to /home/alex/reconfigurator/c-reconfigurator/libs.
- Select all files and click the "OK" button.
- Let Eclipse build the project.
4.1. Download the XTC source. It is important that the folder in which the repository is clones is named xtc.
$ cd /home/alex/reconfigurator
$ mkdir xtc
$ git clone https://github.com/models-team/xtc.git xtc
4.2. Update the paths in the /home/alex/reconfigurator/xtc/setup.sh file.
JAVA_DEV_ROOT=/home/alex/reconfigurator/xtc
CLASSPATH=$JAVA_DEV_ROOT/classes:$JAVA_DEV_ROOT/bin/junit.jar:$JAVA_DEV_ROOT/bin/javabdd.jar:$JAVA_DEV_ROOT/bin/org.sat4j.core.jar
JAVA_HOME=/usr/bin
PATH_SEP=:
export JAVA_DEV_ROOT CLASSPATH JAVA_HOME PATH_SEP
4.3. Configure and build the project.
$ cd xtc
$ source setup.sh
$ make configure
$ make jars
4.4. Right click the reconfigurator project in Eclipse, select the "Build path" menu and click the "Configure Build Path" button. Go to the "Libraries" tab. Replace the external JAR /home/alex/reconfigurator/c-reconfigurator/libs/xtc.jar with the newly created /home/alex/reconfigurator/xtc/bin/xtc.jar.
5.1. Launch or go to Eclipse.
$ cd /home/alex/reconfigurator
$ eclipse/eclipse &
5.2. Create a new Java Project.
- Press Shift+Alt+N and select Java Project.
- Write xtc into the "Project name" textbox.
- Click the "Finish" button.
5.3. Set up the source folder.
- Expand the xtc project.
- Right-click on the src folder and click the "Delete" button. Then click the "OK" button to confirm.
- Right-click the xtc project, select the "Build Path" menu and click the "Link Source" button.
- Write /home/alex/reconfigurator/xtc/src into the "Linked folder location" textbox.
- Write src into the "Folder name" textbox.
- Click the "Finish" button.
- Let Eclipse build the project.
5.4. Add required jars.
- Right-click the xtc project, select the "Build Path" menu and click the "Add External Archives" button.
- In the pop up navigate to /home/alex/reconfigurator/xtc/bin.
- Select the jababdd.jar, junit.jar and org.sat4j.core.jar files and click the "OK" button.
- Let Eclipse build the project.
5.5. Exclude unused files.
- Right-click the xtc project, select the "Build Path" menu and click the "Configure Build Path" button.
- Click on the "Source" tab, select the "Excluded" pattern and click the "Edit" button.
- At the "Exclusion patterns" section click the "Add" button, write xtc/lang/cpp/.CContext.java in the textbox and click the OK button.
- Repeat step 3, exclude xtc/lang/cpp/CContext_parsingonly.java.
- Repeat step 3, exclude xtc/lang/cpp/CContext_typechecker.java.
- Repeat step 3, exclude xtc/lang/cpp/CTypeChecker.java.
- Click the "Finish" button. Click the "OK" button.
- Let Eclipse build the project.
5.6. Right click the reconfigurator project in Eclipse, select the "Build path" menu and click the "Configure Build Path" button. Go to the "Libraries" tab. Remove the external JAR /home/alex/reconfigurator/c-reconfigurator/libs/xtc.jar (or /home/alex/reconfigurator/xtc/bin/xtc.jar). Go to the "Projects" tab. Click the "Add" button, select the xtc project and click "OK". Let Eclipse build the project.