Skip to content
Open
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
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ jobs:
run: meson compile -C builddir
- name: Install
run: meson install -C builddir
- name: Dist
if: matrix.config.os == 'ubuntu-latest'
run: meson dist -C builddir
- name: Build dotnet
run: dotnet build Source/gtk-sharp.sln /p:Platform="Any CPU"
- name: Test
run: dotnet test Source/gtk-sharp.sln /p:Platform="Any CPU"
- name: Pack
run: dotnet pack Source/gtk-sharp.sln /p:Platform="Any CPU"
3 changes: 2 additions & 1 deletion Source/atk/atk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<PackageId>GLibSharp.AtkSharp</PackageId>
</PropertyGroup>
<ItemGroup>
<None Update="atk-sharp.dll.config">
Expand All @@ -14,4 +14,5 @@
<ProjectReference Include="..\glib\glib.csproj" />
</ItemGroup>
<Import Project="..\common.targets" />
<Import Condition="Exists('..\..\builddir\Source\version.props')" Project="..\..\builddir\Source\version.props" />
</Project>
8 changes: 6 additions & 2 deletions Source/atk/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pkg = 'atk'

assembly_name = pkg + '-sharp'
nupkg_name = 'GLibSharp.AtkSharp.' + version + '.nupkg'
csproj_name = pkg + '.csproj'
raw_api_fname = join_paths(meson.current_source_dir(), pkg + '-api.raw')
metadata_fname = join_paths(meson.current_source_dir(), 'Atk.metadata')

Expand Down Expand Up @@ -28,7 +29,6 @@ atk_sharp = shared_library(assembly_name, source_gen, sources, assemblyinfo,
install_dir: lib_install_dir
)

nuget_infos += [['AtkSharp', atk_sharp, ['GlibSharp', 'GioSharp']]]
install_infos += [assembly_name, atk_sharp.full_path()]
atk_sharp_dep = declare_dependency(link_with: [glib_sharp, atk_sharp])

Expand All @@ -47,3 +47,7 @@ if add_languages('c', required: false) and csc.get_id() == 'mono'
else
message('Not running tests ' + csc.get_id())
endif

custom_target(assembly_name + '-nugget',
command: dotnet_pack + [join_paths(meson.current_source_dir(), csproj_name)],
output: nupkg_name)
3 changes: 2 additions & 1 deletion Source/cairo/cairo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<PackageId>GLibSharp.CairoSharp</PackageId>
</PropertyGroup>
<ItemGroup>
<None Update="cairo-sharp.dll.config">
Expand All @@ -14,4 +14,5 @@
<ProjectReference Include="..\glib\glib.csproj" />
</ItemGroup>
<Import Project="..\common.targets" />
<Import Condition="Exists('..\..\builddir\Source\version.props')" Project="..\..\builddir\Source\version.props" />
</Project>
11 changes: 8 additions & 3 deletions Source/cairo/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
assembly_name = 'cairo-sharp'

pkg = 'cairo'
assembly_name = pkg + '-sharp'
nupkg_name = 'GLibSharp.CairoSharp.' + version + '.nupkg'
csproj_name = pkg + '.csproj'
raw_api_fname = join_paths(meson.current_source_dir(), 'cairo-api.raw')
metadata_fname = join_paths(meson.current_source_dir(), 'cairo.metadata')

Expand Down Expand Up @@ -69,7 +71,6 @@ cairo_sharp = shared_library(assembly_name, sources, assemblyinfo,
install_dir: lib_install_dir
)

nuget_infos += [['CairoSharp', cairo_sharp, []]]
install_infos += [assembly_name, cairo_sharp.full_path()]
cairo_api_includes = join_paths(meson.current_source_dir(), 'cairo-api.xml')

Expand All @@ -78,3 +79,7 @@ if install
endif

cairo_sharp_dep = declare_dependency(link_with: cairo_sharp)

