Skip to content

Commit 09faa1f

Browse files
committed
WIP
1 parent 36b791e commit 09faa1f

File tree

13 files changed

+197
-1
lines changed

13 files changed

+197
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
"compile": "tsc -p ./",
212212
"lint": "eslint src --ext ts",
213213
"watch": "tsc -watch -p ./",
214-
"pretest": "yarn run compile && copyfiles -u 1 src/test/assets/* out/ && yarn run lint --max-warnings=0",
214+
"pretest": "yarn run compile && cp -r src/test/assets out/test/assets && yarn run lint --max-warnings=0",
215215
"test": "node ./out/test/runTest.js",
216216
"deploy-vs": "vsce publish --yarn",
217217
"deploy-ovsx": "ovsx publish --yarn"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env python3
2+
3+
from os import environ, path
4+
from subprocess import call
5+
6+
prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
7+
datadir = path.join(prefix, 'share')
8+
destdir = environ.get('DESTDIR', '')
9+
10+
# Package managers set this so we don't need to run
11+
if not destdir:
12+
print('Updating icon cache...')
13+
call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])
14+
15+
print('Updating desktop database...')
16+
call(['update-desktop-database', '-q', path.join(datadir, 'applications')])
17+
18+
print('Compiling GSettings schemas...')
19+
call(['glib-compile-schemas', path.join(datadir, 'glib-2.0', 'schemas')])
20+
21+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
desktop_file = i18n.merge_file(
2+
input: 'some.meson.Project.desktop.in',
3+
output: 'some.meson.Project.desktop',
4+
type: 'desktop',
5+
po_dir: '../po',
6+
install: true,
7+
install_dir: join_paths(get_option('datadir'), 'applications')
8+
)
9+
10+
desktop_utils = find_program('desktop-file-validate', required: false)
11+
if desktop_utils.found()
12+
test('Validate desktop file', desktop_utils,
13+
args: [desktop_file]
14+
)
15+
endif
16+
17+
appstream_file = i18n.merge_file(
18+
input: 'some.meson.Project.appdata.xml.in',
19+
output: 'some.meson.Project.appdata.xml',
20+
po_dir: '../po',
21+
install: true,
22+
install_dir: join_paths(get_option('datadir'), 'appdata')
23+
)
24+
25+
appstream_util = find_program('appstream-util', required: false)
26+
if appstream_util.found()
27+
test('Validate appstream file', appstream_util,
28+
args: ['validate', appstream_file]
29+
)
30+
endif
31+
32+
install_data('some.meson.Project.gschema.xml',
33+
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')
34+
)
35+
36+
compile_schemas = find_program('glib-compile-schemas', required: false)
37+
if compile_schemas.found()
38+
test('Validate schema file', compile_schemas,
39+
args: ['--strict', '--dry-run', meson.current_source_dir()]
40+
)
41+
endif
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<component type="desktop">
3+
<id>some.meson.Project.desktop</id>
4+
<metadata_license>CC0-1.0</metadata_license>
5+
<project_license>LicenseRef-proprietary</project_license>
6+
<description>
7+
<p>No description</p>
8+
</description>
9+
</component>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Desktop Entry]
2+
Name=meson
3+
Exec=meson
4+
Icon=some.meson.Project
5+
Terminal=false
6+
Type=Application
7+
Categories=GTK;
8+
StartupNotify=true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<schemalist gettext-domain="meson">
3+
<schema id="some.meson.Project" path="/some/meson/Project/">
4+
</schema>
5+
</schemalist>

src/test/assets/meson/meson.build

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
project('meson',
2+
version: '0.1.0',
3+
meson_version: '>= 0.50.0',
4+
default_options: [ 'warning_level=2',
5+
],
6+
)
7+
8+
i18n = import('i18n')
9+
10+
11+
12+
subdir('data')
13+
subdir('src')
14+
15+
meson.add_install_script('build-aux/meson/postinstall.py')
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"app-id" : "some.meson.Project",
3+
"runtime" : "org.gnome.Platform",
4+
"runtime-version" : "41",
5+
"sdk" : "org.gnome.Sdk",
6+
"command" : "meson",
7+
"finish-args" : [
8+
"--share=network",
9+
"--share=ipc",
10+
"--socket=fallback-x11",
11+
"--device=dri",
12+
"--socket=wayland"
13+
],
14+
"cleanup" : [
15+
"/include",
16+
"/lib/pkgconfig",
17+
"/man",
18+
"/share/doc",
19+
"/share/gtk-doc",
20+
"/share/man",
21+
"/share/pkgconfig",
22+
"*.la",
23+
"*.a"
24+
],
25+
"modules" : [
26+
{
27+
"name" : "meson",
28+
"builddir" : true,
29+
"buildsystem" : "meson",
30+
"sources" : [
31+
{
32+
"type" : "git",
33+
"url" : "file:///home/dave/Projects/meson"
34+
}
35+
]
36+
}
37+
]
38+
}

src/test/assets/meson/src/__init__.py

Whitespace-only changes.

src/test/assets/meson/src/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def main(version: str):
2+
print(f"Hi from a meson project {version}")

0 commit comments

Comments
 (0)