update build

This commit is contained in:
a-Sansara 2018-08-28 23:59:35 +02:00
parent 6499b5c9d0
commit 85c70bca5e
7 changed files with 64 additions and 44 deletions

View File

@ -26,7 +26,7 @@
- meson :
file :
- meson.build
startline : 1
- src/meson.build
sepline :
motif : "# "
repeat : 40
@ -39,10 +39,6 @@
- src
extension :
- .vala
file :
- install.vala.in
- main.vala
startline : 1
sepline :
motif : " *"
repeat : 40

View File

@ -27,47 +27,35 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #^#
project('berel', 'vala', 'c', version:'0.21')
project('berel', ['vala', 'c'], version:'0.21')
cc = meson.get_compiler('c')
dep_glib = dependency('glib-2.0')
dep_gobject = dependency('gobject-2.0')
dep_gmodule = dependency('gmodule-2.0')
dep_gio = dependency('gio-2.0')
dep_gee = dependency('gee-0.8')
dep_echo = dependency('pluie-echo-0.2')
dep_yaml = dependency('pluie-yaml-0.5')
dep_m = cc.find_library('m', required : false)
# dep_yaml = cc.find_library('yaml', required : true)
version = meson.project_version()
bindir = join_paths(get_option('prefix'), get_option('bindir'))
datadir = join_paths(get_option('prefix'), get_option('datadir'), 'pluie/berel')
libdir = join_paths(get_option('prefix'), get_option('libdir'), 'pkgconfig')
incdir = join_paths(get_option('prefix'), get_option('includedir'), 'pluie')
conf = configuration_data()
conf.set('VERSION' , version)
conf.set('INSTALL_PATH', bindir)
conf.set('DATA_PATH' , datadir)
conf = configuration_data()
conf.set('VERSION' , meson.project_version())
conf.set('INSTALL_PATH', join_paths(get_option('prefix'), get_option('bindir')))
conf.set('DATA_PATH' , join_paths(get_option('prefix'), get_option('datadir'), 'pluie/berel'))
configure_file(
input: 'install.vala.in',
input : 'src/install.vala',
output: 'install.vala',
configuration: conf
)
sources = [
'build/install.vala',
'src/Pluie/Berel.App.vala',
'src/Pluie/Berel.Comment.vala',
'src/Pluie/Berel.HeaderDef.vala',
'src/Pluie/Berel.Key.vala',
'src/Pluie/Berel.Meta.vala',
'src/Pluie/Berel.Sepline.vala',
'main.vala',
]
subdir('src')
executable('berel', sources, install : true, dependencies : [dep_glib, dep_gobject, dep_gmodule, dep_gio, dep_gee, dep_echo, dep_yaml, dep_m])
executable(
meson.project_name(),
src_files + [ 'build/install.vala' ],
install : true,
dependencies : [
dependency('glib-2.0'),
dependency('gobject-2.0'),
dependency('gmodule-2.0'),
dependency('gio-2.0'),
dependency('gee-0.8'),
dependency('pluie-echo-0.2'),
dependency('pluie-yaml-0.5'),
meson.get_compiler('c').find_library('m', required : false)
]
)

View File

@ -98,7 +98,7 @@ public class Pluie.Berel.App
foreach (var name in header.file) {
path = Path.build_filename(this.pwd, name);
data = this.get_write_content(path, header);
if (this.write_file (path, data)) {
if (data.length > 0 && this.write_file (path, data)) {
if (header.yaml_name == "sh") {
FileUtils.chmod (path, 0775);
}
@ -115,7 +115,6 @@ public class Pluie.Berel.App
*/
private void write_dir (string path, HeaderDef header)
{
of.echo (" > reading directory %s".printf (path));
string? dname = null;
string? data = null;
try {
@ -126,14 +125,13 @@ public class Pluie.Berel.App
this.write_dir (p, header);
else {
data = this.get_write_content(p, header, true);
this.write_file (p, data);
if (data.length > 00) this.write_file (p, data);
}
}
}
catch(GLib.FileError e) {
of.error (e.message);
}
of.echo (" < directory %s".printf (path));
}
/**

View File

@ -34,7 +34,7 @@ public class Pluie.Berel.HeaderDef : Yaml.Object
{
public Gee.ArrayList<string> file { get; set; }
public Gee.ArrayList<string> dir { get; set; }
public int startline { get; set; }
public int startline { get; set; default = 1; }
public Berel.Sepline sepline { get; set; }
public Gee.ArrayList<string> extension { get; set; }
public Berel.Comment comment { get; set; }

38
src/meson.build Normal file
View File

@ -0,0 +1,38 @@
#^# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# @software : berel <https://git.pluie.org/pluie/berel>
# @version : 0.21
# @type : program
# @date : 2018
# @license : GPLv3.0 <http://www.gnu.org/licenses/>
# @author : a-Sansara <[dev]at[pluie]dot[org]>
# @copyright : pluie.org <http://www.pluie.org>
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# This file is part of berel.
#
# berel is free software (free as in speech) : you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# berel is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License
# along with berel. If not, see <http://www.gnu.org/licenses/>.
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #^#
src_files = [
'src/Pluie/Berel.App.vala',
'src/Pluie/Berel.Comment.vala',
'src/Pluie/Berel.HeaderDef.vala',
'src/Pluie/Berel.Key.vala',
'src/Pluie/Berel.Meta.vala',
'src/Pluie/Berel.Sepline.vala',
'src/main.vala'
]