Skip to content

Commit 2216637

Browse files
Merge pull request #343 from matthiaskoenig/build-instructions
Build instructions
2 parents ebd0c86 + 0628e38 commit 2216637

File tree

6 files changed

+167
-142
lines changed

6 files changed

+167
-142
lines changed

docs/develop.md

+133-93
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ To develop `cy3sbml`, the following dependencies must be installed:
2020

2121
## Installation Steps
2222

23-
### 1. Install Cytoscape
23+
### Install Cytoscape
2424

2525
Download and install the latest **Cytoscape 3** version (≥ 3.10.3) from:
2626
[http://www.cytoscape.org](http://www.cytoscape.org)
2727

28-
### 2. Install Maven
28+
### Install Maven
2929

3030
Cytoscape apps are built using **Maven (version 3 or higher)**. Follow the installation guide for your platform:
3131
[Apache Maven Installation Guide](https://maven.apache.org/install.html)
@@ -35,7 +35,7 @@ To verify the installation, check the Maven version:
3535
mvn -v
3636
```
3737

38-
### 3. Install Java JDK 17
38+
### Install Java JDK 17
3939

4040
Cytoscape apps require **Java JDK 17**. Follow the installation instructions based on your operating system.
4141

@@ -63,78 +63,76 @@ Verify the Java installation:
6363
java -version
6464
```
6565

66-
### JavaFx
67-
JavaFx (https://openjfx.io/index.html) is no longer included in the JDK. Therefor it must be installed separately and
68-
the idea must be made aware of the installation
66+
### JavaFX Setup
6967

70-
For instance on linux
68+
[JavaFX](https://openjfx.io/index.html) is no longer bundled with the JDK, so it must be installed separately and configured in your IDE.
69+
70+
#### **1. Installing JavaFX**
71+
On Linux, install JavaFX using the package manager:
7172
```bash
7273
sudo apt-get install openjfx
7374
```
74-
This has to be setup correctly:
75-
https://stackoverflow.com/questions/27178895/cannot-resolve-symbol-javafx-application-in-intellij-idea-ide
76-
In idea add the `/usr/share/openjfx/lib/` to the project via `File -> Project Structure -> Project Settings -> Libraries`.
7775

76+
#### **2. Configuring JavaFX in IntelliJ IDEA**
77+
To resolve missing JavaFX symbols in IntelliJ IDEA, add the JavaFX library manually:
78+
1. Open **IntelliJ IDEA**.
79+
2. Navigate to **File → Project Structure → Project Settings → Libraries**.
80+
3. Click **+ (Add Library)** and select **Java**.
81+
4. Add the JavaFX library path:
82+
```
83+
/usr/share/openjfx/lib/
84+
```
85+
5. Apply and save the changes.
7886

79-
With these dependencies installed, you are ready to start developing `cy3sbml`.
87+
For further troubleshooting, refer to this [Stack Overflow discussion](https://stackoverflow.com/questions/27178895/cannot-resolve-symbol-javafx-application-in-intellij-idea-ide).
8088

8189

8290
## Build cy3sbml
83-
### git Repository
84-
Clone the repository from github
85-
```
91+
92+
### Setup repository
93+
94+
Clone the `cy3sbml` repository from GitHub:
95+
96+
```bash
8697
git clone https://github.com/matthiaskoenig/cy3sbml.git
8798
```
88-
If the repository exists pull the latest code via
89-
```
90-
cd cy3sbml
91-
git pull
92-
```
93-
An overview over the available branches is available via
94-
```
95-
git branch -a
96-
```
97-
The master branch contains the stable releases, with development code in the develop branch. All development work is done in the development branch. To work with the development branch, you'll need to create a local tracking branch:
98-
```
99-
git checkout -b develop origin/develop
100-
```
101-
To build the development version, checkout the develop branch
102-
```
99+
The latest development branch is `develop`. Switch to it using:
100+
101+
```bash
103102
git checkout develop
104103
```
105104

106-
### maven build
107-
The clean build can be run via
105+
### Build with Maven
106+
107+
To build `cy3sbml` without running tests:
108+
108109
```bash
109110
mvn clean install -DskipTests
110111
```
111112

112-
To run the tests (which take a long time and performed in continuous integration) use
113+
To build and run tests (note: this may take a long time):
114+
113115
```bash
114116
mvn clean install
115117
```
116-
The target jar is located in
117-
```
118-
./target/
119-
```
120118

121-
### cy3sbml Install
122-
The last step is installing the app. You can install cy3sbml as app with the created jar file directly within Cytoscape
123-
```
124-
Apps → App Manager → Install Apps
125-
```
126-
Select `Install from File` and use the `cy3sbml-*.jar` located in the `cy3sbml/target/` folder of the git repository.
119+
The built `.jar` file will be located in:
127120

128-
To manually install the cy3sbml jar remove all old cy3sbml jars from
129-
```
130-
$HOME/CytoscapeConfiguration/3/apps/installed/
121+
```bash
122+
./target/cy3sbml-0.*.*.jar
131123
```
132-
and copy the new jar in the respective folder.
133124

134-
To update the app cy3sbml automatically after every build, set a symbolic link of the to the build cy3sbml jar in the Cytoscape installed apps folder
135-
```
125+
With these steps completed, `cy3sbml` is ready for development and testing.
126+
127+
### cy3sbml Install
128+
The last step is installing the app. To update the app cy3sbml automatically after every build, set a symbolic link of the to the build cy3sbml jar in the Cytoscape installed apps folder.
129+
```bash
136130
ln -s $CY3SBML/target/cy3sbml-0.*.*.jar $HOME/CytoscapeConfiguration/3/apps/installed/cy3sbml-latest.jar
137131
```
132+
e.g.
133+
```bash
134+
ln -s /home/mkoenig/git/cy3sbml/target/cy3sbml-0.4.0.jar $HOME/CytoscapeConfiguration/3/apps/installed/cy3sbml-latest.jar
135+
```
138136
The link has to be updated with increasing versions.
139137

140138
## Development
@@ -144,61 +142,103 @@ Open the GitHub Repository with Intellij
144142
- In Intellij, go to the File menu and choose Open.
145143
- Navigate to the cloned git repository and open it.
146144

147-
https://github.com/cytoscape/cytoscape/wiki/Launch-and-Debug-from-Intellij
148-
145+
### Launch Cytoscape
146+
The cy3sbml app should now be installed via a symlink (see above).
147+
Cytoscape can be launched from the command line in either **normal mode** or **debug mode**.
149148

150-
### Launch and debug app
151-
I presume you have installed your App using a symlink.
152-
153-
Launch Cytoscape from the commandline in either normal mode or debug mode
154-
In Windows:
155-
```
156-
cytoscape.bat
157-
cytoscape.bat debug
158-
```
159-
In Linux/Mac:
149+
#### Windows
150+
Open a command prompt and run:
151+
```bash
152+
cytoscape.bat # Normal mode
153+
cytoscape.bat debug # Debug mode
160154
```
155+
156+
#### Linux / macOS
157+
Run the following command:
158+
```bash
161159
cytoscape.sh debug
162160
```
163161

164-
...from the Intellij IDE
165-
166-
From the main menu select Run and Edit Configurations...
167-
In the upper left corner select '+', you will be prompted to Add a New Configuration, select Bash (This requires the BashSupport plugin)
168-
You will be provided with a dialog for the configuration.
169-
Set the name to something appropriate: Cytoscape 3
170-
Script: navigate to location of cytoscape.sh
171-
Interpreter path: /bin/bash
172-
Program arguments: debug or leave blank if you are not debugging your App
173-
Apply and Close
174-
From the main menu select Run and Cytoscape 3
175-
176-
Cytoscape should launch and you should see the console output in the Run panel.
162+
#### Configuring Cytoscape Debug Mode in IntelliJ IDEA
163+
You can set up a debug start configuration in **IntelliJ IDEA** to streamline the development process.
177164

178-
Debugging your App
179-
...from the Intellij IDE
165+
##### 1. Create a New Run Configuration
166+
1. Open **IntelliJ IDEA**.
167+
2. From the main menu, navigate to **Run → Edit Configurations...**.
168+
3. In the upper-left corner, click **+** to add a new configuration.
169+
4. Select **Shell Script** as the configuration type.
180170

181-
We will be defining a configuration for debugging our App.
171+
##### 2. Configure the Debug Start Script
172+
In the **Run/Debug Configuration** dialog:
173+
- **Name**: Set to an appropriate label (e.g., **Cytoscape 3 Debug**).
174+
- **Script**: Navigate to the location of `cytoscape.sh` (e.g., `/path/to/cytoscape.sh`).
175+
- **Interpreter Path**: Set to `/bin/bash` (or the appropriate shell for your system).
176+
- **Program Arguments**: Set to `debug` if debugging, or leave blank for normal mode.
182177

183-
From the main menu select Run and Edit Configurations...
184-
In the upper left corner select '+', you will be prompted to Add a New Configuration, select Remote
185-
You will be provided with a dialog for the configuration.
186-
Set the name to something appropriate: Cytoscape 3: Create Network View
187-
Debugger mode: Attach to remote JVM
188-
Host: localhost, Port: 12345
189-
Command line args: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=12345
190-
Use module classpath: <no module>
191-
Before launch: +
192-
Run Maven Goal
193-
Working directory: .../cytoscape-app-samples/sample-create-network-view
194-
Command line: compile
195-
From the main menu select Run and Debug Cytoscape 3
178+
Click **Apply** and **Close**.
196179

197-
The Intellij Debugger
180+
##### 3. Run Cytoscape in Debug Mode
181+
1. Open **Run → Cytoscape 3 Debug** from the main menu.
182+
2. Cytoscape will launch, and the **Run panel** will display debug output, including:
198183

199-
Here is a nice tutorial on how to use the Intellij debugger: Java Debugging with Intellij
200-
201-
## Advanced topics (core developers)
184+
The output after starting Cytoscape in debug mode should be one of the following:
185+
```bash
186+
Listening for transport dt_socket at address: 12345
187+
```
188+
You are now ready to debug and develop `cy3sbml` within Cytoscape.
189+
190+
191+
### Debugging cy3sbml
192+
#### Debugging in IntelliJ IDEA
193+
194+
To debug `cy3sbml`, we will configure **IntelliJ IDEA** to attach to Cytoscape's remote JVM for debugging.
195+
196+
#### 1. Create a Remote Debugging Configuration
197+
1. Open **IntelliJ IDEA**.
198+
2. From the main menu, navigate to **Run → Edit Configurations...**.
199+
3. Click **+** to add a new configuration.
200+
4. Select **Remote JVM Debug**.
201+
202+
#### 2. Configure the Debugging Session
203+
In the **Run/Debug Configuration** dialog:
204+
- **Name**: Set an appropriate name, e.g., **Cytoscape 3: cy3sbml**.
205+
- **Debugger Mode**: Select **Attach to Remote JVM**.
206+
- **Host**: `localhost`
207+
- **Port**: `12345`
208+
- **Command Line Args**:
209+
```bash
210+
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=12345
211+
```
212+
- **Use module classpath**: Select `<no module>`.
213+
- **Before launch**: Click **+**, then select **Run Maven Goal**.
214+
- **Working directory**: `/home/mkoenig/git/cy3sbml`
215+
- **Command line**: `compile`
216+
217+
#### 3. Start Debugging
218+
1. From the main menu, go to **Run → Cytoscape 3: cy3sbml**.
219+
2. Cytoscape should now be running with debugging enabled.
220+
3. Set breakpoints in your code, and IntelliJ IDEA will pause execution when those breakpoints are hit.
221+
222+
#### **4. IntelliJ Debugger Guide**
223+
For a detailed guide on using the IntelliJ debugger, refer to:
224+
[Java Debugging with IntelliJ IDEA](https://www.jetbrains.com/help/idea/debugging-code.html).
225+
226+
### **Hotswap: Live App Updates**
227+
Java, along with Cytoscape, supports a feature called **Hotswap**, which allows automatic updates to your App without restarting Cytoscape.
228+
229+
- When the `cy3sbml` JAR file is placed in the following directory:
230+
```bash
231+
~/CytoscapeConfiguration/3/apps/installed/
232+
```
233+
- Cytoscape will detect the change and automatically reload the updated App.
234+
- This allows for **faster testing and debugging** without restarting Cytoscape.
235+
- The howswap can be triggered via `mvn install -DskipTests`
236+
237+
For more details, see the official documentation:
238+
[Cytoscape Java Hotswap](https://github.com/cytoscape/cytoscape/wiki/Java-Hotswap).
239+
240+
241+
## Advanced topics
202242

203243
### Update JSBML dependencies
204244
For installation one can setup an environment variable referring to the cy3sbml source folder. This will simplify the subsequent steps

docs/release.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# cy3sbml Release Instructions
2+
3+
- build latest version `mvn clean install -DskipTests` resulting in `./target/cy3sbml-0.*.*.jar`
4+
- update release notes in `release-notes`
5+
- commit all changes to develop branch
6+

0 commit comments

Comments
 (0)