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)
|
![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
|
## License
|
||||||
|
|
||||||
GNU GPL v3
|
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
|
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
|
## Usage
|
||||||
|
|
||||||
-------------------
|
-------------------
|
||||||
|
|
5
build.sh
5
build.sh
|
@ -61,9 +61,12 @@ function build.lib()
|
||||||
{
|
{
|
||||||
cd "$DIR"
|
cd "$DIR"
|
||||||
build.title "$lib LIB BUILD"
|
build.title "$lib LIB BUILD"
|
||||||
echo
|
|
||||||
meson --prefix=/usr ./ build
|
meson --prefix=/usr ./ build
|
||||||
|
if [ "$UID" != "0" ]; then
|
||||||
sudo ninja -v install -C build
|
sudo ninja -v install -C build
|
||||||
|
else
|
||||||
|
ninja -v install -C build
|
||||||
|
fi
|
||||||
local rs=$?
|
local rs=$?
|
||||||
build.title "$lib LIB BUILD" $rs
|
build.title "$lib LIB BUILD" $rs
|
||||||
return $rs
|
return $rs
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace Pluie
|
||||||
namespace Yaml
|
namespace Yaml
|
||||||
{
|
{
|
||||||
protected const string INSTALL_PATH = "@INSTALL_PATH@";
|
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@";
|
public const string VERSION = "@VERSION@";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ dep_yaml = cc.find_library('yaml', required : true)
|
||||||
|
|
||||||
version = '0.4'
|
version = '0.4'
|
||||||
bindir = join_paths(get_option('prefix'), get_option('bindir'))
|
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')
|
libdir = join_paths(get_option('prefix'), get_option('libdir'), 'pkgconfig')
|
||||||
incdir = join_paths(get_option('prefix'), get_option('includedir'), 'pluie')
|
incdir = join_paths(get_option('prefix'), get_option('includedir'), 'pluie')
|
||||||
|
|
||||||
|
@ -77,7 +77,11 @@ sources = [
|
||||||
'src/c/yaml.c'
|
'src/c/yaml.c'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
install_data('resources/main.yml', install_dir : datadir)
|
||||||
install_data('resources/test.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(
|
libpluie_yaml = library(
|
||||||
'pluie-yaml-' + version,
|
'pluie-yaml-' + version,
|
||||||
|
|
|
@ -35,7 +35,7 @@ int main (string[] args)
|
||||||
{
|
{
|
||||||
Echo.init(false);
|
Echo.init(false);
|
||||||
|
|
||||||
var path = "resources/test.json";
|
var path = Yaml.DATA_PATH + "/test.json";
|
||||||
var done = false;
|
var done = false;
|
||||||
|
|
||||||
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
||||||
|
|
|
@ -35,7 +35,7 @@ int main (string[] args)
|
||||||
{
|
{
|
||||||
Echo.init(false);
|
Echo.init(false);
|
||||||
|
|
||||||
var path = "resources/config/db.yml";
|
var path = Yaml.DATA_PATH + "/config/db.yml";
|
||||||
var done = false;
|
var done = false;
|
||||||
|
|
||||||
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
||||||
|
|
|
@ -35,7 +35,7 @@ int main (string[] args)
|
||||||
{
|
{
|
||||||
Echo.init(false);
|
Echo.init(false);
|
||||||
|
|
||||||
var path = "resources/test.yml";
|
var path = Yaml.DATA_PATH + "/test.yml";
|
||||||
var done = false;
|
var done = false;
|
||||||
|
|
||||||
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
||||||
|
|
|
@ -35,7 +35,7 @@ int main (string[] args)
|
||||||
{
|
{
|
||||||
Echo.init(false);
|
Echo.init(false);
|
||||||
|
|
||||||
var path = "./resources/main.yml";
|
var path = Yaml.DATA_PATH + "/main.yml";
|
||||||
var done = false;
|
var done = false;
|
||||||
|
|
||||||
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
||||||
|
|
|
@ -35,7 +35,7 @@ int main (string[] args)
|
||||||
{
|
{
|
||||||
Echo.init(false);
|
Echo.init(false);
|
||||||
|
|
||||||
var path = "resources/test.yml";
|
var path = Yaml.DATA_PATH + "/test.yml";
|
||||||
var done = false;
|
var done = false;
|
||||||
|
|
||||||
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
||||||
|
|
|
@ -35,7 +35,7 @@ int main (string[] args)
|
||||||
{
|
{
|
||||||
Echo.init(false);
|
Echo.init(false);
|
||||||
|
|
||||||
var path = "resources/test.yml";
|
var path = Yaml.DATA_PATH + "/test.yml";
|
||||||
var done = false;
|
var done = false;
|
||||||
|
|
||||||
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
of.title ("Pluie Yaml Library", Pluie.Yaml.VERSION, "a-sansara");
|
||||||
|
|
|
@ -137,7 +137,6 @@ public class Pluie.Yaml.Config
|
||||||
Yaml.Node? n = null;
|
Yaml.Node? n = null;
|
||||||
Yaml.Config? conf = null;
|
Yaml.Config? conf = null;
|
||||||
foreach(var entry in this.paths.entries) {
|
foreach(var entry in this.paths.entries) {
|
||||||
of.keyval(entry.key, entry.value);
|
|
||||||
conf = new Yaml.Config(entry.value, this.displayFile);
|
conf = new Yaml.Config(entry.value, this.displayFile);
|
||||||
sub = conf.loader.get_nodes ();
|
sub = conf.loader.get_nodes ();
|
||||||
n = new Yaml.Mapping (root, entry.key);
|
n = new Yaml.Mapping (root, entry.key);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user