Add justfile
This commit is contained in:
parent
cb07b6255e
commit
adf8decc5b
3 changed files with 81 additions and 8 deletions
6
Cargo.lock
generated
6
Cargo.lock
generated
|
|
@ -484,7 +484,7 @@ checksum = "aadd183e815348c0649051b1c43418643208f8ed13c8a84da7215b4e1cf42714"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.4.0",
|
"bitflags 2.4.0",
|
||||||
"log",
|
"log",
|
||||||
"polling 3.1.0",
|
"polling 3.2.0",
|
||||||
"rustix 0.38.14",
|
"rustix 0.38.14",
|
||||||
"slab",
|
"slab",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
|
@ -2603,9 +2603,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "polling"
|
name = "polling"
|
||||||
version = "3.1.0"
|
version = "3.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7571075a670bb8e02350c4d1c27d934aabdce416aa91a95d58dc9e21267dad3c"
|
checksum = "62a79e457c9898100b4298d57d69ec53d06f9a6ed352431ce5f377e082d2e846"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"concurrent-queue",
|
"concurrent-queue",
|
||||||
|
|
|
||||||
67
justfile
Normal file
67
justfile
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
name := 'cosmic-greeter'
|
||||||
|
export APPID := 'com.system76.CosmicGreeter'
|
||||||
|
|
||||||
|
rootdir := ''
|
||||||
|
prefix := '/usr'
|
||||||
|
|
||||||
|
base-dir := absolute_path(clean(rootdir / prefix))
|
||||||
|
|
||||||
|
export INSTALL_DIR := base-dir / 'share'
|
||||||
|
|
||||||
|
bin-src := 'target' / 'release' / name
|
||||||
|
bin-dst := base-dir / 'bin' / name
|
||||||
|
|
||||||
|
# Default recipe which runs `just build-release`
|
||||||
|
default: build-release
|
||||||
|
|
||||||
|
# Runs `cargo clean`
|
||||||
|
clean:
|
||||||
|
cargo clean
|
||||||
|
|
||||||
|
# `cargo clean` and removes vendored dependencies
|
||||||
|
clean-dist: clean
|
||||||
|
rm -rf .cargo vendor vendor.tar
|
||||||
|
|
||||||
|
# Compiles with debug profile
|
||||||
|
build-debug *args:
|
||||||
|
cargo build {{args}}
|
||||||
|
|
||||||
|
# Compiles with release profile
|
||||||
|
build-release *args: (build-debug '--release' args)
|
||||||
|
|
||||||
|
# Compiles release profile with vendored dependencies
|
||||||
|
build-vendored *args: vendor-extract (build-release '--frozen --offline' args)
|
||||||
|
|
||||||
|
# Runs a clippy check
|
||||||
|
check *args:
|
||||||
|
cargo clippy --all-features {{args}} -- -W clippy::pedantic
|
||||||
|
|
||||||
|
# Runs a clippy check with JSON message format
|
||||||
|
check-json: (check '--message-format=json')
|
||||||
|
|
||||||
|
# Run with debug logs
|
||||||
|
run *args:
|
||||||
|
env RUST_LOG=debug RUST_BACKTRACE=1 cargo run --release {{args}}
|
||||||
|
|
||||||
|
# Installs files
|
||||||
|
install:
|
||||||
|
install -Dm0755 {{bin-src}} {{bin-dst}}
|
||||||
|
|
||||||
|
# Uninstalls installed files
|
||||||
|
uninstall:
|
||||||
|
rm {{bin-dst}}
|
||||||
|
|
||||||
|
# Vendor dependencies locally
|
||||||
|
vendor:
|
||||||
|
mkdir -p .cargo
|
||||||
|
cargo vendor --sync Cargo.toml \
|
||||||
|
| head -n -1 > .cargo/config
|
||||||
|
echo 'directory = "vendor"' >> .cargo/config
|
||||||
|
tar pcf vendor.tar vendor
|
||||||
|
rm -rf vendor
|
||||||
|
|
||||||
|
# Extracts vendored dependencies
|
||||||
|
vendor-extract:
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
rm -rf vendor
|
||||||
|
tar pxf vendor.tar
|
||||||
16
src/main.rs
16
src/main.rs
|
|
@ -12,12 +12,11 @@ use tokio::fs::{File, OpenOptions};
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let settings = Settings::default()
|
let settings = Settings::default()
|
||||||
.antialiasing(true)
|
.antialiasing(true)
|
||||||
.client_decorations(false)
|
.client_decorations(true)
|
||||||
.debug(false)
|
.debug(false)
|
||||||
.default_icon_theme("Pop")
|
.default_icon_theme("Cosmic")
|
||||||
.default_text_size(16.0)
|
.default_text_size(16.0)
|
||||||
.scale_factor(1.0)
|
.scale_factor(1.0)
|
||||||
.size((1024, 768))
|
|
||||||
.theme(cosmic::Theme::dark());
|
.theme(cosmic::Theme::dark());
|
||||||
|
|
||||||
cosmic::app::run::<App>(settings, ())?;
|
cosmic::app::run::<App>(settings, ())?;
|
||||||
|
|
@ -63,7 +62,7 @@ impl cosmic::Application for App {
|
||||||
type Message = Message;
|
type Message = Message;
|
||||||
|
|
||||||
/// The unique application ID to supply to the window manager.
|
/// The unique application ID to supply to the window manager.
|
||||||
const APP_ID: &'static str = "org.cosmic.AppDemo";
|
const APP_ID: &'static str = "com.system76.CosmicGreeter";
|
||||||
|
|
||||||
fn core(&self) -> &Core {
|
fn core(&self) -> &Core {
|
||||||
&self.core
|
&self.core
|
||||||
|
|
@ -74,7 +73,14 @@ impl cosmic::Application for App {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates the application, and optionally emits command on initialize.
|
/// Creates the application, and optionally emits command on initialize.
|
||||||
fn init(core: Core, input: Self::Flags) -> (Self, Command<Self::Message>) {
|
fn init(mut core: Core, _flags: Self::Flags) -> (Self, Command<Self::Message>) {
|
||||||
|
core.window.show_window_menu = false;
|
||||||
|
core.window.show_headerbar = false;
|
||||||
|
core.window.sharp_corners = true;
|
||||||
|
core.window.show_maximize = false;
|
||||||
|
core.window.show_minimize = false;
|
||||||
|
core.window.use_template = false;
|
||||||
|
|
||||||
(
|
(
|
||||||
App {
|
App {
|
||||||
core,
|
core,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue