-
Notifications
You must be signed in to change notification settings - Fork 15
Managing Packages
A package can either be installed by referring to the package file directly or through a package source (repository). We will look into package sources a bit later. Installing a package is done using the oi package install PACKAGE_NAME/PACKAGE_FILE command. This command will install the package in your local active profile. If you want to install the package in your global active profile just add the -g option like this oi package install PACKAGE_NAME/PACKAGE_FILE -g.
After installing/creating packages you can list installed packages using oi package. To print more detailed information about a specific package use the oi package read PACKAGE command.
If you make any changes to an installed package you can use the package build command to create an updated installable package file. For more information on creating and building packages have a look at Creating packages.
To update or uninstall a package run oi package update PACKAGE_NAME/PACKAGE_FILE or oi package uninstall PACKAGE_NAME.
A package source is a repository of packages. Creating stable package sources are recommended. This means only including package versions that play well together. If packages depend on Y-v2.5 and Y-v3.0 is released with breaking changes create a new stable source containing packages compatible with Y-v3.0. The possibility to add multiple sources with conflicting packages is there and if you know what you're doing just go ahead.
Adding package sources
By default if you cloned the binaries repository there is a package source already added. This is the default package repository containing some various generic packages and language plugins. To list added package sources run the oi package src command. If you look at the .source files it outputs you will see that this is a json with available packages. To add another package source run the oi package src add NAME PATH_TO_SOURCE_FILE command. There is also a configuration options to prioritize package sources. Set the oi conf oi.source.prioritization=local,someothersource,openide setting to let OpenIDE know in which order it should look for packages in sources. To list all packages available for a package source use the oi package src list SOURCE_NAME command or drop SOURCE_NAME to list packages for all sources.
Managing package sources
To get an updated list of package from the package source run the oi package src update SOURCE_NAME command or again drop SOURCE_NAME to update all sources. To remove a package source use the oi package src rm SOURCE_NAME command.
Creating package sources
To easier create package source install the sources package by running oi package install sources -g. The sources package adds a sources command and overrides the default package build command. The build override will after any package is built to the default package directory also update any package source definition in that folder.
You can create a package source by going to the folder containing the packages and then running oi sources create NAME. This creates a NAME.sources file in that folder listing contained packages. After creating a package source you will have to go in and change the "origin": "/some/path/NAME.source" attribute in the package source file. Set the origin attribute should be set to the path/url where the source is supposed to be hosted.
Whenever packages are updated in the sources directory just run the oi sources update NAME to update the sources file.