custom_target(assembly_name + '-nugget',
command: dotnet_pack + [join_paths(meson.current_source_dir(), csproj_name)],
output: nupkg_name)
17 changes: 16 additions & 1 deletion Source/common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,20 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
<Authors>GLibSharp</Authors>
<PackageProjectUrl>https://github.com/GLibSharp/GtkSharp</PackageProjectUrl>
<RepositoryUrl>https://github.com/GLibSharp/GtkSharp</RepositoryUrl>
<IconUrl>https://upload.wikimedia.org/wikipedia/en/5/5f/Gtk_Sharp_Logo.png</IconUrl>
<PackageTags>gtk bindings</PackageTags>
<RequireLicenseAcceptance>false</RequireLicenseAcceptance>
<SignAssembly>true</SignAssembly>
<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>..\gtk-sharp.snk</AssemblyOriginatorKeyFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
<None Include="..\..\LICENSE" Pack="true" PackagePath=""/>
<None Include="..\..\README.md" Pack="true" PackagePath=""/>
</ItemGroup>
</Project>
3 changes: 2 additions & 1 deletion Source/gdk/gdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<PackageId>GLibSharp.GdkSharp</PackageId>
</PropertyGroup>
<ItemGroup>
<None Update="gdk-sharp.dll.config">
Expand All @@ -17,4 +17,5 @@
<ProjectReference Include="..\cairo\cairo.csproj" />
</ItemGroup>
<Import Project="..\common.targets" />
<Import Condition="Exists('..\..\builddir\Source\version.props')" Project="..\..\builddir\Source\version.props" />
</Project>
6 changes: 5 additions & 1 deletion Source/gdk/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
pkg = 'gdk'
assembly_name = pkg + '-sharp'
nupkg_name = 'GLibSharp.GdkSharp.' + version + '.nupkg'
csproj_name = pkg + '.csproj'
symbols = join_paths(meson.current_source_dir(), 'gdk-symbols.xml')

raw_api_fname = join_paths(meson.current_source_dir(), 'gdk-api.raw')
Expand Down Expand Up @@ -70,7 +72,9 @@ gdk_sharp = shared_library(assembly_name, source_gen, sources, assemblyinfo,
install_dir: lib_install_dir
)

nuget_infos += [['GdkSharp', gdk_sharp, ['GlibSharp', 'GioSharp', 'AtkSharp']]]
install_infos += [assembly_name, gdk_sharp.full_path()]
gdk_sharp_dep = declare_dependency(link_with: deps + [gdk_sharp])

custom_target(assembly_name + '-nugget',
command: dotnet_pack + [join_paths(meson.current_source_dir(), csproj_name)],
output: nupkg_name)
1 change: 1 addition & 0 deletions Source/generator/generator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
<EmbeddedResource Include="DESIGN" />
</ItemGroup>
<Import Project="..\common.targets" />
<Import Condition="Exists('..\..\builddir\Source\version.props')" Project="..\..\builddir\Source\version.props" />
</Project>
3 changes: 2 additions & 1 deletion Source/gio/gio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<PackageId>GLibSharp.GioSharp</PackageId>
</PropertyGroup>
<ItemGroup>
<None Update="glib-sharp.dll.config">
Expand All @@ -14,4 +14,5 @@
<ProjectReference Include="..\glib\glib.csproj" />
</ItemGroup>
<Import Project="..\common.targets" />
<Import Condition="Exists('..\..\builddir\Source\version.props')" Project="..\..\builddir\Source\version.props" />
</Project>
8 changes: 6 additions & 2 deletions Source/gio/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pkg = 'gio'
assembly_name = pkg + '-sharp'

nupkg_name = 'GLibSharp.GioSharp.' + version + '.nupkg'
csproj_name = pkg + '.csproj'
raw_api_fname = join_paths(meson.current_source_dir(), pkg + '-api.raw')
metadata_fname = join_paths(meson.current_source_dir(), 'Gio.metadata')

Expand Down Expand Up @@ -35,6 +36,9 @@ gio_sharp = shared_library(assembly_name, source_gen, sources, assemblyinfo,
install_dir: lib_install_dir
)

nuget_infos += [['GioSharp', gio_sharp, ['GlibSharp']]]
install_infos += [assembly_name, gio_sharp.full_path()]
gio_sharp_dep = declare_dependency(link_with: [glib_sharp, gio_sharp])

custom_target(assembly_name + '-nugget',
command: dotnet_pack + [join_paths(meson.current_source_dir(), csproj_name)],
output: nupkg_name)
3 changes: 2 additions & 1 deletion Source/glib/glib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<PackageId>GLibSharp.GLibSharp</PackageId>
</PropertyGroup>
<ItemGroup>
<None Update="glib-sharp.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="..\common.targets" />
<Import Condition="Exists('..\..\builddir\Source\version.props')" Project="..\..\builddir\Source\version.props" />
</Project>
10 changes: 8 additions & 2 deletions Source/glib/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
assembly_name = 'glib-sharp'
pkg = 'glib'
assembly_name = pkg + '-sharp'
nupkg_name = 'GLibSharp.GLibSharp.' + version + '.nupkg'
csproj_name = pkg + '.csproj'

