Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,8 @@ GTK composite templates allow creating a subclass from a `Gtk.Widget` and associ

[!code-csharp[](../../src/Samples/Gtk-4.0/CompositeTemplate/CompositeBoxWidget.cs)]

## How to embed template files in the assemby?
To easily embed template files in the assembly GirCore provides the MSBuild property `GirCoreEmbedTemplateFiles`. Setting it to `true` will automatically embed all files with the extension `.ui` in the assembly with the same name. The folder structure of the template file will not be taken over. Meaning a template file must have a unique name in the assembly.

## How to distribute desktop applications on Linux?
A good option is [Flatpak](https://flatpak.org/) - a framework for distributing desktop applications across various Linux distributions. Refer to the [Dotnet](https://github.com/gircore/gir.core/edit/main/docs/docs/faq.md) page for .Net specific guide.
12 changes: 12 additions & 0 deletions src/Extensions/Gtk-4.0.Integration/Build/Template.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project>
<PropertyGroup>
<GirCoreEmbedTemplateFiles Condition="'$(GirCoreEmbedTemplateFiles)' == ''">false</GirCoreEmbedTemplateFiles>
</PropertyGroup>

<ItemGroup Condition="'$(GirCoreEmbedTemplateFiles)' == 'true'">
<None Remove="**\*.ui" />
<EmbeddedResource Include="**\*.ui">
<LogicalName>%(Filename)%(Extension)</LogicalName>
</EmbeddedResource>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<Import Project="Build/Template.Build.props"/>
</Project>
5 changes: 5 additions & 0 deletions src/Extensions/Gtk-4.0.Integration/Gtk-4.0.Integration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@
<RootNamespace>Gtk.Integration</RootNamespace>
<Description>Source Generator to make it easy to integrate C# with Gtk.</Description>
</PropertyGroup>

<ItemGroup>
<None Update="GirCore.Gtk-4.0.Integration.props" Pack="true" PackagePath="buildTransitive" />
<None Update="Build\Template.Build.props" Pack="true" PackagePath="buildTransitive" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/Samples/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project>
<Import Project="../Extensions/Gtk-4.0.Integration/GirCore.Gtk-4.0.Integration.props" />
<PropertyGroup>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<GirCoreEmbedTemplateFiles>true</GirCoreEmbedTemplateFiles>
</PropertyGroup>

<ItemGroup>
<None Remove="**\*.ui" />
<EmbeddedResource Include="**\*.ui">
<LogicalName>%(Filename)%(Extension)</LogicalName>
</EmbeddedResource>
</ItemGroup>

</Project>
Loading