-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore: Use Just instead of Make #323
Open
ryanabx
wants to merge
1
commit into
pop-os:master
Choose a base branch
from
ryanabx-contrib:just
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
appid := env_var('APPID') | ||
share-dir := env_var('SHARE_DIR') | ||
lib-dir := env_var('LIB_DIR') | ||
bin-dir := env_var('BIN_DIR') | ||
|
||
desktop-src := 'cosmic' + '.desktop' | ||
desktop-dst := share-dir / 'wayland-sessions' / desktop-src | ||
|
||
ccservice-src := 'cosmic-comp' + '.service' | ||
ccservice-dst := lib-dir / 'systemd' / 'user' / ccservice-src | ||
|
||
session-target-src := 'cosmic-session' + '.target' | ||
session-target-dst := lib-dir / 'systemd' / 'user' / session-pretarget-src | ||
|
||
session-pretarget-src := 'cosmic-session-pre' + '.target' | ||
session-pretarget-dst := lib-dir / 'systemd' / 'user' / session-pretarget-src | ||
|
||
cosmic-service-src := 'cosmic-service' | ||
cosmic-service-dst := bin-dir / cosmic-service-src | ||
|
||
install-bare-session: | ||
install -Dm0644 {{desktop-src}} {{desktop-dst}} | ||
install -Dm0644 {{ccservice-src}} {{ccservice-dst}} | ||
install -Dm0644 {{session-pretarget-src}} {{session-pretarget-dst}} | ||
install -Dm0644 {{session-target-src}} {{session-target-dst}} | ||
install -Dm0755 {{cosmic-service-src}} {{cosmic-service-dst}} | ||
|
||
uninstall-bare-session: | ||
rm {{desktop-dst}} {{ccservice-dst}} {{session-pretarget-dst}} {{session-target-dst}} {{cosmic-service-dst}} |
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name := 'cosmic-comp' | ||
export APPID := 'com.system76.CosmicComp' | ||
|
||
rootdir := '' | ||
prefix := '/usr' | ||
|
||
base-dir := absolute_path(clean(rootdir / prefix)) | ||
|
||
export SHARE_DIR := sharedir | ||
export BIN_DIR := base-dir / 'bin' | ||
export LIB_DIR := libdir | ||
|
||
bin-src := 'target' / 'release' / name | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Change this line to |
||
bin-dst := base-dir / 'bin' / name | ||
|
||
libdir := base-dir / 'lib' | ||
sharedir := base-dir / 'share' | ||
|
||
# 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') | ||
|
||
# Installs files | ||
install: | ||
install -Dm0755 {{bin-src}} {{bin-dst}} | ||
|
||
install-bare-session: install | ||
@just data/install-bare-session | ||
|
||
# Uninstalls installed files | ||
uninstall: | ||
rm {{bin-dst}} | ||
|
||
uninstall-bare-session: uninstall | ||
@just data/uninstall-bare-session | ||
|
||
# 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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Add a line like
cargo-target-dir := env('CARGO_TARGET_DIR', 'target')
here to read the CARGO_TARGET_DIR environment variable.