Managed builds on Linux - c++

We have a TFS server which runs builds of our Windows-based software.
Now we had to port part of our software to Linux and we want to run the builds in a similar manner on Linux.
The project on Linux is created using Eclipse CDT, written in C++. The question would be how to run builds of this project on a Linux machine, and will it be possible to somehow integrate it into TFS infrastructure? For quality control, etc.

There is no out-of-the-box solution: currently there are no agents for Linux.
But wait, I did this once for a customer. The solution's pieces were:
setup SSH on Linux
write a Linux build script and save it in TFS version control
modify the custom template using the Community Build Extensions to:
a. push the script
b. invoke the script remotely
c. collect the build log(s)
d. copy the logs to the OutDir
I wrote a blog post with detailed instruction: http://casavian.eu/wordpress/2014/02/13/integrating-linux-builds-in-tfs/.

Related

How to write native C++ in VS 2022, using Linux for build and test

I need a native C++ app to make from scratch. It has to run on linux (CentOS). I want to use VS2022 to write and test. I have Hyper-V VM with CentOS.
I tried to google a solution but there are only posts for using WSL.
Can someone please describe steps to connect VS to Linux VM instead of WSL so I can build and run the app on the VM.
This article describes the process: https://devblogs.microsoft.com/cppblog/linux-development-with-c-in-visual-studio/
add workload to the VS using VS Installer (Linux and embedded..)
create project of correct type
add SSH credentials in the project Properties (also can be added/removed/edited in Tools-Options-Cross Platform)

Visual Studio 2017 remote code synchronization

I've been developing a c++ project on linux remote server these days, however, I'd like to do all the coding things on my windows machine using VS2017. So I need some kind of synchronization tool to synchronize the codes such that whenever I save the file in VS2017 the changes can be synchronized to the linux server immediately. Is there any tool or VS2017 extension can help me?
I don't want to use git as it may cause a lot meaningless commits.
Several ideas:
Cygwin. Compile your code on the emulated Linux/Unix environment for local testing and use Visual Studio as your IDE. Do final testing on the Linux box with less frequency. Can be combined with any of the ideas below.
Git, but with a different branch for commits. Do a squashed merged for all meaningful commits or pull requests to master.
Samba. Mount your Linux file system on your Windows PC or vice versa. Copy files between Windows and Linux as if was a network drive.
Local VM. Run Linux in a local Virtual Machine with VMWare or VirtualBox. Drag and drop files between Windows host and Linux guest OS using the host/guest extensions stuff. Then you can dink around with deploying to the real Linux machine later.
Personally, for my open source projects where I'm too lazy to boot into Linux locally to test code before deploying to AWS, I basically do some combination with the above.
And #5 of course is: Dropbox. :( I use OneDrive and a Python script on Linux to pull down files.

How to build Qt applications using Team Foundation Server 2017

I am currently in the process of migrating a couple of legacy Qt5 projects to a new Team Foundation Server. All projects have been developed for Windows in Visual Studio using the Qt VS AddIn (and thus don't use .pro-files). I would love to use the TFS Build Agent to build these on other platforms (mainly linux).
I have previously done this on other projects using Jenkins and qmake, having platform-dependent settings in the .pro-file.
Is there an established workflow for building VS projects using Qt5 via a TFS Build Server on other platforms?
I don't use TFS but, since TFS Build operates on Visual Studio solutions, it ought to be possible to use the "Linux development with C++" feature of VS2017. Just setup a Linux project in the VS solution and it should build like any other.
Seems you'd like to build Cross-Platform Code in Linux using TFS vNext build system. To build or deploy you'll need at least one agent. The cross platform build agent is support on Ubuntu, Red Hat, and CentOS.
Detail steps please refer this tutorial-- Deploy an agent on Linux. Then simply create the build definition add build task, select the Linux build agent the same as build on windows. More detail step and build configuration you could take a look at this video tutorial-- Building and Deploy Applications In Linux With TFS
In your case, there is not corresponding VS/Qt VS AddIn in your Linux environment. You need to set up your Linux build agent local environment to build your qt5 application successfully, then it's not hard to build through tfs.
Another way is scripting the Linux build process to run over SSH or some other remote protocol, and driving this process from the Windows build agent.

TFS Builds using Eclipse CDT from Debian Box

I would like to use TFS Build system from Debian OS, I develop using C++, my IDE is Eclipse CDT. I would like to know if using TFS Build System is possible, if so how? as a side note, My development heavily relies on Boost libraries and QT.
Yes and no. You cannot run TFS builds on Linux. However you can use TFS build to run ANT or Maven, which in turn can be used to build c++.
The build will run on a TFS build agent, which will be a windows machine. Usually a different machine to the TFS server. This can be a VM, your TFS gurus should be able to set this up for you.
To use ANT or Maven you need the TFS build extensions the link is for the TFS 2012 version, however there are extensions for older versions of TFS.
Once you have a build server set up you can use ANT to build your c++ code or Maven.
If I was going to attempt this, I would get the ANT build working on a windows box first, then plumb it in to TFS with the extensions.
However, you might be better off using a more generic build engine such as Jenkins, running on Linux which connects to TFS to retrieve the code.

How Remote Development of C++ works in Netbeans?

Hi we want to use remote development features of netbeans but while trying out on our setup its very slow. I want to understand its feasibility of integrating our build environment with netbeans.
Our setup would be normally:
1. Windows 7 Professional 64bit where we install netbeans
2. RHEL 5.5 64bit linux where we have tools and sources
Normally we directly connect to that machine through PuTTY and use VIM to edit sources and gmake to compile and build projects. Now when I created the "New Remote Project with existing sources" and try to use it It took more time to load the project.
So Can anybody tell me how actually this remote compilation works??
Because we have some GBs of sources here on linux box and I want to know is it possible for smooth development with this big data??
Simple steps. Read this tutorial. You just need a SSH-server on your Linux.
The process is easy, your Netbeans connects to the SSH-server and searches for compilation tools then uses them to build your projects.
The second issue is creating a shared folder that your Windows and Linux able to access to it. I suggest you first create a shared folder on your Windows and use Samba client on your Linux.