Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 1.83 KB

README.md

File metadata and controls

51 lines (33 loc) · 1.83 KB

XamlPreprocessor

What?

A command line utility + MSBuild Task to enable conditional compilation like directives in XAML files. Compatible Visual Studio 2010+ and Xamarin Studio.

Why?

  • To mutualise UI code between Windows Phone, Windows 8 and 10 apps
  • To make different versions of an application with the ease of conditional compilation directives
  • Incidentally any other light XML transformations

Illustration

The emulator (right) features two removed lines in the first section, and color attributes manipulations (injection, replacement and conditional injection) based on build symbols. alt text

How?

English

Using a special syntax for comment you can conditionally remove node, add or remove attribute, or remove directives. Boolean expression let you specify complex condition.

Detailed syntax explanation.

French

À lire absolument, car cela fait office de documentation :

IRL

Used since May 2013 to build multiple versions of my Windows Phone Japanese-French Dictionary.

Usage

The project build an executable which can be used either:

  • in command line
  • as a MSBuild Task
The command line syntax is:
XamlPreprocessor.exe <SYMBOL_LIST> <input_file.xml> <output_file.xml>
SYMBOL_LIST is a list of comma separated symbols (eg. DEBUG;WINDOWS_PHONE)

For the MSBuild integration, see the sub projects IntegrationDemoApp.