📜 ⬆️ ⬇️

Package Manager for Delphi

image
I, like many, have a long history of acquaintance with 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 out of Turbo-Pascal, later created a sensation with its novelty and “component” approach to development. Then came new powerful languages, the web began to crowd the desktop and I went into web development for a long time.
A couple of years ago I came to a project that was being developed at Delphi, and after other languages, I realized that sometimes I was uncomfortable using it. In most languages, there is the concept of “package,” package managers and repositories that store them, but there is nothing like Delphi. All dependent libraries are set manually, and the paths to them must be entered in the file with the project settings. If the project is transferred to another computer, then you need to pray for the libraries to be 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 dependencies should be put down automatically.
So the package manager for Delphi, OwlyCI , appeared , 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 knows how to take care of dependencies, build packages, download / upload to repository Packages are .zip files with source code and a manifest that describes the dependencies and build rules of owlyci.xml.

For ease 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, and you just want to automatically connect the dependencies to the current project in the IDE, there is an automatically installable extension (expert) for the Delphi IDE - owlyExpert. Only, this extension works for versions of Delphi XE and above (maximum tried on XE4).

Also, OwlyCI will help determine whether your code will be built in other versions of Delphi and for other platforms (Win32 / Win64 at the moment). This does not replace unit-tests, but allows you to quickly assess how complex the migration to the new version of delphi will be. Basically, the legacy code on new versions has problems with strings, switching to Win64), assembler inserts, and with the release of the new LLVM compiler, the transition to it can be tough. But there is one thing - this service seems to be my friends (you would know how difficult it is to find people with a licensed delph), which sometimes include a “building farm” (in fact, a virtual machine where a jump occurs in new packages, building for various configuration options / platforms, and delivering build results back to the web. Example: This repository function is not guaranteed - I don’t have any desire to buy Delphi for this - I don’t have enough extra 60K for the first time and then 30K every six months. or good people.
')
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 will only need to know the basic commands.

0. Find the packages you need on the site.

1. Downloading / installing packages

owlyci --install < >


2. In the Project options menu
image
select the item OwlyCI dependencies, add to the list the necessary dependencies for the project
image

Save changes to the project, ready .
Now, when compiling the project, the paths to the necessary libraries will be inserted automatically. The paths to the libraries that you put in before were manually saved, so it’s a good idea to clean the paths to the libraries from debris before or after enabling dependencies.
If you copy the project to a new computer on which OwlyCI is installed, dependencies will be downloaded and installed automatically.

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

Source: https://habr.com/ru/post/202130/


All Articles