Building and Creating a Package by Using the JET IDE
After writing your application, write the JSON file by providing details about your application, which the system uses to autogenerate the makefiles and manifest file.
If you are not using the JET IDE, write the application JSON file inside your sandbox. For more details, see JSON File Format for JET Application Packaging.
To create the JSON file and the JET package using the JET IDE:
- Highlight the src directory in the Sandbox
Explorer pane, either select File > New > File or right-click
and select New > File, type the filename (use the
.jsonextension), and click Finish.
The JSON file is placed under the python directory in the Sandbox Explorer pane, and the JSON Editor is opened and ready for you to create the JSON file. If the JSON Editor does not open, right-click the
.jsonfile and select Open With > JSON Editor.
- Provide the necessary information about the application
and save the file.
Application Name—Specify the path to the application's implementation directory. If the application is a binary, the application name is treated as a binary name. The package name created is based on the value in this field.
Application Path—Specify the path to the application directory.
Language—Select the language used for developing the application.
Main scripts—This is a list attribute and is generally applicable for Python applications. For binary applications, this item is optional. Main scripts are searched under the application path.
Specify the filename or filenames of the main script or scripts that run on the device. Click Add to add a filename and path. Select a file and click Remove to remove a file.
Application type—Select whether an application is to be a standalone program or a daemon.
Signed application—Select yes or no.
Target OS—Select BSD 6 for legacy Junos OS or BSD 10 for Junos OS with updated FreeBSD. Select BSD 11 for Junos OS Release 17.4R1 and later.
Target architecture—Specify the target architecture on which the application is to be deployed.
Application description—Specify a brief (one-line) description about the application. This description will be displayed in the CLI show version operational command.
Specify the list of C compiler flags, the list of C++ compiler flags, and the list of linker flags, if any.
Use linker flags to specify additional libraries to link with or additional link-specific flags that are required during linking,
Source files and modules—Select a category and click Add to add a filename and path.
Click Preview at any point to see the JSON file format in code.
- Do one of the following to save the JSON file: select File > Save, press Ctrl+s, or click the diskette icon.
- Select the JSON file and click Juniper Extension
Toolkit > Generate Build Files from the menu bar.
The makefiles and manifest file are generated automatically..
- Select the project directory in the left pane and then
select one of the following:
Juniper Extension Toolkit > Build Sandbox—Build the applications using the configuration provided in Build Configuration.
Juniper Extension Toolkit > Build Configuration—Select which applications to build, which targets to build for, and build once you click Finish.
Juniper Extension Toolkit > Run JET Configuration—Specify which device to load the application on and what commands and configurations to include.
Once the build is successful, the package is created in the project
shipdirectory is in the project directory under the
junos-jet-sb-objdirectory. You can see the ship directory in the left pane once the package has been built.