During the last couple of years, continuous integration (CI) and automated release management methodologies have become much stronger in non-Java builds.
Number of familiar tools are used for these methodologies, like the version control system to manages your sources, your build tool to actually build your software from sources and your build server, which builds your software continuously using the build tool. But is there something else missing? Let’s look at a simple diagram, which describes your CI process:
- Developers fetch needed dependencies (3rd party libraries, other modules).
- Developers write new code.
- Code is committed to VCS.
- Build server polls VCS for changes.
- Once discovered, the build server builds the software: compiles it, runs tests, and assembles artifacts.
- Built artifacts are published to QA, staging, or even directly to the end users.
As you can see, everything except stages 1 and 6 is well known and familiar. But what about those two stages? You need a dependency management mechanism for them.
In this post, we’ll illustrate the options for automated builds with dependency management in non-Java builds or when not using .NET with NuGet (use it, if you can! Here’s our take about it). The proposed solution works for any kind of build, be it C, C++, C#, iOS and Objective C, Python, or whatever.
So, let’s see how you can implement CI with dependency management for non-Java projects. Here are the options with their pros and cons:
# | Solution | Pros | Cons |
---|---|---|---|
1 | Dependencies in VCS |
|
|
2 | Build tools with built-in dependency management like Maven and Gradle |
|
|
3
|
Declare dependencies on builds in your build server
|
|
|
4
|
Use shared dependencies storage, a.k.a. “repository” (FTP, file server, etc.)
|
|
|
As you can see, none of the solutions are without the cons.
Here comes Artifactory
Next, configure your custom deployment and resolution rules. Let’s start with deployment (publishing):
In the above example, we configured the following rules for deployment. All the artifacts will be deployed from the working directory into the ‘libs-release-local’ repository (configured above), maintaining the path for each file:
Pattern | Meaning |
---|---|
**/x64/*.dll=>x64Win | Deploys all DLLs to the ‘x64Win’ directory |
**/*.zip=>winFiles | Deploys all zip files to the winFiles directory |
unix/*.tgz | Deploys all tgz files under the unix directory to the root directory of the target repository |
The plugin also controls which artifacts to resolve from the repository before the build starts. The resolution allows you to specify smart search patterns:
In the above example, we configured the following rules for dependencies resolution