Sharing the same file between different projects

For version control, we are currently using Visual Source Safe and are thinking of porting to another version control system (SVN, Mercurial, Git).

We are currently very well using the "Shared" feature for Visual Source Safe. This allows us to use the code between the design and the battery life of one product, as well as between several products.

For instance:

**Product One**
  - Design
     Login.cpp
     Login.h
     Helper.cpp
     Helper.h
  - Runtime
     Login.cpp
     Login.h
     Helper.cpp
     Helper.h

**Product Two**
  - Design
     Login.cpp
     Login.h
  - Launcher
     Login.cpp
     Login.h
  - Runtime
     Login.cpp
     Login.h

In this example, Login.cpp and Login.h contain the common code needed by all our projects, Helper.cpp and Helper.h are used only in Product One. In Visual Source Safe, they are shared between specific projects, which means that whenever files are updated in one project, they are updated in any project to which they are shared.

, , , , : , .

Visual Source Safe , , , , . (https://www.mercurial-scm.org/wiki/subrepos http://svnbook.red-bean.com/en/1.0/ch07s03.html)

( ) , ?

  • , include? .

    One

    •  Login.cpp  Login.h
    • Runtime  Login.cpp  Login.h
    •  Helper.cpp  Helper.h

, Login.cpp Logon.h

  1. lib dll? , lib , .

  2. ?

  3. (, , ) ?

. , , , , , , .

, , , ...?

, Visual Studio .

.

+3
3

SVN, , , ( SVN , , , , sub ).

, , - , , . Design, SVN ProductOne ProductTwo, Design ProductOne, ProductOne Design .

Visual Studio , . , ProductOne Design. .

+1

(++, Visual Studio, VSS) svn. svn: externals. , . , .

lib. , . , , . . , . .

0

Mercurial!

, , , . Mercurial, lib , , / .

++ ( , P), , , , , , , , , , , .

, !

0
source

Source: https://habr.com/ru/post/1747222/


All Articles