Assume, I have project C++ project called A which uses libraries generated in project B. That two project are placed on my Gitlab instance. What I want to do, is to make Continuous Integration Pipeline for project A. That pipeline gets the source of project B, build a library and links it to project A. How to make project B accessible from project A? Many other projects, like C, D, etc. use projects' B library.
Related
I have multiple C++/C# Visual Studio Solutions some depend on each other, in the building Process I make the building order manually and build them one by one until the end.
now I will be going to continuous Integration "CI",
My Question Is: is there any tool or method to automatically generate the correct building order?
My Project Structure Looks Like that:
All_Code:
VS Solution A:
Project A.1
Project A.2
VS Solution B:
Project B.1
Project B.2
Let's say Project B.1 Depends on A.1 and A.2 Depends on B.2
so, when I am building I order them as follows:
A.1
B.1
B.2
A.2
Create one solution (.sln) file that contains all the projects in the CI build and plan to use that solution file for the CI build.
Now, you can either discard the use of the existing 'A.sln' and 'B.sln' solutions and add project references in the projects (Project B.1 would have a project reference to A.1 for example) or set the build order in the new .sln file itself.
Prefer to use project references if possible because they have options and capabilities that the other approach doesn't offer. But note that a project reference is a change to the project file. Further the referencing project and the referenced project must both be in the solution. That means that using project references will break the existing 'A.sln' and 'B.sln' solutions.
You can, however, create solution filter files (.slnf) for the new .sln to create 'views' that are equivalent to the 'A.sln' and 'B.sln'. (See Filtered solutions in Visual Studio.)
If you need to keep 'A.sln' and 'B.sln' and keep them useable, you can manually set the build order in the new solution. In the solution properties in the 'Project Dependencies' section, manually set each project's dependencies. This is stored in the .sln file. The project files are not changed. However, the dependencies set in the .sln file will need to be kept in sync with the project's actual dependencies.
The tooling will automatically determine the build order based on both the project references in the projects and the project dependencies in the solution.
I googled this a lot and I found very poor solutions on how packages are managed in C++.
Let's suppose that I am working on a project called Project C which is dependent on C++ project Project B, and Project B is dependent on another C++ project Project A.
Currently, we use Visual Studio to develop our projects. When Project A changes, every single developer pulls the changes and recompiles the project locally. Every single developer has a lib folder with all of these dependencies that contains the DLLs and header files that we copy for each project manually.
Then since we know the dependencies, we then go to every project that is dependent on Project A, copy the dlls of Project A from lib folder and recompile those as well until we get what we want.
I know however, that C# has nuget and one can manage external dependencies and Java has maven where one can do the same.
What we currently do is a manual, error prone and extremely time consuming process. Is there a way to handle dependencies for C++? We should be able to build with the debug ddls of the dependencies when compiling as debug and the release dlls when compiling as release. For now we just need to have the latest dlls.
We have jenkins installed and if we could use that to help us that would be perfect. For java projects our java engineers compile the project and maven packages are pushed into a maven repository from where everybody else is just pooling. As simple as that. But how we can achieve similar functionality in C++?
I have two projects which I want to keep in separate repositories.
Project A is a large project, and project B is a small tool that was at first part of project A.
So the thing is project A needs some of the functions of project B, and project B needs the data structures defined in project A (and probably some functions as well).
I'm coming from a Go background where each module or package would have its own repo. For example, if both project A and project B had to read a particular file type, I would have a "file-reader" package in a separate repo. Is this the way to go with C++ as well?
You should separate your projects into shared libraries, and put the artifacts on Conan. Any executable would need the shared libraries from both project A, and Project B. You can also add the circular dependency to Conan, so both project A and Project B will build (i.e.. Project A depends on B to build, and B depends on A).
https://docs.conan.io/en/latest/
I am creating a C++ shared library and targeting multiple platforms (Android, iOS and Windows). Usually, I use this step to the create the shared library. I first create a Console DLL Windows library project which creates dll share library I can use for testing on Windows.
The problem is that when I want to build the project to generate Android and iOS shared libraries, I have to create a new project then select "Dynamic Shard Library (Android)" and "Dynamic Shard Library (iOS)" and then manually copy the existing C++ header and source files to that new Project. I basically have to create new project for each platform. After this, I have to change some settings to match the settings from the original C++ Windows project.
This is tiresome and I can't continue to do it like this.
Is there a way to add more target platforms to an existing project without creating new project? I just want to be able to change the platform then build the project from one project only. Is this possible?
I have an application Project A that depends on a shared library Project B, with each project having its own VCS Root (different Git repository).
Each project versions independently, e.g. Project A could be at 1.0 while Project B is at version 2.0. We're using GitFlow as a the release model. When we make a change to both Project A and B for a release, each project would have a different release branch name. e.g. Project A: /release/1.0-rc, Project B: /release/2.0-rc.
It is possible somehow to configure Project A release build to have a Snapshot/Artifact Dependency on Project B release build?
While adding a new Artifact dependency, it is requested to add the Depend on, which will be on your Project B configuration.
Then, you can specify the Get artifacts from to Latest successful build, then it will be ask if available, the Build branch to use.
The default value is <default> and in your case, it would be : release/2.0-rc.
Note, in order to make this feature available, your VCS root should have multiple watching branches inside Branch specification