-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from lf-lang/feature/init-dependency-management
Dependency Management
- Loading branch information
Showing
19 changed files
with
1,897 additions
and
587 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
**Contact:** <[email protected]> | ||
|
||
Lingo is a one-stop build tool for the Lingua Franca project. | ||
Lingo will manage dependencies, configure build scripts and will potentially cross-compile for embedded platforms. | ||
Lingo will manage your dependencies, configure build scripts and will potentially cross-compile for embedded platforms. | ||
|
||
|
||
## Getting started | ||
|
@@ -12,25 +12,23 @@ Lingo is a Rust project and is built with cargo. To install it simply run | |
## The command line interface | ||
|
||
``` | ||
lingua-franca package manager and build tool 0.1.2 | ||
[email protected] | ||
Build system of lingua-franca projects | ||
USAGE: | ||
lingo [OPTIONS] <SUBCOMMAND> | ||
OPTIONS: | ||
-b, --backend <BACKEND> Force lingo to use the specified backend [default: cli] | ||
-h, --help Print help information | ||
-V, --version Print version information | ||
SUBCOMMANDS: | ||
build Compile the current package | ||
clean Remove build artifacts from the package | ||
help Print this message or the help of the given subcommand(s) | ||
init Initialize a new package | ||
run Build and run a main program in the package | ||
update Update all the dependencies in the package | ||
Build system for the Lingua Franca coordination language | ||
Usage: lingo [OPTIONS] <COMMAND> | ||
Commands: | ||
init Initialize a Lingua Franca package | ||
build Compile one or multiple binaries in a Lingua Franca package | ||
update Update the dependencies and potentially build tools | ||
run Build and run binaries | ||
clean Remove build artifacts | ||
help Print this message or the help of the given subcommand(s) | ||
Options: | ||
-q, --quiet Do not produce any output | ||
-v, --verbose Provide more detailed feedback | ||
-h, --help Print help | ||
-V, --version Print version | ||
``` | ||
|
||
## The toml-based package configurations | ||
|
@@ -45,36 +43,33 @@ homepage = "https://lf-lang.org" | |
license = "Weird Stallman License" | ||
description = "A little Lingo.toml for people" | ||
|
||
# shared properties of all binaries | ||
[properties] | ||
fast = true | ||
# a library exported by this LF Package | ||
[lib] | ||
name = "websocket" | ||
location = "./src/lib" | ||
target = "C" | ||
platform = "Native" | ||
|
||
[lib.properties] | ||
cmake-include="./websocket.cmake" | ||
|
||
# first binary in the project | ||
[[app]] | ||
name = "git-hook" | ||
target = "cpp" | ||
main_reactor = "src/Main.lf" | ||
# main_reactor defaults to src/Main.lf | ||
|
||
# dependencies | ||
[[app.dependencies]] | ||
git = {version = "0.3.2"} | ||
tarfetcher = {version = "0.4.2"} | ||
main = "src/Main.lf" | ||
|
||
# replacement for target properties | ||
[[app.properties]] | ||
cmake-include = "./my-cmake.cmake" | ||
logging = "info" | ||
|
||
# second binary | ||
[[app]] | ||
name = "embedded" | ||
# main_reactor = "src/SayHello.lf" | ||
target = "zephyr" | ||
|
||
[[app.dependencies]] | ||
blink = {version = "0.1.2"} | ||
# dependencies | ||
[[dependencies]] | ||
mqtt = {version=">=0.1", git="https://github.com/LF-Community/mqtt.git", branch="main"} | ||
|
||
[[app.properties]] | ||
no-compile = true | ||
``` | ||
|
||
## Supported Platforms | ||
|
||
We mainly support Linux and MacOs, support for windows is secondary. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ use clap::{Args, Parser, Subcommand}; | |
use serde_derive::{Deserialize, Serialize}; | ||
use std::path::PathBuf; | ||
|
||
#[derive(clap::ValueEnum, Clone, Copy, Debug, Deserialize, Serialize, PartialEq)] | ||
#[clap(rename_all = "lowercase")] | ||
#[derive(clap::ValueEnum, Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq, Hash)] | ||
#[value(rename_all = "lowercase")] | ||
pub enum TargetLanguage { | ||
C, | ||
Cpp, | ||
|
@@ -13,7 +13,7 @@ pub enum TargetLanguage { | |
Python, | ||
} | ||
|
||
#[derive(clap::ValueEnum, Clone, Copy, Debug, Deserialize, Serialize, PartialEq)] | ||
#[derive(clap::ValueEnum, Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq, Hash)] | ||
pub enum Platform { | ||
Native, | ||
Zephyr, | ||
|
@@ -32,40 +32,39 @@ pub enum BuildSystem { | |
#[derive(Args, Debug)] | ||
pub struct BuildArgs { | ||
/// Which build system to use | ||
/// TODO: discuss this | ||
#[clap(short, long)] | ||
#[arg(short, long)] | ||
pub build_system: Option<BuildSystem>, | ||
|
||
/// Which target to build | ||
#[clap(short, long)] | ||
#[arg(short, long)] | ||
pub language: Option<TargetLanguage>, | ||
|
||
/// Overwrites any possible board definition in Lingo.toml | ||
#[clap(long)] | ||
#[arg(long)] | ||
pub platform: Option<Platform>, | ||
|
||
/// Tell lingo where the lfc toolchain can be found | ||
#[clap(long)] | ||
#[arg(long)] | ||
pub lfc: Option<PathBuf>, | ||
|
||
/// Skips building aka invoking the build system so it only generates code | ||
#[clap(short, long, action)] | ||
#[arg(short, long)] | ||
pub no_compile: bool, | ||
|
||
/// If one of the apps fails to build dont interrupt the build process | ||
#[clap(short, long, action)] | ||
#[arg(short, long)] | ||
pub keep_going: bool, | ||
|
||
/// Compiles the binaries with optimizations turned on and strips debug symbols | ||
#[clap(short, long, action)] | ||
#[arg(short, long)] | ||
pub release: bool, | ||
|
||
/// List of apps to build if left empty all apps are built | ||
#[clap(short, long, value_delimiter = ',')] | ||
#[arg(short, long, value_delimiter = ',')] | ||
pub apps: Vec<String>, | ||
|
||
/// Number of threads to use for parallel builds. Zero means it will be determined automatically. | ||
#[clap(short, long, default_value_t = 0)] | ||
#[arg(short, long, default_value_t = 0)] | ||
pub threads: usize, | ||
} | ||
|
||
|
@@ -81,9 +80,9 @@ impl BuildArgs { | |
|
||
#[derive(Args, Debug)] | ||
pub struct InitArgs { | ||
#[clap(value_enum, short, long)] | ||
#[arg(value_enum, short, long)] | ||
pub language: Option<TargetLanguage>, | ||
#[clap(value_enum, short, long, default_value_t = Platform::Native)] | ||
#[arg(value_enum, short, long, default_value_t = Platform::Native)] | ||
pub platform: Platform, | ||
} | ||
|
||
|
@@ -120,20 +119,20 @@ pub enum Command { | |
} | ||
|
||
#[derive(Parser)] | ||
#[clap(name = "Lingua Franca package manager and build tool")] | ||
#[clap(author = "[email protected]")] | ||
#[clap(version = env!("CARGO_PKG_VERSION"))] | ||
#[clap(about = "Build system for the Lingua Franca coordination language", long_about = None)] | ||
#[command(name = "Lingua Franca package manager and build tool")] | ||
#[command(author = "[email protected]")] | ||
#[command(version = env!("CARGO_PKG_VERSION"))] | ||
#[command(about = "Build system for the Lingua Franca coordination language", long_about = None)] | ||
pub struct CommandLineArgs { | ||
/// which command of lingo to use | ||
#[clap(subcommand)] | ||
pub command: Command, | ||
|
||
/// lingo wouldn't produce any output | ||
#[clap(short, long, action)] | ||
#[arg(short, long)] | ||
pub quiet: bool, | ||
|
||
/// lingo will give more detailed feedback | ||
#[clap(short, long, action)] | ||
#[arg(short, long)] | ||
pub verbose: bool, | ||
} |
Oops, something went wrong.