Guides

How to create a dependencies?



How to create a dependencies?
 In this guide I will explain a bit about dependencies, I am no professional but I intend to do this to help you.

What is dependencies? 

The name already says, it's your dependencies to build your rom, ie what your device depends on to be compiled to rom.

What is it for?
When your dependencies are mounted, it helps you with your build, so you do not need that whole job of having to do the "git clone" command at all.

How should I set up my dependencies?

Normally they use the name prefix of the rom for their dependencies, we will see as an example the LineageOS that puts the name lineage.dependencies.The same can be done in others, eg: aokp(lineage, cm, dnd, crdroid, and some aosp).dependencies.Your ".dependencies" file must be mounted in a specific way:Let's say you need the following repositories for your device to compile:
 https://github.com/LineageOS/android_device_qcom_common 
https://github.com/LineageOS/android_device_vendor 
https://github.com/LineageOS/android_device_common
https://github.com/LineageOS/android_kernel_msmxxxx

 
You would need to do this manually in each of the repositories: 

git clone https://github.com/LineageOS/android_device_qcom_common -b branch device/qcom/common
 With dependencies already set up for you and this would no longer be necessary, you would only need to "git clone" in your device tree.

To mount your dependencies must contain: 

remote = place of onte will be cloned 
repository = remote access address
target_path = where it will be cloned 
branch = branch that should be cloned
You should start your file with "[" to signal opening of dependencies and end with "]" to signal closing of your dependencies.For each repository you need to start with "{" to signal repository opening and end with "}" to signal closing of your repository.Remember that you always need each repository to close with a "," except the branch (or last tag of each repository). 

Also, in most cases your dependencies need more than one repository there, so each time you finish a repository it should end with "}," - only the last repository need not put a comma (,).
For ease of understanding I will put an example with only one repository:

 [
 
{
  
"Remote": "github",
  
"Repository": "LineageOS / android_device_qcom_common",
  
"Target_path": "device / qcom / common",
  
"Branch": "cm-14.1"
 
}
 
] 
 Note: I noticed that I put a "," at the end of each tag except the branch because it is the last, and I also did not put "," at the closing of the repository "}" because it has no other then.

Now see an example with more than one repository:

 [
 
{
  
"Remote": "github",
  
"Repository": "LineageOS / android_device_qcom_common",
  
"Target_path": "device / qcom / common",
  
"Branch": "cm-14.1"
 
},
 
{
  
"Remote": "github",
  
"Repository": "LineageOS / android_device_samsung_qcom-common",
  
"Target_path": "device / samsung / qcom-common",
  
"Branch": "cm-14.1"
 
}
 
]
 Note: note that there is a "," at the end of each tag except the last branch, but at the closing of the first repository I put a "," because soon after I started another repository, but at the closing of the last repository it was not Placed a ",".The same concept is applied to more repositories.

I hope this can help you set up your own dependencies.