3

I have a project that has an non-modifiable folder structure that looks like this

<project folder>
  |_SDK layer 1
  |_SDK layer 2
  |_SDK layer 3
  |_Application Projects Folder
    |_Application Project Source Files
    |_Application Project Autogenerated Files (not to be committed)

I want to have the SDK folders (collectively as one unit) be a dependency of the application project source files folder when I build each project. This way, I make a modification to the SDK, I can associate it with a feature/change in my application source.

Am I describing Git submodules? Or is there another way this should be done?

If I should be using Git submodules, I'm guessing the SDK will be a submodule of my application source project. In that case: 1. How is this possible since the submodule is not a remote, but rather a folder on my machine? I have Googled for this answer but haven't turned up what I'm looking for. 2. How can this be added as a submodule since it is in a parent directory of my application files?

Thanks in advance, I'm sure there is a simple solution to this!

Reece Lamb
  • 31
  • 1
  • 3

1 Answers1

1

Git submodules are about nesting other Git repositories inside the current repository. You are talking about local folders: unless these are not repositories themselves, you will not be able to use submodules in the first place.

Regarding your second question, submodules only work for paths within the repository. So if your Application Projects Folder is your current repository root, there is no way to recreate this structure.

What you would need instead (I saw your mention of non-modifiable, just for demonstration) is a Git repository on the level of <project root> in which you can include submodules for the SDKs.

-SDK layer 1 (Git-Repo SDK1)
-SDK layer 2 (Git-Repo SDK2)
-SDK layer 3 (Git-Repo SDK3) 
-<project folder> (Git-Repo Application)
   |_SDK layer 1 (Git submodule referencing SDK1)
   |_SDK layer 2 (Git submodule referencing SDK2)
   |_SDK layer 3 (Git submodule referencing SDK3)
   |_Application Projects Folder
     |_Application Project Source Files
     |_Application Project Autogenerated Files (not to be committed)
ChrisR
  • 53
  • 5