Мы используем Makefile думая, что нет альтернатив, что это стандарт и всё такое.
Но make это не запускалка команд, а система сборки. Мы фактически используем его не по назначению.
И на самом деле альтернатива есть! Некоторое время назад я открыл для себя прекрасный инструмент - just. Он решает все проблемы make.
just - это не система сборки как make, это именно исполнитель команд!
Больше никаких Phony Targets и табуляций, привет нормальный синтаксис и передача аргументов!!! 😎
⭐️Что умеет just:
✅ Автодокументирование команд
Не нужно делать отдельную команду с докой, просто добавь комментарий
# команда сборки
build:
...
$ just --list
Available recipes:
build # команда сборки
Команда с именем default запускается по умолчанию если не указано другое, так что я обычно делаю так:
default:
just --list
Теперь просто выполняем just и получаем доку из текущего файла.
✅ Удобная работа с переменными окружения
# загрузить из .env
set dotenv-load
# глобальная переменная
export PYTHONPATH := "./src"
# переменная для команды
test $TESTUNG="true":
pytest
✅ Передача аргументов
build target:
@echo 'Build {{target}}...'
команда запуска
$ just build dev
# Build dev...
✅ Выбор интерпретатора прямо в команде
Пример с инлайн-скриптом на python:
system:
#!/usr/bin/env python3
import platform
print(platform.system())
Эта же функция позволит выполнить скрипт как одну команду вместо перезапуска шела для каждой строки
foo:
#!/usr/bin/env sh
for file in ls .; do
echo $file
done
✅ Выполнение команды в определенной директории. Можно указать как релятивный путь так и абсолютный
[working-directory: 'backend']
build:
docker compose build
Также можно задать рабочую директорию глобально
Там еще много интересного:
- поддержка функций
- автокомплиты и интеграции
- экспрешены
- алиасы команд
- группировка команд
- альтернативы команды под разные ОС
- импорт других just-файлов
- цветной вывод
- ... и другие штуковины!
Так что вперёд - ➡️ читать доку!
Репозиторий: ➡️https://github.com/casey/just
Статья: ➡️https://www.chicks.net/reference/file_formats/just/
ЗЫ. Кажется, на Makefile я уже не вернусь)
#tools
Microsoft Community Conference 2024 | Uzbekistan
Join us for a premier gathering of the Microsoft Developers Community in Uzbekistan! The annual Microsoft Community Conference is back and promises an unparalleled experience of innovation and technology. Mark your calendar for November 30, 2024, and get ready to immerse yourself in the latest advancements and ideas shaping the tech industry.
🎉 Highlights:
• Inspiring Keynote Presentations: Hear from leading tech innovators and industry experts.
• Interactive Workshops: Explore hands-on sessions with the latest Microsoft tools and technologies.
• Engaging Panel Discussions: Dive into trends and best practices shaping today’s tech landscape.
• Networking Opportunities: Connect with fellow developers, tech professionals, and enthusiasts.
📅 Date: November 30, 2024
📍 Location: Tashkent, Uzbekistan
Don’t miss out on this exciting opportunity to learn, network, and grow within a vibrant community. Whether you're a developer, tech professional, student, or simply passionate about technology, this is an event you won’t want to miss!
🔗 Register Now: https://mdcuzbekistan.com/register
Stay tuned for more updates and join us in shaping the future of technology in Uzbekistan!
#MDCConf2024#MicrosoftDevelopersCommunity#UzbekistanTech#TechConference#CommunityEvent
@mdcuzbekistan
Microsoft Community Conference 2024 | Uzbekistan
Join us for a premier gathering of the Microsoft Developers Community in Uzbekistan! The annual Microsoft Community Conference is back and promises an unparalleled experience of innovation and technology. Mark your calendar for November 30, 2024, and get ready to immerse yourself in the latest advancements and ideas shaping the tech industry.
🎉 Highlights:
• Inspiring Keynote Presentations: Hear from leading tech innovators and industry experts.
• Interactive Workshops: Explore hands-on sessions with the latest Microsoft tools and technologies.
• Engaging Panel Discussions: Dive into trends and best practices shaping today’s tech landscape.
• Networking Opportunities: Connect with fellow developers, tech professionals, and enthusiasts.
📅 Date: November 30, 2024
📍 Location: Tashkent, Uzbekistan
Don’t miss out on this exciting opportunity to learn, network, and grow within a vibrant community. Whether you're a developer, tech professional, student, or simply passionate about technology, this is an event you won’t want to miss!
🔗 Register Now: https://mdcuzbekistan.com/register
Stay tuned for more updates and join us in shaping the future of technology in Uzbekistan!
#MDCConf2024#MicrosoftDevelopersCommunity#UzbekistanTech#TechConference#CommunityEvent
@mdcuzbekistan
Exciting Announcement: The Tech Joined Us as a Media Partner!
We are proud to welcome The Tech as an official media partner of the MDC Uzbekistan. This partnership marks the beginning of an exciting collaboration to support all our initiatives, including hackathons, conferences, and other key events.
With The Tech’s support, we’re set to expand our reach and inspire even more developers across Central Asia. Together, we’ll continue building a stronger tech community!
#MicrosoftDevelopersCommunity#TheTech#MediaPartner#TechEvents#MicrosoftUzbekistan
@mdcuzbekistan