Which files to commit to code repository to save build information (VS Code and git)

I'm trying to commit a VS Code project to source control and don't want to include the entire build directory (with all of the build-generated files).   But it seems that all of the information about the build configuration is stored in the build directory.  Is there a definitive list of files necessary (to save in a repository) to allow a successful build when cloning the project?

Thanks!

Parents
  • Hi,

    You should not commit anythign within the build folder. It is generated for every clean build. The build configuration is normally not checked in, and typically only involves a few parameters (often only the board). That could be communicated via a README file or similar. I suggest having a look at Creating an application.

    You can refer to the example applications in the SDK for a reference of files that are needed (minimum is a CMakeLists.txt file and prj.conf, and one or more source files, typically a main.c).

  • I already have a project that builds (and was migrated from the older Segger environment).

    I also know that I shouldn't commit anything from the build folder.   My point was that if the build folder is removed (or not there because it wasn't cloned from a repository), some of the information needed to create the build is lost.    I want to be able to have someone else clone my repository and do a simple build without having to configure anything.

    [For example: My code is for a controller in a much larger, complex system.   Those who are testing, debugging, or calibrating the other parts of the system simply want to be able to get the most recent (or appropriate version), build it and get on with their part of the system without having to deal too much with the IDE.]

    The old system (Segger) had the projectName.emProject file that contained configurations (plus lots of other information) that allowed, for example, a "Debug" configuration and a "Release" configuration (or any other configuration that was needed).

    How can this be done in the VS Code environment?

Reply
  • I already have a project that builds (and was migrated from the older Segger environment).

    I also know that I shouldn't commit anything from the build folder.   My point was that if the build folder is removed (or not there because it wasn't cloned from a repository), some of the information needed to create the build is lost.    I want to be able to have someone else clone my repository and do a simple build without having to configure anything.

    [For example: My code is for a controller in a much larger, complex system.   Those who are testing, debugging, or calibrating the other parts of the system simply want to be able to get the most recent (or appropriate version), build it and get on with their part of the system without having to deal too much with the IDE.]

    The old system (Segger) had the projectName.emProject file that contained configurations (plus lots of other information) that allowed, for example, a "Debug" configuration and a "Release" configuration (or any other configuration that was needed).

    How can this be done in the VS Code environment?

Children
Related