Commit e99aebd4 authored by Bat's avatar Bat

website update

parent 478f6b16
Pipeline #12442 passed with stages
in 46 seconds
# How to contribute
Because poulp is libre software, everybody can help. But before coding anything, you have to know how do we work, to keep everything clean and organized.
## Before starting
- Make sure you have a Framagit account (if you don't want to create a new account, you can just login with GitHUb or GitLab.com) ;
- You have your own fork of poulp, and it's up-to-date ;
- You have an issue on which to work. If the issue doesn't exist yet, you can create it. Clearly says that you are working on it, so someone else will not start working on it too ;
## Making changes
For each issue you are solving, follow those instruction.
- Create a new branch named `issue-X` with `X` the ID of your issue (e.g. run `git checkout -b issue-42`). Most of the time, this new branch is based on master ;
- Start coding. Every time you finish something, even if it's small, commit it. You can push it to your fork if you want ;
- Be sure that you also updated the docs (`SPEC.md`) ;
- When you are ready, and if the build passes, create a merge request. It should have a title like that: `Fix #X : Description`. In merge request message, explain how to test what you have done ;
- Your merge request will be reviewed, and merged in `develop` !
Your commit messages should start with a (very) short description of what you have done. If you need more precision you should use a new line.
# poulp
poulp is like npm, but for Vala.
It is a little programm that'll help you generating files or projects, compiling your app, or installing librairies.
# Usage
First, create a `poulp.json` file. You can also use `poulp init` to do it.
```json
{
"name": "my-app",
"version": "1.4.6",
"dependencies": {
"gtk+-3.0": "*",
"gio-2.0": "*",
"libsoup-2.4": "*",
"semver": "^0.2.0"
}
}
```
Then, open a terminal and just run the following command.
```
poulp build
```
It will run this command for you.
```
valac *.vala -o build/my-app --pkg gtk+-3.0 --pkg gio-2.0 --pkg libsoup-2.4 --pkg semver
```
If you need some libraries that are not installed, run `poulp install`. With the manifest above, it will probably install a matching version of [`semver`](https://framagit.org/Bat/semver).
When installing a library, it will search for it in remote repositories, clone the matching git repository, compile it for your system and install it.
# Complete manifest
Here is a complete manifest, to let you see all available properties.
```json
{
"name": "my-app",
"version": "0.1.0",
"description": "A cool application",
"keywords": [
"website", "valse", "cool"
],
"homepage": "https://jean.dupont.fr/myapp.html",
"bugs": {
"url": "git.dupont.fr/jean/my-app/issues",
"email": "jean@dupont.fr"
},
"license": "LGPLv4",
"author": "Jean Dupont",
"contributors": [
"Jean Dupont", "Jeanne Dupont"
],
"maintainers": [
"The MyApp maintainment team"
],
"files": [
"*.vala", "*.wala", "models/*.vala", "static/*", "*.gs", "*.c"
],
"repository": "https://git.dupont.fr/my-app.git",
"vapi-dir": "src/vapis/",
"output": "custom-build-path/my-app",
"scripts": {
"test": [
"poulp build",
"./$(POULP_BUILD_OUPUT)"
]
},
"dependencies": {
"gio-2.0": "*",
"valse": "^0.1.2",
},
"dev-dependencies": [
"valadate-0.1"
],
"vala-version": ">=0.20.1",
"compilerParams": [
"-o", "$(POULP_NAME)-$(POULP_VERSION)"
]
}
```
# Available commands
- help - display help messages about poulp and commands
- init - init a new project
- install - install librairies in `poulp.json` or the specified ones
- build - build the project
- lint - lint your code
- repo - manage distant repositories
- run - run a script definde in `poulp.json`
# Hosting libraries
You can see an exemple repo here : https://gitlab.com/Bat41/poulp-repo-test/tree/master/.
You can use it with poulp by doing `poulp repo add https://gitlab.com/Bat41/poulp-repo-test/raw/master/dist`.
# poulp's website
Available at [poulp.frama.io](https://poulp.frama.io).
If you are looking for poulp itself see [poulp/poulp](https://framagit.org/poulp/poulp).
# poulp's specification
*This document aims to provide a description of how poulp will work when it will be prouction-ready.*
## poulp.json
The `poulp.json` file contains some [JSON](http://json.org) defining the properties of a project. It is located at the root of the project.
It can contains the following keys.
### name
The name of the project. It should only contain (small) letters, numbers or hyphens, and it must start with a letter.
```ruby
"my-project" # correct
"my-project-123" # correct
"GTK+ App" # Incorrect : capitals, + and space
"42-the-meaning-of-life-etc" # Incorrect : begins with a number
```
*This key is mandatory.*
### version
This is the version of your package. It should be a valid [semantic version](http://semver.org).
*This key is mandatory.*
### description
This is just a short description of your package.
### keywords
An array containing strings, which are the keywords of your package. It help people finding them when doing `poulp search`, and on the repositories websites using [poulp server](https://framagit.org/valse/poulp-server).
### homepage
This is a string containing the URL of the projects website.
### bugs
Specifies where to report bugs. It is an object, which can contain this fields.
- `url`, the bug tracker URL ;
- `email`, an email adress where we can send bug reports.
### license
The name of the license of your project.
### author
The name of the author of the project. It could contain an email adress after the name, between `<` `>`.
### contributors
A list of the peoples (string looking like the `author` field) who contributed to this project.
### maintainers
A list of the peoples (string looking like the `author` field) who maintains this project.
### files
The files to include at compilation.
### repository
The URL of the projects repository, where we can find the source code.
### vapi-dir
The path to a directory containing personal VAPIs.
### output
Where to put the result of the compilation. Defaults to `build/name-version` (where `name` is the name of the project and `version` the version).
### library
A boolean that tells us if this project is a library or not. If it is, it will be compiled in a special way, to make it reusable by everyone.
### scripts
Some custom scripts, that can be run whit `poulp run`. It's an object containing the fields you want (their name will be used as the argument of `poulp run`). Each of those fields are arrays with the list of the command to run.
### dependencies
The projects dependencies. It is an object where the keys are the name of the dependencies, and the value a range of versions. The name should be the same as the VAPI file name.
To see examples of version ranges, go to [semver](https://framagit.org/Bat/semver).
### dev-dependencies
Same as `dependencies`, but will only be installed by people developing the project. For instance, it could a testing framework.
### vala-version
The minimal Vala version to use with this project.
### compiler-params
Some other arguments to gives to `valac` when building.
## Commands
Each command listed here can be run with `poulp command`, where `command` is the command followed by its arguments.
`[arg]` is an optional argument.
### search package
Search the package named `package` in the known repositories. It will display something like that.
```
package 0.1.0 Short description of the package.
other 0.2.3 Yet another package.
```
### info package
Gives infos about `package`.
```
✓ Installed
Name package
Version 0.1.0 (latest is 0.2.0, update with `poulp update package`)
Description This is a package.
Author John Doe
Contributors Jane Doe, Foo Bar
Files package.vapi, package.h, package.so, package.pc
Dependencies other (0.2.3), foo (<2.1.0), bar (*)
Website https://john.doe.eu/projects/package
Source code https://john.doe.eu/git/package.git
```
### pack [--zip|--gz]
Creates a .zip or .tar.gz file containing all the binaries of the project (.h, .vapi, .so, .dll, etc)
### publish major|minor|patch --repo url [--no-changelog]
Pack the project (see `pack` above), creates a new version (update it in the manifest, `git tag` if the project uses `git`),
and update the changelog with `git log`, if it was not manually done (this last behavior can be disabled with `--no-changelog`).
Then it post the new version on the repository at `url`.
**Warning** `--repo` and `--no-changelog` are not implemented yet.
### build [--release]
Compiles your project using the options specified in the manifest.
### gen output --template template
Creates a new file (`output`) from the template named `template`. `output` doesn't need to include any extension.
### help [command]
Gives you help about poulp, or a specific command if `command` is specified.
### init
An interactive tool to create a new project.
### install [lib] [lib] [lib]...
Install all the specified libraries, or those present in `libs` in the manifest if none.
It clones the libraries, checkout to the most recent matching version, builds it and installs the result.
### lint [--elementary|--gnome|--both]
Lints your code, following the specified convention (defautl is elementary).
### repo [add|remove] [url]
Manages your remote repositories. If there is no argument, it just lists them.
If you do [add url], it registers the repo at `url`. And `remove url` unregisters the repository at `url`.
### run script
It runs the script named `script`, previousy defined in the manifest.
### update [lib] [lib] [lib]...
Updates your packages to the latest version.
# Variables
poulp defines some environment varaibles when spawning a command. You can use them in `output`, `compiler-params` and your scripts.
- `$PROJECT_NAME`, the name of your project;
- `$PROJECT_VERSION`, the version of your project;
- `$PROJECT_DESCRIPTION`, the description of your project;
- `$PROJECT_LICENSE`, the license of your project;
- `$PROJECT_HOMEPAGE`, the homepage of your project;
- `$PROJECT_OUTPUT`, the path to the output of your project;
# Remote repositories organization
*You can find a sample repository [here](https://gitlab.com/Bat41/poulp-repo-test/tree/master/dist).*
The remote repositories just contains one file, named `packages.json`. It contains a list of all the packages available in this repository. It also contains another field, `name`, which is the name of the repository.
This file has an object, named `packages` which contains key-value pairs of packages (the name is the key, and the git repository the value).
*Example `package.json` file*
```
{
"name": "A little poulp repository",
"packages": {
"foo": "https://git.foo.org/foo.git",
"bar": "https://github.com/baz/bar",
"hello": "https://gitlab.com/hey/hello"
}
}
```
It is planed to make it possible for package to install templates, but not available yet.
----
Because it could be a little bit hard to manually manage a repository, we are [working on a web interface](https://framagit.org/valse/poulp-server) to do it easily. But yet, you can just use a git repository.
# Local organization
poulp stores local files in `$POULP_DATA_DIR`, which defaults to `C:\ProgramData\poulp\` on Windows and `/etc/poulp/` on other systems.
This directory contains a file named `repos`, which contains a list of all known repos (their URL to be exact), one per line.
Then, you have the `projects` and `files` folders, similar to those in a distant repository, but only with installed templates.
header
ul.links
li
a(href="/") Home
li
a(href="https://framagit.org/valse/poulp") Source Code
li
a(href="/plugins") Create plugins
......@@ -7,5 +7,9 @@ html
link(rel="icon" href="img/poulp.svg")
body
!= yield
footer
| This website is under the LGPL-3.0 license.
| &mdash;
a(href="https://framagit.org/poulp/poulp.frama.io") Source Code of the website.
script(src="js/highlight.pack.js")
script hljs.initHighlightingOnLoad();
@light-background: rgb(245, 245, 245);
@light-gray: rgb(200, 200, 200);
@light-gray: rgb(220, 220, 210);
html, body {
margin: 0px;
......@@ -18,16 +18,17 @@ h1, h2, h3, h4 {
}
p.hint {
@blue: rgb(0, 140, 255);
@blue: rgb(0, 163, 255);
border-left: 5px solid @blue;
background: lighten(@blue, 30%);
padding: 15px;
margin: 30px 0px;
}
div.presenter {
text-align: center;
background: linear-gradient(to top left, #1A2980 , #26D0CE);
padding: 10%;
background: linear-gradient(to top left, #1A2980 , #26D0CE);
color: white;
img {
......@@ -36,6 +37,13 @@ div.presenter {
}
}
footer {
background: @light-background;
padding: 50px 20%;
text-align: center;
border-top: 1px solid @light-gray;
}
.links {
list-style: none;
text-align: center;
......@@ -61,10 +69,29 @@ div.presenter {
}
}
ul {
padding-left: 0px;
li.card {
list-style: none;
background: @light-background;
padding: 10px 30px;
margin: 10px;
.border();
h3 {
font-weight: 600;
}
}
}
main {
padding: 50px 20%;
}
pre code {
box-shadow: 0px 0px 5px @light-gray;
.border();
}
.border {
border: 1px solid @light-gray;
border-radius: 3px;
}
......@@ -22,13 +22,8 @@ main
| To achieve that, every project contains a <code>poulp.toml</code> file, describing your application
| or library.
p.hint
| If you don't know what is TOML, you can read the specification. But it is really easy to read, so
| If you don't know what is TOML, you can read <a href="https://github.com/toml-lang/toml">the specification</a>. But it is really easy to read, so
| maybe it's not even necessary.
h2 Packages installation
p Installing a package is now as easy as:
pre
code(class="bash") poulp install my-package
h2 Complete manifest
p Here is an example of a complete <code>poulp.toml</code>.
......@@ -83,7 +78,55 @@ main
| [dev-dependencies]
| valadate = "^0.1.0"
h2(id="commands") Available commands
ul
li.card
h3 build
p Builds your project using the options defined in the manifest.
li.card
h3 gen
p Scaffolds a file following a template. Templates can be installed by packages.
li.card
h3 help
p Just displays help about other commands.
li.card
h3 init
p Initialize a new project. You can eventually use a template (which can be installed by packages too).
li.card
h3 install
p Installs a specific package or all the dependencies of the project.
li.card
h3 lint
p Lints your source code following elementary OS's or GNOME's conventions.
li.card
h3 publish
p Publishes a new version of your library.
li.card
h3 repo
p Manages remote packages repositories
li.card
h3 run
p Run one of the script of your manifest.
li.card
h3 update
p Updates your packages.
p.hint You can install additional commands as any other package with <code>poulp install</code>.
h2(id="install") Convinced?
p Just install it <em>via</em> Flatpak:
pre
code(class="bash") echo "TODO"
code(class="bash") echo "See issue #40 on Framagit"
h2 FAQ
h3 How to host a remote repository?
p
| We are working on a web app to manage a repository with a nice UI. But hosting a repository is really easy.
| You just have to create a <code>packages.json</code> file. Then list your packages like
| <a href="https://gitlab.com/Bat41/poulp-repo-test/blob/master/dist/packages.json">in this example</a>
h3 Why not use waf, meson, CMake & Co?
p
| Poulp is not just a build tool. It also manages your dependencies and let you publish your projects.
| And even the <code>build</code> command is designed specially for Vala and not as a general build tool.
!= partial("_header")
main
h1 Plugins
p Plugins are not available yet, see
a(href="https://framagit.org/poulp/poulp/issues/39") issue #39
| .
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment