Skip to content

Building Vis From Source

Paweł Pastuszak edited this page Mar 11, 2016 · 16 revisions

Prerequisites:

  • Git with LFS extension installed
  • JDK 8

Clone repository:

git clone https://github.com/kotcrab/vis-editor vis-editor

Command line

Running from command line:

gradlew :editor:run

Building zip distribution:

gradlew destZip

This will create zip file in vis-editor\build\distributions containing main jar file, built-in plugins and all required editor libraries.

Intellij IDEA

Intellij IDEA is recommend IDE for Vis development. This section will explain how to setup Vis development environment. Select File, New, Project from Existing Sources and then select root build.gradle file. Press OK in next window and then press OK again in module selection window.

Common problems

If you are getting errors about invalid source level press Ctrl+Shift+Alt+S to open Project Settings, go to Project tab and set project language level to 8.

Launching Editor

  1. Create new Gradle run configuration, change name to something like "Run Editor"
  2. Set Gradle project to vis-editor:editor
  3. Set task to run
  4. Set VM options to -Dfile.encoding=UTF-8
  5. Save configuration and launch, use this configuration for future launches.

Launching VisUI test application

  1. Create new Gradle run configuration, change name to something like "Run UI test app"
  2. Set Gradle project to vis-editor:ui
  3. Set task to run
  4. Save configuration and launch, use this configuration for future launches.

Below are obsolete instructions for old Maven build project

Just import VisParent project via Maven integration in your IDE (pom.xml in root repository directory). Your IDE should automatically import dependent project: (VisUI, VisRuntime, VisEditor etc.) If that won't happen just import projects one by one.

Intellij IDEA

Intellij IDEA is recommend IDE for Vis development. This section will explain how to setup Vis development environment.

Project Setup
  1. Clone repository using Git.
  2. Select File -> Open... then navigate to directory where you cloned repository.
  3. Select pom.xml in root directory and click OK. IDEA will open project and automatically import all dependent projects. If you don't see projects in File Explorer, just wait. IDEA didn't finished downloading everything. You can check progress at the bottom of the screen.
Launching Editor
  1. Create new Application launch configuration.
  2. Set main class to com.kotcrab.vis.editor.ui.EditorFrame.
  3. Set VM options to -Dfile.encoding=UTF-8.
  4. In field Use classpath of module select vis-editor
  5. Save configuration and launch, use this configuration for future launches.
Launching Editor for built-in plugin development

Plugin development requires to put plugins jars in root/Editor/target/plugins before launching editor. Maven can be used to automatize this process for built-in plugins.

Side note: If you are creating custom plugin you can create Maven task that will copy plugin jar to target location and execute it before launch in similar way as described here. Instead of Maven you can use Ant, Gradle or whatever other build system you prefer.

  1. Clone normal VisEditor launch configuration.
  2. Find Before launch section click green plus icon, select Run Maven Goal.
  3. Set Working directory to repository root (very important!)
  4. Set goal to package -Dmaven.test.skip=true -Peditor-plugin-jar
  5. Save configuration and launch, use this configuration for future launches.
Launching VisUI demo
  1. Create new Application launch configuration.
  2. Set main class to com.kotcrab.vis.ui.test.manual.TestLauncher.
  3. In field Use classpath of module select vis-ui
  4. Save configuration and launch, use this configuration for future launches.

Launching VisEditor from command line

VisEditor uses Maven for its build system. If you want to run editor without IDE you will need Maven. Command mvn must be available from command line.

Start by cloning repository or by downloading zip file.

Launching for the first time:

E:\SomeFolder\VisEditor> mvn install -Peditor-plugin-jar
E:\SomeFolder\VisEditor> cd Editor
E:\SomeFolder\VisEditor\Editor> mvn exec:java

First launch will take more time, Maven will have to download all required dependencies.

Launching if nothing outside editor folder was modified: (editor source can be modified between launches but if you change something in runtime, ui or plugins you will have to execute same commands as during first launch)

E:\SomeFolder\VisEditor\Editor> mvn exec:java