[Android] Anik_khan:
Uses of Local_manifests​

Now we will learn what is Manifest. Its used for syncing source from Github,Bitbucket. Its driven via XML. Basically XML is a markup language. We can modify Rom's default.xml but it can cause of conflicts next time. So never think of editing default.xml

Now you can say how we sync our desired repo without modifying default manifest? There is a option called local manifests. By local manifests we can sync our desired repository. You can add,remove any project from default manifest without modifying default.xml

So now we will learn using local manifests-----

Open terminal and type

cd your source directory name/.repo
e.g: cd cm/.repo

Now create a new directory called local_manifests

Then type

cd local_manifests

Now type

nano localmanifest.xml

Now add whatever you want and save it via "ctrl+X"

Adding or Removing repo

Open localmanifest.xml then

<?xml version="1.0" encoding="UTF-8"?>
<manifest>

<remove-project name="CyanogenMod/android_frameworks_base" />

<project path="frameworks/base" name="Anik1199/android_frameworks_base" remote="github" revision="cm-13.0"/>

This will remove project from CyanogenMod and sync from Anik1199's git.

When adding a new project that replaces an existing project, you should always remove that project before defining the replacement.

You can simply add a new project to the source code, such as when you want to add your own app to the build.

Note that when adding new projects, there are at least three parts defined:

• remote -- the name of the remote. this can be one that was defined in either the default manifest or local_manifest.xml.

• name -- the name of the git project-- for github it has the format account_name/project_name.

• path -- where the git repository should go in your local copy of the source code.

• revision -- (optional) which branch or tag to use in the repository. If this attribute is omitted, repo sync will use the revision specified by the <default ... /> tag in the default manifest.

After creating .repo/local_manifests.xml, you should be able to repo sync and the source code will be updated accordingly

In many Manifest.xml you ll find many stuff not needed by our device. Also there are files needed and that is not present in the default.xml.

Adding Projects to local_manifest.xml

So, to add projects to your local_manifest.xml for your device refer the following format that explains the same.

<?xml version="1.0" encoding="UTF-8"?>
<manifest>

<project path=" directory in work tree" name="name of the repository in remote" remote="name of remote defined earlier" revision="branch of the repository" />

</manifest>

If you have any doubt? See my localmanifest.xml

Device Example Used Here : Android One (Sprout)

<manifest>
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<!--Devices-->
<project path="device/google/sprout4" name="CyanogenMod/android_device_google_sprout4" remote="github" revision="cm-13.0" />
<!--Devices commons-->
<project path="device/google/sprout-common" name="CyanogenMod/android_device_google_sprout-common" remote="github" revision="cm-13.0" />
<!--Kernels-->
<project path="kernel/mediatek/sprout" name="CyanogenMod/android_kernel_mediatek_sprout" remote="github" revision="cm-13.0" />
<!--Vendors-->
<project path="vendor/google" name="TheMuppets/proprietary_vendor_google" remote="github" revision="cm-13.0" />
</manifest>

This will download your device Identity needed for Rom Building :)

Making CM Device Tree Compatible With Your Rom For Compiling​

We learnt how to initialize build environment,learnt some git,how to use local_manifest and learnt how to build CyanogenMod. Now we will learn how to compatiable CyanogenMod device tree for other Rom. We used Android One aka sprout as a reference. Now we will try to build another CyanogenMod based Rom for sprout.

I am using Team-Radium Rom as reference. So we can start......

There are 3 files in CM Tree Which Should Be Modified.

They are,

1) cm.mk

2) cm.dependencies

3) vendorsetup.sh

We have to edit this 3 files for building Team-Radium

1) Rename cm.mk to radium.mk

As You can see That WE HAVE JUST REPLACED CM WITH Radium

Now you all must be thinking why did we rename cm.mk to radium.mk

A Simple Answer is we go to the vendor folder and check the name and replace it.

So now you must be wondering about the product name ...as in the above image only the "cm" changes to "Radium" with the same logic of the vendor name

In this case we see that Radium is the vendor ...so we rename the cm.mk to radium.mk

this same rule applies to the content inside the radium.mk too ... we first make sure that the files are available in that location .

2) Now we have to move second file "cm.dependencies"

This file will be simply renamed by Vendor Name ...

In This Case "Radium" ....so we rename it to "radium.dependencies"

3) The Last And The Final Change Required Is In The "vendorsetup.sh"

Open vendorsetup.sh and rename cm as radium and save.

Thats it!! So simple i think :P

Happy building :)

Good luck!!! :good: