chore: add arguments like target architecture
This commit is contained in:
parent
eeaf8e9698
commit
8f7558bac4
24
README.md
24
README.md
@ -84,7 +84,7 @@ Available recipes:
|
|||||||
expand # [alias: e]
|
expand # [alias: e]
|
||||||
fmt # [alias: f]
|
fmt # [alias: f]
|
||||||
install # [alias: i]
|
install # [alias: i]
|
||||||
make-app # [alias: mkapp]
|
make-app # [alias: mk, mkapp]
|
||||||
package # [alias: p, pkg]
|
package # [alias: p, pkg]
|
||||||
run # [alias: ru]
|
run # [alias: ru]
|
||||||
runtest # [alias: rt]
|
runtest # [alias: rt]
|
||||||
@ -120,15 +120,15 @@ BIN_APP_PATH := "/usr/local/bin"
|
|||||||
|
|
||||||
| Recipe | alias | Descripción | parameters |
|
| Recipe | alias | Descripción | parameters |
|
||||||
|--------|-------|--------------|--------------------|
|
|--------|-------|--------------|--------------------|
|
||||||
| **build** | b | run cargo | |
|
| **build** | b | run cargo | cargo arguments |
|
||||||
| **buildall** | ba, ball | on MacOS: <br><ul><li>build target releases for aarch64, x86_64</li><li>create universal (apple-darwin)i with <u>lipo</u></li></ul>on Linux: <ul><li>build target release</li></ul> | |
|
| **buildall** | ba, ball | on MacOS: <br><ul><li>build target releases for aarch64, x86_64</li><li>create universal (apple-darwin)i with <u>lipo</u></li></ul>on Linux: <ul><li>build target release</li></ul> | architecture (arm64 or x86_64 or universal) |
|
||||||
| **run** | ru | run cargo b -r | |
|
| **run** | ru | run cargo b -r | cargo arguments |
|
||||||
| **expand** | e | run cargo expand | |
|
| **expand** | e | run cargo expand | cargo arguments |
|
||||||
| **fmt** | f | run cargo +nightly fmt | |
|
| **fmt** | f | run cargo +nightly fmt | cargo arguments |
|
||||||
| **clean** | cl | run cargo clean | |
|
| **clean** | cl | run cargo clean | cargo arguments |
|
||||||
| **doc** | d | run cargo doc --open --no-deps | |
|
| **doc** | d | run cargo doc --open --no-deps | cargo arguments |
|
||||||
| **benchmark** | be | run cargo bench | |
|
| **benchmark** | be | run cargo bench | cargo arguments |
|
||||||
| **test*** | be | run cargo t | |
|
| **test*** | be | run cargo t | cargo arguments |
|
||||||
| **runtest** | rt | run [run.sh](run.sh) script using [test](test) directories for **SOURCE** and **DEST** parametets | |
|
| **runtest** | rt | run [run.sh](run.sh) script using [test](test) directories for **SOURCE** and **DEST** parametets | |
|
||||||
|
|
||||||
## To work on app
|
## To work on app
|
||||||
@ -136,7 +136,7 @@ BIN_APP_PATH := "/usr/local/bin"
|
|||||||
| Recipe | alias | Descripción | parameters |
|
| Recipe | alias | Descripción | parameters |
|
||||||
|--------|-------|--------------|--------------------|
|
|--------|-------|--------------|--------------------|
|
||||||
| **install** | i | on MacOS: <ul><li>install [dir-odt-to-pdf.app](macos/dir-odt-to-pdf.app)</li><li> **make-run** and install commands</li></ul>on Linux: <ul><li>**just make-run**</li><li>install commands</li></ul>| |
|
| **install** | i | on MacOS: <ul><li>install [dir-odt-to-pdf.app](macos/dir-odt-to-pdf.app)</li><li> **make-run** and install commands</li></ul>on Linux: <ul><li>**just make-run**</li><li>install commands</li></ul>| |
|
||||||
| **make-app** | mkapp | on MacOS: <ul><li>make app [dir-odt-to-pdf.app](macos/dir-odt-to-pdf.app) in [macos](macos) directory</li><li>Add icons and commands</li></ul>on Linux: <ul><li>**just buildall**</li></ul> | |
|
| **make-app** | mk , mkapp | on MacOS: <ul><li>make app [dir-odt-to-pdf.app](macos/dir-odt-to-pdf.app) in [macos](macos) directory</li><li>Add icons and commands</li></ul>on Linux: <ul><li>**just buildall**</li></ul> | architecture (arm64 or x86_64 or universal) |
|
||||||
| **make-run** | | on MacOS: <ul><li>install [dir-odt-to-pdf.app](macos/dir-odt-to-pdf.app)</li><li>**just delete-run**</li><li>install commands</li></ul>on Linux: <ul><li>**just delete-run**</li><li>install commands</li></ul>| |
|
| **make-run** | | on MacOS: <ul><li>install [dir-odt-to-pdf.app](macos/dir-odt-to-pdf.app)</li><li>**just delete-run**</li><li>install commands</li></ul>on Linux: <ul><li>**just delete-run**</li><li>install commands</li></ul>| |
|
||||||
| **delete-run** | | Ask for replace **run-dir-odt-to-pdf.sh** created from [run.sh](run.sh) | |
|
| **delete-run** | | Ask for replace **run-dir-odt-to-pdf.sh** created from [run.sh](run.sh) | |
|
||||||
| **package** | | on MacOS: <ul><li>**just make-app**</li><li>create **DirOdtToPdf.dmg** DMG package in [packages](packages)<br>with [macos README](macos/README) and [macos install](macos/install.command)</li></ul>on Linux: <ul><li>**just make-app**</li><li>pack binary in compressed archive<br> with [linux](linux) files and commands</li></ul> | |
|
| **package** | | on MacOS: <ul><li>**just make-app**</li><li>create **DirOdtToPdf.dmg** DMG package in [packages](packages)<br>with [macos README](macos/README) and [macos install](macos/install.command)</li></ul>on Linux: <ul><li>**just make-app**</li><li>pack binary in compressed archive<br> with [linux](linux) files and commands</li></ul> | architecture (arm64 or x86_64 or universal) |
|
||||||
|
92
justfile
92
justfile
@ -10,6 +10,7 @@ alias rt := runtest
|
|||||||
alias ru := run
|
alias ru := run
|
||||||
alias cl := clean
|
alias cl := clean
|
||||||
alias mkapp := make-app
|
alias mkapp := make-app
|
||||||
|
alias mk := make-app
|
||||||
alias i := install
|
alias i := install
|
||||||
alias p := package
|
alias p := package
|
||||||
alias pkg := package
|
alias pkg := package
|
||||||
@ -28,39 +29,47 @@ SRC_MACOS := file_name(justfile_directory()) + ".scpt"
|
|||||||
RUN_SRC := "run.sh"
|
RUN_SRC := "run.sh"
|
||||||
BIN_APP_PATH := "/usr/local/bin"
|
BIN_APP_PATH := "/usr/local/bin"
|
||||||
|
|
||||||
|
set positional-arguments
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@just -l
|
@just -l
|
||||||
|
|
||||||
build:
|
[positional-arguments]
|
||||||
cargo build
|
build *ARGS:
|
||||||
|
cargo build {{ARGS}}
|
||||||
|
|
||||||
[linux]
|
[linux]
|
||||||
buildall:
|
buildall *ARGS:
|
||||||
@echo "Build {{BOLD + MAGENTA}}{{APP_NAME}}{{NORMAL}} ... "
|
@echo "Build {{BOLD + MAGENTA}}{{APP_NAME}}{{NORMAL}} ... "
|
||||||
cargo build --release
|
cargo build --release {{ARGS}}
|
||||||
|
|
||||||
[macos]
|
[macos]
|
||||||
buildall:
|
buildall *ARGS:
|
||||||
@echo "\nBuild {{BOLD + MAGENTA}}{{APP_NAME}}{{NORMAL}} universal for {{BOLD + GREEN}}{{os()}}{{NORMAL}} architectures ... "
|
@if test -z {{ARGS}} || test {{ARGS}} = "universal" || test {{ARGS}} = "aarch64" || test {{ARGS}} = "arm64"; then \
|
||||||
@echo "\n{{BOLD + MAGENTA + INVERT}}Apple Silicon (arm64){{NORMAL}}"
|
echo "\nBuild {{BOLD + MAGENTA}}{{APP_NAME}}{{NORMAL}} universal for {{BOLD + GREEN}}{{os()}}{{NORMAL}} architectures ... " ; \
|
||||||
cargo build --target aarch64-apple-darwin --release
|
echo "\n{{BOLD + MAGENTA + INVERT}}Apple Silicon (arm64){{NORMAL}}" ;\
|
||||||
@echo "\n{{BOLD + MAGENTA + INVERT}}Intel (x86_64){{NORMAL}} "
|
cargo build --target aarch64-apple-darwin --release ;\
|
||||||
cargo build --target x86_64-apple-darwin --release
|
fi
|
||||||
@if ! test -r target/apple-darwin/release ; then \
|
@if test -z {{ARGS}} || test {{ARGS}} = "universal" || test {{ARGS}} = "x86_64" || test {{ARGS}} = "x86"; then \
|
||||||
|
echo "\n{{BOLD + MAGENTA + INVERT}}Intel (x86_64){{NORMAL}} " ;\
|
||||||
|
cargo build --target x86_64-apple-darwin --release ;\
|
||||||
|
fi
|
||||||
|
@if test -z {{ARGS}} || test {{ARGS}} = "universal" && ! test -r target/apple-darwin/release ; then \
|
||||||
mkdir -p target/apple-darwin/release; \
|
mkdir -p target/apple-darwin/release; \
|
||||||
fi
|
fi
|
||||||
@if type -p lipo > /dev/null; then \
|
@if test -z {{ARGS}} || test {{ARGS}} = "universal" && type -p lipo > /dev/null; then \
|
||||||
lipo -create \
|
lipo -create \
|
||||||
-output target/apple-darwin/release/{{APP_NAME}} \
|
-output target/apple-darwin/release/{{APP_NAME}} \
|
||||||
target/aarch64-apple-darwin/release/{{APP_NAME}} \
|
target/aarch64-apple-darwin/release/{{APP_NAME}} \
|
||||||
target/x86_64-apple-darwin/release/{{APP_NAME}} ; \
|
target/x86_64-apple-darwin/release/{{APP_NAME}} ; \
|
||||||
fi
|
fi
|
||||||
@if test -r target/apple-darwin/release/{{APP_NAME}} ; then \
|
@if test -z {{ARGS}} || test {{ARGS}} = "universal" && test -r target/apple-darwin/release/{{APP_NAME}} ; then \
|
||||||
echo "\n{{BOLD + GREEN + INVERT}}target/apple-darwin/release/{{APP_NAME}}{{NORMAL}} created";\
|
echo "\n{{BOLD + GREEN + INVERT}}target/apple-darwin/release/{{APP_NAME}}{{NORMAL}} created";\
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[macos]
|
[macos]
|
||||||
make-app: buildall
|
make-app *ARGS:
|
||||||
|
@just buildall {{ARGS}}
|
||||||
@if test -r {{MACOS_ROOT_PATH + SRC_MACOS}} ; then \
|
@if test -r {{MACOS_ROOT_PATH + SRC_MACOS}} ; then \
|
||||||
echo "\n{{BOLD + GREEN + INVERT}}{{MACOS_APP_PATH}}{{NORMAL}}";\
|
echo "\n{{BOLD + GREEN + INVERT}}{{MACOS_APP_PATH}}{{NORMAL}}";\
|
||||||
echo "creating from {{BOLD + MAGENTA}}{{MACOS_ROOT_PATH + SRC_MACOS}}{{NORMAL}}";\
|
echo "creating from {{BOLD + MAGENTA}}{{MACOS_ROOT_PATH + SRC_MACOS}}{{NORMAL}}";\
|
||||||
@ -77,9 +86,19 @@ make-app: buildall
|
|||||||
cp {{MACOS_APP_ICNS_PATH}} {{MACOS_ROOT_PATH + MACOS_APP_PATH + "/Contents/Resources/applet.icns"}}; \
|
cp {{MACOS_APP_ICNS_PATH}} {{MACOS_ROOT_PATH + MACOS_APP_PATH + "/Contents/Resources/applet.icns"}}; \
|
||||||
echo "\nCopy {{BOLD + MAGENTA}}{{MACOS_APP_ICNS_PATH}}{{NORMAL}} to {{BOLD + GREEN}}{{MACOS_APP_PATH + "/Contents/Resources/applet.icns"}}{{NORMAL}}";\
|
echo "\nCopy {{BOLD + MAGENTA}}{{MACOS_APP_ICNS_PATH}}{{NORMAL}} to {{BOLD + GREEN}}{{MACOS_APP_PATH + "/Contents/Resources/applet.icns"}}{{NORMAL}}";\
|
||||||
fi
|
fi
|
||||||
@cd {{justfile_directory()}} && if test -r target/apple-darwin/release/{{APP_NAME}} ; then \
|
@cd {{justfile_directory()}} && \
|
||||||
|
if [[ "{{ARGS}}" == "aarch64" || "{{ARGS}}" == "arm64" && -r target/aarch64-apple-darwin/release/{{APP_NAME}} ]] ; then \
|
||||||
|
cp {{'target/aarch64-apple-darwin/release/' + APP_NAME}} {{MACOS_ROOT_PATH + MACOS_APP_PATH + "/Contents/MacOS/" + APP_NAME}}; \
|
||||||
|
echo "\n{{BOLD + GREEN + INVERT}}target/aarch64-apple-darwin/release/{{APP_NAME}}{{NORMAL}} to Contets/MacOS/{{APP_NAME}}";\
|
||||||
|
elif [[ "{{ARGS}}" == "x86_64" || "{{ARGS}}" == "x86" && -r target/x86_64-apple-darwin/release/{{APP_NAME}} ]] ; then \
|
||||||
|
cp {{'target/x86_64-apple-darwin/release/' + APP_NAME}} {{MACOS_ROOT_PATH + MACOS_APP_PATH + "/Contents/MacOS/" + APP_NAME}}; \
|
||||||
|
echo "\n{{BOLD + GREEN + INVERT}}target/x86_64-apple-darwin/release/{{APP_NAME}}{{NORMAL}} to Contets/MacOS/{{APP_NAME}}"; \
|
||||||
|
elif [[ -z "{{ARGS}}" || "{{ARGS}}" == "universal" && -r target/apple-darwin/release/{{APP_NAME}} ]]; then \
|
||||||
cp {{'target/apple-darwin/release/' + APP_NAME}} {{MACOS_ROOT_PATH + MACOS_APP_PATH + "/Contents/MacOS/" + APP_NAME}}; \
|
cp {{'target/apple-darwin/release/' + APP_NAME}} {{MACOS_ROOT_PATH + MACOS_APP_PATH + "/Contents/MacOS/" + APP_NAME}}; \
|
||||||
echo "\n{{BOLD + GREEN + INVERT}}target/apple-darwin/release/{{APP_NAME}}{{NORMAL}} to Contets/MacOS/{{APP_NAME}}";\
|
echo "\n{{BOLD + GREEN + INVERT}}target/apple-darwin/release/{{APP_NAME}}{{NORMAL}} to Contets/MacOS/{{APP_NAME}}";\
|
||||||
|
else \
|
||||||
|
echo "Arquitectura no válida: {{ARGS}}"; \
|
||||||
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
@cd {{justfile_directory()}} && if test -r {{RUN_SRC}} ; then \
|
@cd {{justfile_directory()}} && if test -r {{RUN_SRC}} ; then \
|
||||||
cat {{RUN_SRC}} | sed 's,:-\.,:-{{justfile_directory()}},g' |\
|
cat {{RUN_SRC}} | sed 's,:-\.,:-{{justfile_directory()}},g' |\
|
||||||
@ -89,10 +108,12 @@ make-app: buildall
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
[linux]
|
[linux]
|
||||||
make-app: buildall
|
make-app *ARGS:
|
||||||
|
@just buildall {{ARGS}}
|
||||||
|
|
||||||
[macos]
|
[macos]
|
||||||
package: make-app
|
package *ARGS:
|
||||||
|
@just make-app {{ARGS}}
|
||||||
@if test -r {{'/Volumes/' + APP_PACKAGE}} ; then \
|
@if test -r {{'/Volumes/' + APP_PACKAGE}} ; then \
|
||||||
hdiutil detach {{'/Volumes/' + APP_PACKAGE}}; \
|
hdiutil detach {{'/Volumes/' + APP_PACKAGE}}; \
|
||||||
fi
|
fi
|
||||||
@ -155,7 +176,8 @@ package: make-app
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
[linux]
|
[linux]
|
||||||
package:
|
package *ARGS:
|
||||||
|
@just make-app {{ARGS}}
|
||||||
@if test -r {{APP_PACKAGES_PATH + APP_PACKAGE}} ; then \
|
@if test -r {{APP_PACKAGES_PATH + APP_PACKAGE}} ; then \
|
||||||
rm -rf {{APP_PACKAGES_PATH + APP_PACKAGE}}; \
|
rm -rf {{APP_PACKAGES_PATH + APP_PACKAGE}}; \
|
||||||
fi
|
fi
|
||||||
@ -198,7 +220,8 @@ make-run:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
[linux]
|
[linux]
|
||||||
install: make-app
|
install *ARGS:
|
||||||
|
@just make-app {{ARGS}}
|
||||||
@echo "\nInstall {{BOLD + GREEN + INVERT}}{{BIN_APP_PATH}}{{NORMAL}}";
|
@echo "\nInstall {{BOLD + GREEN + INVERT}}{{BIN_APP_PATH}}{{NORMAL}}";
|
||||||
@cd {{justfile_directory()}} && if test -r target/{{APP_NAME}} ; then \
|
@cd {{justfile_directory()}} && if test -r target/{{APP_NAME}} ; then \
|
||||||
cp -p target/{{APP_NAME}} {{BIN_APP_PATH}};\
|
cp -p target/{{APP_NAME}} {{BIN_APP_PATH}};\
|
||||||
@ -206,7 +229,8 @@ install: make-app
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
[macos]
|
[macos]
|
||||||
install: make-app
|
install *ARGS:
|
||||||
|
@just make-app {{ARGS}}
|
||||||
@echo "\nInstall {{BOLD + GREEN + INVERT}}{{MACOS_APP_PATH}}{{NORMAL}}" >/tmp/i;
|
@echo "\nInstall {{BOLD + GREEN + INVERT}}{{MACOS_APP_PATH}}{{NORMAL}}" >/tmp/i;
|
||||||
@cd {{justfile_directory()}} && if test -r target/{{APP_NAME}} ; then \
|
@cd {{justfile_directory()}} && if test -r target/{{APP_NAME}} ; then \
|
||||||
cp -p target/{{APP_NAME}} {{BIN_APP_PATH}};\
|
cp -p target/{{APP_NAME}} {{BIN_APP_PATH}};\
|
||||||
@ -222,14 +246,14 @@ install: make-app
|
|||||||
fi
|
fi
|
||||||
@just make-run
|
@just make-run
|
||||||
|
|
||||||
test:
|
test *ARGS:
|
||||||
cargo t
|
cargo t {{ARGS}}
|
||||||
|
|
||||||
expand:
|
expand *ARGS:
|
||||||
cargo expand
|
cargo expand {{ARGS}}
|
||||||
|
|
||||||
benchmark:
|
benchmark *ARGS:
|
||||||
cargo bench
|
cargo bench {{ARGS}}
|
||||||
|
|
||||||
runtest:
|
runtest:
|
||||||
@cd {{justfile_directory()}} && if test -d "test/documents" ; then \
|
@cd {{justfile_directory()}} && if test -d "test/documents" ; then \
|
||||||
@ -239,14 +263,14 @@ runtest:
|
|||||||
./{{RUN_SRC}}; \
|
./{{RUN_SRC}}; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run:
|
run *ARGS:
|
||||||
cargo b -r
|
cargo b -r {{ARGS}}
|
||||||
|
|
||||||
fmt:
|
fmt *ARGS:
|
||||||
cargo +nightly fmt
|
cargo +nightly fmt {{ARGS}}
|
||||||
|
|
||||||
clean:
|
clean *ARGS:
|
||||||
cargo clean
|
cargo clean {{ARGS}}
|
||||||
|
|
||||||
doc:
|
doc *ARGS:
|
||||||
cargo doc --open --no-deps
|
cargo doc --open --no-deps {{ARGS}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user