configure_file(input: 'glib-sharp.dll.config.in',
output: 'glib-sharp.dll.config',
Expand Down Expand Up @@ -101,7 +104,6 @@ glib_sharp = shared_library(assembly_name, sources, assemblyinfo,
install_dir: lib_install_dir
)

nuget_infos += [['GlibSharp', glib_sharp, []]]
install_infos += [assembly_name, glib_sharp.full_path()]

glib_api_includes = join_paths(meson.current_source_dir(), 'glib-api.xml')
Expand All @@ -111,3 +113,7 @@ if install
endif

glib_sharp_dep = declare_dependency(link_with: glib_sharp)

custom_target(assembly_name + '-nugget',
command: dotnet_pack + [join_paths(meson.current_source_dir(), csproj_name)],
output: nupkg_name)
3 changes: 2 additions & 1 deletion Source/gtk/gtk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<PackageId>GLibSharp.GtkSharp</PackageId>
</PropertyGroup>
<ItemGroup>
<None Update="gdk-sharp.dll.config">
Expand All @@ -19,4 +19,5 @@
<ProjectReference Include="..\gdk\gdk.csproj" />
</ItemGroup>
<Import Project="..\common.targets" />
<Import Condition="Exists('..\..\builddir\Source\version.props')" Project="..\..\builddir\Source\version.props" />
</Project>
8 changes: 6 additions & 2 deletions Source/gtk/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
pkg = 'gtk'
assembly_name = pkg + '-sharp'
nupkg_name = 'GLibSharp.GtkSharp.' + version + '.nupkg'
csproj_name = pkg + '.csproj'
symbols = join_paths(meson.current_source_dir(), pkg + '-symbols.xml')

raw_api_fname = join_paths(meson.current_source_dir(), pkg + '-api.raw')
Expand Down Expand Up @@ -139,8 +141,6 @@ gtk_sharp = shared_library(assembly_name, source_gen, sources, assemblyinfo,
install_dir: lib_install_dir
)

nuget_infos += [['GtkSharp', gtk_sharp, ['GlibSharp', 'GioSharp',
'AtkSharp', 'GdkSharp']]]
install_infos += [assembly_name, gtk_sharp.full_path()]
gtk_sharp_dep = declare_dependency(link_with: deps + [gtk_sharp])

Expand All @@ -160,3 +160,7 @@ if add_languages('c', required: false) and csc.get_id() == 'mono'
else
message('Not running tests ' + csc.get_id())
endif

custom_target(assembly_name + '-nugget',
command: dotnet_pack + [join_paths(meson.current_source_dir(), csproj_name)],
output: nupkg_name)
30 changes: 6 additions & 24 deletions Source/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ assembly_data = configuration_data()
assembly_data.set('API_VERSION', apiversion)
assemblyinfo = configure_file(input: 'AssemblyInfo.cs.in', output: 'AssemblyInfo.cs', configuration : assembly_data)

version_props_data = configuration_data()
version_props_data.set('API_VERSION', version)
version_props_targets = configure_file(input: 'version.props.in', output: 'version.props', configuration : version_props_data)

policy_config = files('policy.config.in')
if host_machine.system() == 'darwin'
lib_prefix=''
Expand All @@ -82,7 +86,6 @@ version_data.set('VERSION', version)
version_data.set('PACKAGE_VERSION', pkg_version)

install_infos = []
nuget_infos = []
lib_install_dir = join_paths(get_option('libdir'), 'mono', pkg_version)
pkg_install_dir = join_paths(get_option('libdir'), 'pkgconfig')
gapi_xml_installdir = join_paths(get_option('datadir'), 'gapi-3.0')
Expand Down Expand Up @@ -110,6 +113,8 @@ elif dep_type == 'pkgconfig'
gio_girdir = join_paths(gio_dep.get_variable(pkgconfig: 'datadir'), 'gir-1.0')
endif

dotnet_pack = ['dotnet', 'pack', '--configuration', 'Release']

subdir('parser')
subdir('generator')
subdir('bindinator')
Expand Down Expand Up @@ -163,29 +168,6 @@ else
message('Gtk not found, not building')
endif

nuget = find_program('nuget.py')
license_path = 'https://github.com/gtk-sharp'
project_uri = 'https://github.com/gtk-sharp'
icon_uri = 'https://upload.wikimedia.org/wikipedia/en/5/5f/Gtk_Sharp_Logo.png'
license_uri = 'https://github.com/gtk-sharp/gtk-sharp/blob/master/COPYING'

deps = []
foreach nugetinfo: nuget_infos
# FIXME - Pass proper '--owner' and '--author'
cmd = [nuget, '--package-name', nugetinfo[0], '--assembly', nugetinfo[1].full_path(),
'--project-url', project_uri, '--icon-url', icon_uri, '--license-url',
license_uri, '--version', version, '--tags', 'gtk bindings',
'--builddir', meson.current_build_dir()]

foreach dep: nugetinfo[2]
cmd += ['--dependency=' + dep + pathsep + version]
endforeach

deps += [custom_target(nugetinfo[0] + '-nugget', command: cmd,
depends: [nugetinfo[1]] + deps,
output: nugetinfo[0] + '.' + version + '.nupkg')]
endforeach

if install
gacutil_install = join_paths(meson.current_source_dir(), 'gacutil_install.py')
meson.add_install_script(gacutil_install, install_infos)
Expand Down
Loading