update meson.build & samples for docker pluie/libyaml image
This commit is contained in:
parent
3a6a3faf98
commit
6987884c0a
14
README.md
14
README.md
|
@ -12,6 +12,11 @@ the lib does not manage yet tag directives and tag values.
|
|||
|
||||
![pluie-yaml](https://www.meta-tech.academy/img/pluie-yaml-imports2.png)
|
||||
|
||||
_legend display_childs_ :
|
||||
|
||||
```
|
||||
[ node.name [refCount] node.parent.name node.level node.ntype.infos () node.count () node.uuid ]
|
||||
```
|
||||
## License
|
||||
|
||||
GNU GPL v3
|
||||
|
@ -52,6 +57,15 @@ a demo image will be available soon on docker hub. you will be able to run a con
|
|||
docker run --rm -it pluie/libyaml
|
||||
```
|
||||
|
||||
then you can execute any samples :
|
||||
|
||||
```
|
||||
./json-loader
|
||||
```
|
||||
|
||||
![pluie-yaml-json](https://www.meta-tech.academy/img/pluie-yaml-json.png)
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
-------------------
|
||||
|
|
7
build.sh
7
build.sh
|
@ -61,9 +61,12 @@ function build.lib()
|
|||
{
|
||||
cd "$DIR"
|
||||
build.title "$lib LIB BUILD"
|
||||
echo
|
||||
meson --prefix=/usr ./ build
|
||||
sudo ninja -v install -C build
|
||||
if [ "$UID" != "0" ]; then
|
||||
sudo ninja -v install -C build
|
||||
else
|
||||
ninja -v install -C build
|
||||
fi
|
||||
local rs=$?
|
||||
build.title "$lib LIB BUILD" $rs
|
||||
return $rs
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace Pluie
|
|||
namespace Yaml
|
||||
{
|
||||
protected const string INSTALL_PATH = "@INSTALL_PATH@";
|
||||
protected const string DATA_PATH = "@DATA_PATH@";
|
||||
public const string DATA_PATH = "@DATA_PATH@";
|
||||
public const string VERSION = "@VERSION@";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ dep_yaml = cc.find_library('yaml', required : true)
|
|||
|
||||
version = '0.4'
|
||||
bindir = join_paths(get_option('prefix'), get_option('bindir'))
|
||||
datadir = join_paths(get_option('prefix'), get_option('datadir'), 'pluie')
|
||||
datadir = join_paths(get_option('prefix'), get_option('datadir'), 'pluie/yaml')
|
||||
libdir = join_paths(get_option('prefix'), get_option('libdir'), 'pkgconfig')
|
||||
incdir = join_paths(get_option('prefix'), get_option('includedir'), 'pluie')
|
||||
|
||||
|
@ -77,7 +77,11 @@ sources = [
|
|||
'src/c/yaml.c'
|
||||
]
|
||||
|
||||
install_data('resources/main.yml', install_dir : datadir)
|
||||
install_data('resources/test.yml', install_dir : datadir)
|
||||
install_data('resources/test.json', install_dir : datadir)
|
||||
install_data('resources/config/db.yml', install_dir : join_paths(datadir, 'config'))
|
||||
install_data('resources/config/subdir/test.yml', install_dir : join_paths(datadir, 'config/subdir'))
|
||||
|
||||
libpluie_yaml = library(
|
||||
'pluie-yaml-' + version,
|
||||
|
|
|
@ -35,7 +35,7 @@ int main (string[] args)
|
|||
{
|
||||
Echo.init(false);
|
||||
|
||||
var path = "resources/test.json";
|
||||
var path = Yaml.DATA_PATH + "/test.json";
|
||||
var done = false;
|
||||
|
||||
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
||||
|
|
|
@ -35,7 +35,7 @@ int main (string[] args)
|
|||
{
|
||||
Echo.init(false);
|
||||
|
||||
var path = "resources/config/db.yml";
|
||||
var path = Yaml.DATA_PATH + "/config/db.yml";
|
||||
var done = false;
|
||||
|
||||
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
||||
|
|
|
@ -35,7 +35,7 @@ int main (string[] args)
|
|||
{
|
||||
Echo.init(false);
|
||||
|
||||
var path = "resources/test.yml";
|
||||
var path = Yaml.DATA_PATH + "/test.yml";
|
||||
var done = false;
|
||||
|
||||
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
||||
|
|
|
@ -35,7 +35,7 @@ int main (string[] args)
|
|||
{
|
||||
Echo.init(false);
|
||||
|
||||
var path = "./resources/main.yml";
|
||||
var path = Yaml.DATA_PATH + "/main.yml";
|
||||
var done = false;
|
||||
|
||||
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
||||
|
|
|
@ -35,7 +35,7 @@ int main (string[] args)
|
|||
{
|
||||
Echo.init(false);
|
||||
|
||||
var path = "resources/test.yml";
|
||||
var path = Yaml.DATA_PATH + "/test.yml";
|
||||
var done = false;
|
||||
|
||||
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
||||
|
|
|
@ -35,7 +35,7 @@ int main (string[] args)
|
|||
{
|
||||
Echo.init(false);
|
||||
|
||||
var path = "resources/test.yml";
|
||||
var path = Yaml.DATA_PATH + "/test.yml";
|
||||
var done = false;
|
||||
|
||||
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
||||
|
|
|
@ -137,7 +137,6 @@ public class Pluie.Yaml.Config
|
|||
Yaml.Node? n = null;
|
||||
Yaml.Config? conf = null;
|
||||
foreach(var entry in this.paths.entries) {
|
||||
of.keyval(entry.key, entry.value);
|
||||
conf = new Yaml.Config(entry.value, this.displayFile);
|
||||
sub = conf.loader.get_nodes ();
|
||||
n = new Yaml.Mapping (root, entry.key);
|
||||
|
|
Loading…
Reference in New Issue
Block a user