Skip to content

Design Time Build System

Dean Ellis edited this page Dec 12, 2017 · 1 revision

The Managed system is supposed to replace the normal Resource.Designer.cs process. The current process uses a call to the Android aapt tool. This tool generates an R.java file which is then parsed by our build system to produce the Resource.Designer.cs.

For a design time build this is problematic becuase aapt can take a while to run. So the Managed system has been written to speed things up a bit.

The way it works is the Managed system will parse the Resource directories directly. This includes all the library project directories as well. However what is does not do is generate the actual resource id's. As a result all the id's produced in the designer file will be 0.

The new system can be switched on/off using the AndroidUseManagedDesignTimeResourceGenerator msbuild property. When set to false, the normal aapt based system will be used.

The Managed system relies on the following msbuild properties being set DesignTimeBuild and BuildingInsideVisualStudio. Both of these need to be true in order for the managed system to be used (in addition to AndroidUseManagedDesignTimeResourceGenerator). The DesignTimeBuild should be set by the _SetupDesignTimeBuildForCompile target.

Clone this wiki locally