Package Manager for Delphi

    image
    I, like many, have a long history of meeting Delphi - in the good old days, it was fashionable to start learning programming with GWBASIC, which was already outdated at that time, and slender algorithmic Pascal. Delphi, who grew up from Turbo-Pascal, later made a splash with her novelty and “component” approach to development. Then came new powerful languages, the web began to push the desktop, and I went into web development for a long time.
    A couple of years ago, I came to a project that is being developed at Delphi, and after other languages, I realized that I was sometimes not comfortable using it. Most languages ​​have the concept of a “package”, the package managers and repositories that store them, while in Delphi there is nothing similar. All dependent libraries are installed manually, and the paths to them must be written in the file with the project settings. If you transfer the project to another computer, you need to pray that the libraries are in the same folders. This is terrible in my opinion. Dependencies should be registered in the project, and then automatically downloaded and installed if they are not installed, and all paths to the dependencies should be put down automatically.
    So there was a package manager for Delphi - OwlyCI , which I will discuss below.

    If you are familiar with nuget, pear / pecl or, for example, cpan, then you will not find anything new here - a central repository of packages with public and private channels is implemented, there is a command-line utility that can take care of dependencies, build packages, download / upload to repository. Packages are .zip files with source code and a manifest describing the dependencies and assembly rules of owlyci.xml.

    For the convenience of editing package manifests, there is a GUI utility. And for those who do not want to bother with manifests and other things for their projects, but just want to automatically connect dependencies to the current project in the IDE, there is an automatically installed extension (expert) for the Delphi IDE - owlyExpert. The only thing is, this extension works for versions of XE dolphies and higher (maximum was tried on XE4).

    Also, OwlyCI will help determine whether your code will be collected in other versions of Delphi and for other platforms (Win32 / Win64 at the moment). This does not replace unit tests, but it allows you to quickly assess how difficult it will be to migrate to a new version of the dolph. Basically, legacy code on new versions has problems with strings, switching to Win64), assembler inserts, and with the release of the new LLVM compiler, switching to it can be tough. There is one thing but - this service seems to be my friends (you would know how difficult it is to find people with a licensed dolphin), which sometimes include a “building farm” (in fact, a virtual machine on which new packages are downloaded, building for various configuration options / platforms, and issuing build results back to the web Example.

    Fast start


    All commands are documented on the site, as well as the manifest format .

    But usually, if you do not make packages, but only use them in your projects, then you only need to know the basic commands.

    0. Find the packages you need on the site.

    1. Downloading / installing packages 2. In the Project options menu, select the OwlyCI dependencies item, add the dependencies needed by the project to the list. Save the changes to the project, you 're done .

    owlyci --install <имя пакета>



    image

    image


    Now, when compiling the project, the paths to the necessary libraries will be inserted automatically. The paths to the libraries that you inserted earlier manually are saved, so it is a good idea to clean the paths to libraries from garbage before or after including dependencies.
    If you copy the project to a new computer on which OwlyCI is installed, the dependencies will be downloaded and installed automatically.

    Here, in a nutshell, is all about my hobby project, which we are now successfully using in our work projects. If you have questions, I will be glad to answer them.

    Also popular now: