-
Notifications
You must be signed in to change notification settings - Fork 7
Improve app structure #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # EditorConfig <https://EditorConfig.org> | ||
| root = true | ||
|
|
||
| # elementary defaults | ||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| indent_size = tab | ||
| indent_style = space | ||
| insert_final_newline = true | ||
| max_line_length = 80 | ||
| tab_width = 4 | ||
|
|
||
| # Markup files | ||
| [{*.html,*.xml,*.xml.in,*.yml}] | ||
| tab_width = 2 | ||
| tab_width = 2 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,6 @@ | ||
| [Contractor Entry] | ||
| Name=Resize images | ||
| Name[lt]=Keisti paveikslų dydį | ||
| Name[pl]=Zmień rozmiar obrazu | ||
| Description=Resize images | ||
| Description[lt]=Keisti paveikslų dydį | ||
| Description[pl]=Zmień rozmiar obrazu | ||
| MimeType=image | ||
| Icon=com.github.peteruithoven.resizer | ||
| Exec=com.github.peteruithoven.resizer %F |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| <schemalist> | ||
| <schema id="com.github.peteruithoven.resizer" path="/com/github/peteruithoven/resizer/" gettext-domain="com.github.peteruithoven.resizer"> | ||
| <key name="width" type="i"> | ||
| <range min="1" max="10000"/> | ||
| <default>1000</default> | ||
| </key> | ||
| <key name="height" type="i"> | ||
| <range min="1" max="10000"/> | ||
| <default>1000</default> | ||
| </key> | ||
| </schema> | ||
| <schema id="com.github.peteruithoven.resizer" path="/com/github/peteruithoven/resizer/" gettext-domain="com.github.peteruithoven.resizer"> | ||
| <key name="width" type="i"> | ||
| <range min="1" max="10000" /> | ||
| <default>1000</default> | ||
| </key> | ||
| <key name="height" type="i"> | ||
| <range min="1" max="10000" /> | ||
| <default>1000</default> | ||
| </key> | ||
| </schema> | ||
| </schemalist> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,40 @@ | ||
| # Install icons | ||
| icon_sizes = ['16', '24', '32', '48', '64', '128'] | ||
|
|
||
| foreach i : icon_sizes | ||
| install_data ( | ||
| join_paths('icons', i + '.svg'), | ||
| install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps'), | ||
| rename : meson.project_name() + '.svg' | ||
| join_paths ('icons', i + '.svg'), | ||
| install_dir: join_paths (get_option ('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps'), | ||
| rename : meson.project_name () + '.svg' | ||
| ) | ||
| install_data ( | ||
| join_paths ('icons', i + '.svg'), | ||
| install_dir: join_paths (get_option ('datadir'), 'icons', 'hicolor', i + 'x' + i + '@2', 'apps'), | ||
| rename : meson.project_name () + '.svg' | ||
| ) | ||
| endforeach | ||
|
|
||
| i18n.merge_file( | ||
| input: meson.project_name() + '.desktop.in', | ||
| output: meson.project_name() + '.desktop', | ||
| po_dir: join_paths(meson.source_root(), 'po', 'extra'), | ||
| # Translate and install our .desktop file so the Applications Menu will see it | ||
| i18n.merge_file ( | ||
| input: meson.project_name () + '.desktop.in', | ||
| output: meson.project_name () + '.desktop', | ||
| po_dir: join_paths (meson.source_root (), 'po', 'extra'), | ||
| type: 'desktop', | ||
| install: true, | ||
| install_dir: join_paths(get_option('datadir'), 'applications') | ||
| install_dir: join_paths (get_option ('datadir'), 'applications') | ||
| ) | ||
|
|
||
| i18n.merge_file( | ||
| input: meson.project_name() + '.appdata.xml.in', | ||
| output: meson.project_name() + '.appdata.xml', | ||
| po_dir: join_paths(meson.source_root(), 'po', 'extra'), | ||
| # Translate and install our .appdata.xml file so AppCenter will see it | ||
| i18n.merge_file ( | ||
| input: meson.project_name () + '.appdata.xml.in', | ||
| output: meson.project_name () + '.appdata.xml', | ||
| po_dir: join_paths (meson.source_root (), 'po', 'extra'), | ||
| install: true, | ||
| install_dir: join_paths(get_option('datadir'), 'metainfo') | ||
| ) | ||
|
|
||
| install_data( | ||
| meson.project_name() + '.gschema.xml', | ||
| install_dir: join_paths(get_option('datadir'), 'glib-2.0', 'schemas') | ||
| install_dir: join_paths (get_option ('datadir'), 'metainfo') | ||
| ) | ||
|
|
||
| install_data( | ||
| meson.project_name() + '.contract', | ||
| install_dir: join_paths(get_option('datadir'), 'contractor') | ||
| # Install gschema | ||
| install_data ( | ||
| meson.project_name () + '.gschema.xml', | ||
| install_dir: join_paths (get_option ('datadir'), 'glib-2.0', 'schemas') | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,46 +1,49 @@ | ||
| project( | ||
| # Project name, programming language and version | ||
| project ( | ||
| 'com.github.peteruithoven.resizer', | ||
| ['vala', 'c'], | ||
| meson_version : '>= 0.47', | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not define the min. required meson? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It definitely should be defined! Meson can refuse to run on older versions, while printing an informative error message telling you that your version of Meson is too old. Additionally, it also prints informative warnings when you use features too new for the minimum required version to handle.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can add it back but even elementary apps does not include this. I assume developers should check that their development tools are up to date before trying to build the app. But I can add it back if you prefer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why make life harder, when you could make life easier instead? :) |
||
| license: 'GPL-3.0+' | ||
| 'c', 'vala', | ||
| version: '1.0.1' | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to limit the amount of places where the version is defined, to ideally nowhere but the tag. Is this really useful?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really know but elementary does in their app as well as many other developers so. |
||
| ) | ||
|
|
||
| i18n = import('i18n') | ||
| # Translation module | ||
| i18n = import ('i18n') | ||
|
|
||
| add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()), language:'c') | ||
| # Project arguments | ||
| add_project_arguments ( | ||
| '-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name ()), | ||
| language: 'c' | ||
| ) | ||
|
|
||
| # Config file | ||
| conf_data = configuration_data () | ||
|
|
||
| conf_data.set_quoted ('PROJECT_NAME', meson.project_name ()) | ||
|
|
||
| # Create config.vala from config.vala.in, | ||
| # replacing variables like PROJECT_NAME | ||
| conf_data = configuration_data() | ||
| conf_data.set_quoted('PROJECT_NAME', meson.project_name()) | ||
| config_file = configure_file( | ||
| input : 'src/config.vala.in', | ||
| output : 'config.vala', | ||
| config_file = configure_file ( | ||
| input : 'src/Config.vala.in', | ||
| output : 'Config.vala', | ||
| configuration : conf_data | ||
| ) | ||
|
|
||
| meson.build_root() | ||
|
|
||
| executable( | ||
| meson.project_name(), | ||
| 'src/Application.vala', | ||
| 'src/HeaderBar.vala', | ||
| 'src/Window.vala', | ||
| 'src/ResizePage.vala', | ||
| 'src/ResizingPage.vala', | ||
| 'src/Resizer.vala', | ||
| 'src/DropArea.vala', | ||
| 'src/MessageCenter.vala', | ||
| # Listing dependencies | ||
| dependencies = [ | ||
| dependency ('gtk+-3.0'), | ||
| dependency ('granite'), | ||
| dependency ('libhandy-1') | ||
| ] | ||
|
|
||
| subdir ('src') | ||
|
|
||
| # Defining executable | ||
| executable ( | ||
| meson.project_name (), | ||
| sources, | ||
| config_file, | ||
| dependencies: [ | ||
| dependency('gtk+-3.0'), | ||
| dependency('granite'), | ||
| dependency('libhandy-1', version: '>=1.0.0') | ||
| ], | ||
| install : true | ||
| dependencies: dependencies, | ||
| install: true | ||
| ) | ||
|
|
||
| meson.add_install_script('meson/post_install.py') | ||
|
|
||
| subdir('data') | ||
| subdir('po') | ||
|
|
||
| meson.add_install_script('meson/post_install.py') | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the contract install logic but keep the contract file?
I know the contract file will no longer work: elementary/contractor#34. Maybe we should just remove all the contract logic in a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I'll add it back so it can be removed in another PR