Skip to content

Commit

Permalink
Merge pull request #141 from unoplatform/dev/jela/doc-update
Browse files Browse the repository at this point in the history
docs: Adjust for CPM
  • Loading branch information
jeromelaban authored Nov 21, 2024
2 parents 1aeb616 + 7699d41 commit 03989f2
Showing 1 changed file with 33 additions and 10 deletions.
43 changes: 33 additions & 10 deletions doc/using-xamlmerge.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,37 @@ To limit the impact of the traversal, this task takes all resource dictionaries

## Using the task

1. In your `csproj` file, include the following block:

```xml
<PropertyGroup>
<_Uno_XamlMerge_Task_Version>1.0.0</_Uno_XamlMerge_Task_Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Uno.XamlMerge.Task" Version="$(_Uno_XamlMerge_Task_Version)" />
</ItemGroup>
```
1. Add a package reference:

* If your project does not use [Central Package Management](https://learn.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management#enabling-central-package-management), in your `csproj` file, include the following block:

```xml
<PropertyGroup>
<_Uno_XamlMerge_Task_Version>1.0.0</_Uno_XamlMerge_Task_Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Uno.XamlMerge.Task" Version="$(_Uno_XamlMerge_Task_Version)" />
</ItemGroup>
```

* If your project is using [Central Package Management](https://learn.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management#enabling-central-package-management), add the following to your `Directory.Packages.props`:

```xml
<PropertyGroup>
<_Uno_XamlMerge_Task_Version>1.0.0</_Uno_XamlMerge_Task_Version>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Uno.XamlMerge.Task" Version="$(_Uno_XamlMerge_Task_Version)" />
</ItemGroup>
```

Then the following to your `.csproj`:

```xml
<ItemGroup>
<PackageVersion Include="Uno.XamlMerge.Task" Version="$(_Uno_XamlMerge_Task_Version)" />
</ItemGroup>
```

1. Specify the resource dictionaries to be merged:

Expand Down Expand Up @@ -63,6 +84,8 @@ To limit the impact of the traversal, this task takes all resource dictionaries
</ResourceDictionary>
```

Then replace `REPLACE_ME/` with either the library name if you're adding the package to a class library, or with nothing if you're adding it to your main project (e.g. `ms-appx:///Generated/mergedpages.xaml`).

## Multiple generated files

There are scenarios where placing groups of XAML files in separate merged files are useful, particularly, when IL Linking must be used.
Expand Down

0 comments on commit 03989f2

Please sign in to comment.