2017-04-26 22:48:05 +00:00
|
|
|
bes-build
|
|
|
|
=========
|
|
|
|
|
2017-07-07 02:17:03 +00:00
|
|
|
**bes-build** is a small bash bes application to build bash program.
|
2017-04-30 02:26:52 +00:00
|
|
|
the building process simply consist to append shell script files from your `src/` project directory
|
|
|
|
into a single `dist/project` executable file
|
2017-04-26 22:48:05 +00:00
|
|
|
|
2017-05-14 01:13:11 +00:00
|
|
|
|
2017-07-07 02:41:52 +00:00
|
|
|
since version **0.5** **bes-build** attempt to be a *dependency manager* like `composer` (for php projects) but in a more extra-light way
|
|
|
|
since version **0.7** **bes-build** is able to manage his own dependencies on self building process
|
2017-05-14 01:13:11 +00:00
|
|
|
|
2017-04-26 22:48:05 +00:00
|
|
|
### Install
|
|
|
|
|
|
|
|
```
|
2017-04-30 02:26:52 +00:00
|
|
|
wget https://raw.githubusercontent.com/meta-tech/bes-build/latest/dist/bes-build
|
|
|
|
bash ./bes-build -i
|
2017-04-26 22:48:05 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Usage
|
|
|
|
|
|
|
|
```shell
|
|
|
|
# change directory to your project
|
|
|
|
cd /home/repo/meta-tech/bes
|
|
|
|
bes-build
|
|
|
|
# you can now execute program with :
|
|
|
|
./dist/bes
|
2017-04-30 02:26:52 +00:00
|
|
|
# to display help execute :
|
|
|
|
bes-build -h
|
2017-04-26 22:48:05 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Requirements
|
|
|
|
|
2017-05-14 01:39:58 +00:00
|
|
|
using **bes-build** script require you to conform to these following rules :
|
2017-04-26 22:48:05 +00:00
|
|
|
|
|
|
|
* respect this directory structure :
|
|
|
|
```pre
|
|
|
|
|
|
|
|
project/
|
2017-05-14 02:00:10 +00:00
|
|
|
|
|
|
|
|
|--- bes.ini # project information and requirements (optional)
|
|
|
|
|
|
|
|
|
|--- dist/project # project build (auto generated by bes-build)
|
2017-04-26 22:48:05 +00:00
|
|
|
|
|
|
|
|
|--- src/
|
2017-05-14 02:00:10 +00:00
|
|
|
| |
|
|
|
|
| |--- file1.sh
|
|
|
|
| |--- file2.sh
|
|
|
|
| | ...
|
|
|
|
| |--- filen.sh
|
|
|
|
|
|
|
|
|
|--- vendor/ # project dependencies (auto generated by bes-build update)
|
2017-04-26 22:48:05 +00:00
|
|
|
```
|
|
|
|
* each `src/` shell file require a `shebang` on first line (**#!/bin/bash**)
|
2017-05-14 01:13:11 +00:00
|
|
|
* `src/main.sh` file is append to the end of the build file
|
2017-04-30 02:26:52 +00:00
|
|
|
* we strongly recommand you to use function and prefix function name
|
|
|
|
```shell
|
|
|
|
bes.install(){
|
|
|
|
...
|
|
|
|
}
|
|
|
|
```
|
2017-05-14 01:13:11 +00:00
|
|
|
|
2017-05-14 02:00:10 +00:00
|
|
|
### Dependency Manager
|
2017-05-14 01:13:11 +00:00
|
|
|
|
2017-05-14 02:00:10 +00:00
|
|
|
**note:** This functionnality is still in progress
|
2017-05-14 01:39:58 +00:00
|
|
|
to use **bes-build** like a dependency manager, you need a `bes.ini` file in your application root path
|
2017-05-14 01:13:11 +00:00
|
|
|
|
|
|
|
```ini
|
|
|
|
[require]
|
2019-02-28 00:56:08 +00:00
|
|
|
bes.echo = 1.3
|
2017-05-14 01:13:11 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
then you can run the `update` command before building
|
|
|
|
|
|
|
|
```shell
|
|
|
|
bes-build update
|
|
|
|
```
|
|
|
|
|
2017-05-14 01:39:58 +00:00
|
|
|
**bes-build** call `git` on a `vendor` directory and clone the require lib
|
2017-05-14 01:13:11 +00:00
|
|
|
|
2017-05-14 01:39:58 +00:00
|
|
|
on next build, **bes-build** will append the dependencies to your dist file
|
2017-05-14 01:13:11 +00:00
|
|
|
|
|
|
|
|
2017-07-06 21:16:57 +00:00
|
|
|
### External dependencies
|
|
|
|
|
|
|
|
since version 0.6 you can now add external dependencies :
|
|
|
|
|
|
|
|
```ini
|
|
|
|
[require]
|
|
|
|
test.echo = https://git.pluie.org/meta-tech/bes-echo:master
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Releasing bes lib
|
|
|
|
|
|
|
|
if you intend to release your lib as a bes dependency you must provide a bes.ini file as following :
|
|
|
|
(example is taken from bes-echo)
|
|
|
|
|
|
|
|
```
|
|
|
|
[project]
|
|
|
|
vendor = bes
|
|
|
|
name = echo
|
2019-02-28 00:56:08 +00:00
|
|
|
version = 1.3
|
2017-07-06 21:16:57 +00:00
|
|
|
license = "GNU GPL v3"
|
|
|
|
author = a-Sansara
|
|
|
|
type = library
|
|
|
|
homepage = "https://git.pluie.org/meta-tech/bes-echo"
|
|
|
|
description = "bash bes display utility library"
|
|
|
|
keywords = "bash, bes"
|
2019-02-28 01:17:08 +00:00
|
|
|
|
|
|
|
[require]
|
|
|
|
bes.color = 1.3
|
2017-07-06 21:16:57 +00:00
|
|
|
```
|