mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-01 22:21:13 +00:00
meson: Fix generation of nugets.
This commit is contained in:
parent
7976844b56
commit
78b259e358
2 changed files with 40 additions and 19 deletions
26
meson.build
26
meson.build
|
@ -46,7 +46,7 @@ gapi_codegen = gapi_codegen.full_path()
|
||||||
|
|
||||||
gacutil = find_program('gacutil')
|
gacutil = find_program('gacutil')
|
||||||
generate_api = find_program('generate_code.py')
|
generate_api = find_program('generate_code.py')
|
||||||
nuget = join_paths(meson.current_source_dir(), 'nuget.py')
|
nuget = find_program('nuget.py')
|
||||||
|
|
||||||
# TODO Handle monodoc
|
# TODO Handle monodoc
|
||||||
|
|
||||||
|
@ -80,9 +80,26 @@ ges_dep = dependency('gst-editing-services-' + apiversion, version: gst_required
|
||||||
subdir('sources')
|
subdir('sources')
|
||||||
if ges_dep.found()
|
if ges_dep.found()
|
||||||
subdir('ges')
|
subdir('ges')
|
||||||
|
custom_target('GESSharp-nuget',
|
||||||
|
command: [nuget, '--package-name', 'GESSharp',
|
||||||
|
'--assembly', ges_sharp.full_path(),
|
||||||
|
'--assembly', gst_sharp.full_path(),
|
||||||
|
'--assembly', gio_sharp.full_path(),
|
||||||
|
'--assembly', glib_sharp.full_path(),
|
||||||
|
'--dependency=GstSharp:' + meson.project_version(),
|
||||||
|
'--project-url', 'https://gstreamer.freedesktop.org/modules/gstreamer-sharp.html',
|
||||||
|
'--icon-url', 'https://gstreamer.freedesktop.org/images/header-logo-top.png',
|
||||||
|
'--license-url', 'https://cgit.freedesktop.org/gstreamer/gstreamer-sharp/plain/COPYING',
|
||||||
|
'--version', meson.project_version(),
|
||||||
|
'--tags', 'GStreamer GES GstSharp bindings',
|
||||||
|
'--builddir', meson.current_build_dir(),
|
||||||
|
],
|
||||||
|
output: 'GESSharp.' + meson.project_version() + '.nupkg'
|
||||||
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
meson.add_install_script(nuget, '--package-name', 'GstSharp',
|
custom_target('GstSharp-nuget',
|
||||||
|
command: [nuget, '--package-name', 'GstSharp',
|
||||||
'--assembly', gst_sharp.full_path(),
|
'--assembly', gst_sharp.full_path(),
|
||||||
'--assembly', gio_sharp.full_path(),
|
'--assembly', gio_sharp.full_path(),
|
||||||
'--assembly', glib_sharp.full_path(),
|
'--assembly', glib_sharp.full_path(),
|
||||||
|
@ -91,7 +108,10 @@ meson.add_install_script(nuget, '--package-name', 'GstSharp',
|
||||||
'--license-url', 'https://cgit.freedesktop.org/gstreamer/gstreamer-sharp/plain/COPYING',
|
'--license-url', 'https://cgit.freedesktop.org/gstreamer/gstreamer-sharp/plain/COPYING',
|
||||||
'--version', meson.project_version(),
|
'--version', meson.project_version(),
|
||||||
'--tags', 'GStreamer GstSharp bindings',
|
'--tags', 'GStreamer GstSharp bindings',
|
||||||
)
|
'--builddir', meson.current_build_dir(),
|
||||||
|
],
|
||||||
|
output: 'GstSharp.' + meson.project_version() + '.nupkg',
|
||||||
|
)
|
||||||
|
|
||||||
subdir('samples')
|
subdir('samples')
|
||||||
|
|
||||||
|
|
15
nuget.py
15
nuget.py
|
@ -28,10 +28,10 @@ NUSPEC_TEMPLATE ="""<?xml version="1.0" encoding="utf-8"?>
|
||||||
</package>
|
</package>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
TARGETS_TEMPLATE = """<?xml version="1.0" encoding="utf-8"?>
|
TARGETS_TEMPLATE = r"""<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Target Name="CopyMapConfigs" AfterTargets="AfterBuild">
|
<Target Name="{package_name}CopyMapConfigs" AfterTargets="AfterBuild">
|
||||||
<CreateItem Include="$(MSBuildThisFileDirectory)\*.config">
|
<CreateItem Include="$(MSBuildThisFileDirectory)\{frameworkdir}\*.config">
|
||||||
<Output TaskParameter="Include" ItemName="MapConfigs" />
|
<Output TaskParameter="Include" ItemName="MapConfigs" />
|
||||||
</CreateItem>
|
</CreateItem>
|
||||||
|
|
||||||
|
@ -42,7 +42,6 @@ TARGETS_TEMPLATE = """<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
class Nugetifier:
|
class Nugetifier:
|
||||||
def cleanup_args(self):
|
def cleanup_args(self):
|
||||||
self.builddir = os.path.abspath(os.path.curdir)
|
|
||||||
self.nugetdir = os.path.join(self.builddir,
|
self.nugetdir = os.path.join(self.builddir,
|
||||||
self.package_name + 'nupkg')
|
self.package_name + 'nupkg')
|
||||||
self.frameworkdir = 'net45'
|
self.frameworkdir = 'net45'
|
||||||
|
@ -74,7 +73,7 @@ class Nugetifier:
|
||||||
self.files = ''
|
self.files = ''
|
||||||
def add_file(path, target="lib"):
|
def add_file(path, target="lib"):
|
||||||
f = ' <file src="%s" target="%s"/>\n' % (
|
f = ' <file src="%s" target="%s"/>\n' % (
|
||||||
path, os.path.join(target, self.frameworkdir, os.path.basename(path)))
|
path, os.path.join(target, os.path.basename(path)))
|
||||||
self.files += f
|
self.files += f
|
||||||
|
|
||||||
self.dependencies = ''
|
self.dependencies = ''
|
||||||
|
@ -84,11 +83,11 @@ class Nugetifier:
|
||||||
_id, version)
|
_id, version)
|
||||||
|
|
||||||
for assembly in self.assembly:
|
for assembly in self.assembly:
|
||||||
add_file(assembly)
|
add_file(assembly, os.path.join('lib', self.frameworkdir))
|
||||||
|
|
||||||
for f in [assembly + '.config', assembly[:-3] + 'pdb']:
|
for f in [assembly + '.config', assembly[:-3] + 'pdb']:
|
||||||
if os.path.exists(f):
|
if os.path.exists(f):
|
||||||
add_file(f, 'build')
|
add_file(f, os.path.join('build', self.frameworkdir))
|
||||||
|
|
||||||
with open(self.nugettargets, 'w') as _:
|
with open(self.nugettargets, 'w') as _:
|
||||||
print(TARGETS_TEMPLATE.format(**self.__dict__), file=_)
|
print(TARGETS_TEMPLATE.format(**self.__dict__), file=_)
|
||||||
|
@ -103,6 +102,7 @@ class Nugetifier:
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument('--builddir')
|
||||||
parser.add_argument('--package-name')
|
parser.add_argument('--package-name')
|
||||||
parser.add_argument('--author', default=getpass.getuser())
|
parser.add_argument('--author', default=getpass.getuser())
|
||||||
parser.add_argument('--owner', default=getpass.getuser())
|
parser.add_argument('--owner', default=getpass.getuser())
|
||||||
|
@ -116,6 +116,7 @@ if __name__ == "__main__":
|
||||||
parser.add_argument('--project-url', default='')
|
parser.add_argument('--project-url', default='')
|
||||||
parser.add_argument('--license-url', default='')
|
parser.add_argument('--license-url', default='')
|
||||||
parser.add_argument('--tags', default='')
|
parser.add_argument('--tags', default='')
|
||||||
|
parser.add_argument('--dependency', default=[], action='append')
|
||||||
|
|
||||||
nugetifier = Nugetifier()
|
nugetifier = Nugetifier()
|
||||||
options = parser.parse_args(namespace=nugetifier)
|
options = parser.parse_args(namespace=nugetifier)
|
||||||
|
|
Loading…
Reference in a new issue