...
Info |
---|
This page assumes you have successfully downloaded and installed ONOS. If you have not done that yet, please follow the tutorial Installing and Running ONOS. |
IDE Setup
The project does not enforce the use of a specific IDE, but rather, a set of guidelines that can be configured in an IDE. As such, developers should consult the documentation for the IDE of choice for specific configuration steps.
The examples used here, if any, are either for Eclipse and IntelliJ. If you have no idea where to start, here are some instructions on how to install IntelliJ.
Importing ONOS Source
To take the best support out of your IDE, ONOS should be imported as a Maven project.
In Eclipse, this amounts to:
- navigate to File > Import > Maven > Existing Maven Projects and
- selecting the root directory of your source.
Info |
---|
As ONOS is a multi-module project, it may appear as a collection of many (about 50 at the time of this writing) projects beginning with "onos-". This is normal for some IDEs such as Eclipse. For a listing of the software modules that comprise ONOS, please refer to the Javadocs, or Appendix C of this Guide. |
Tip | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
If you're using Eclipse and see "Plugin execution not covered ..." errors about jacoco-maven-plugin and onos-maven-plugin after importing ONOS projects, follow these steps to eliminate those errors.
|
Code Formatting
The formatting followed by the project are:
- Indentation using four spaces
- No trailing whitespaces, including in empty lines
- Spaces after keywords such as
if
,for
,while
, and casts
The whitespace formatting, among other code styling, is enforced via Checkstyle, which is run against the code during each Maven build. The build will fail if formatting violations are found.
The full guidelines are found in the Code Style Guidelines.
Copyright
Prior to contributing code to ONOS, all developers should set-up their IDE to appropriately tag the code with the Apache 2 license header text. The bare text is checked in under tools/dev/header.txt, and the original can be found at:
http://www.apache.org/licenses/LICENSE-2.0.html
Example: Copyright setup on IntelliJ
First make sure that you have the Copyright plugin enabled. Then, under Preferences, select Copyright section and create a new Copyright profile, call it something like Apache 2, and prime it with the text above, without any decorations. Then configure your copyright formatting options as shown:
Example: Copyright setup on Eclipse
Configure the Comments for Files similar to the following.
Remember to put a check on "Automatically add comments for new methods and types" to apply these templates on new files.
Git/Gerrit Setup
Git remotes
...
The generated documentation is also wrapped into a gzipped tar archive and placed under /tmp with the naming convention onos-apidocs-<onos-version>.<user>.tar.gz.
IDE Setup
The project does not enforce the use of a specific IDE, but rather, a set of guidelines that can be configured in an IDE. As such, developers should consult the documentation for the IDE of choice for specific configuration steps.
The examples used here, if any, are either for Eclipse and IntelliJ. If you have no idea where to start, here are some instructions on how to install IntelliJ.
Importing ONOS Source
To take the best support out of your IDE, ONOS should be imported as a Maven project.
In Eclipse, this amounts to:
- navigate to File > Import > Maven > Existing Maven Projects and
- selecting the root directory of your source.
Info |
---|
As ONOS is a multi-module project, it may appear as a collection of many (about 50 at the time of this writing) projects beginning with "onos-". This is normal for some IDEs such as Eclipse. For a listing of the software modules that comprise ONOS, please refer to the Javadocs, or Appendix C of this Guide. |
Tip | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
If you're using Eclipse and see "Plugin execution not covered ..." errors about jacoco-maven-plugin and onos-maven-plugin after importing ONOS projects, follow these steps to eliminate those errors.
|
Code Formatting
The formatting followed by the project are:
- Indentation using four spaces
- No trailing whitespaces, including in empty lines
- Spaces after keywords such as
if
,for
,while
, and casts
The whitespace formatting, among other code styling, is enforced via Checkstyle, which is run against the code during each Maven build. The build will fail if formatting violations are found.
The full guidelines are found in the Code Style Guidelines.
Copyright
Prior to contributing code to ONOS, all developers should set-up their IDE to appropriately tag the code with the Apache 2 license header text. The bare text is checked in under tools/dev/header.txt, and the original can be found at:
http://www.apache.org/licenses/LICENSE-2.0.html
Example: Copyright setup on IntelliJ
First make sure that you have the Copyright plugin enabled. Then, under Preferences, select Copyright section and create a new Copyright profile, call it something like Apache 2, and prime it with the text above, without any decorations. Then configure your copyright formatting options as shown:
Example: Copyright setup on Eclipse
Configure the Comments for Files similar to the following.
Remember to put a check on "Automatically add comments for new methods and types" to apply these templates on new files.
...
Home : Developer's Guide
Next : Test Environment Setup
...