V
V
vep2019-09-05 14:41:56
git
vep, 2019-09-05 14:41:56

Building a project from a working copy and from an archive - best practices?

When building a project from a working copy of the repository, the build scripts pull the revision number (and possibly other attributes) and hardcode it into the product - version number, resource strings, etc. Everything works well. However, sometimes it becomes necessary to build a project without a working copy present. Accordingly, there is a difficulty with the fact that the scripts cannot find the data source for the version, etc. Are there any approaches to setting up a build system for building in such conditions. I use git and msbuild.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Makarov, 2019-09-05
@vep

Pass this information through an environment variable? And substitute manually / in other ways when assembling outside the VCS?
I think that the revision number (i.e. the commit hash/tag name, etc.) should not be retrieved by the build script, but passed through the environment. Most CI servers have well-documented environment variables that are set before the build starts. These environment variables can also be set manually.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question