GithubHelp home page GithubHelp logo

niziul / zmake Goto Github PK

View Code? Open in Web Editor NEW

This project forked from melianmiko/zmake

0.0 0.0 0.0 2.4 MB

Unofficial ZeppOS build system, for Smart Band 7

Home Page: https://melianmiko.ru/en/zmake/

License: GNU General Public License v3.0

Shell 0.40% JavaScript 3.25% Python 95.33% Makefile 1.02%

zmake's Introduction

Icon ZMake

(aka. ZeppOS Make)

Unofficial ZeppOS build tool. This application was developed for community-driven watchface and application development for Xiaomi Smart Band 7. But you also can use it for any other ZeppOS-device, if want.

It can:

  • Convert PNG images into ZeppOS-specific TGA and back
  • Build JS code with esbuild and/or uglifyjs
  • Automatically generate preview, if zepp-preview is installed
  • Automatically build an installation-ready bin-file

Installation & Usage

Prebuild binaries can be downloaded here. Unpack downloaded ZIP somewhere. And that's all.

Windows and macOS users can run program via drag and drop. Just drag file to process to application icon.

Linux's users should call zmake from terminal. Open terminal in application folder and just run:

./zmake file_to_process

But in first of all, set encode_mode for your device. Different Amazfit devices has some differences in their graphic encoding formats. By default, ZMake is configured to work with Mi Band 7, but if you want to use them with other device, change encode_mode in zmake.json to match your device:

encode_mode Devices
dialog Mi Band 7, Amazfit Band 7, Amazfit GTS 4 Mini
nxp GTS 3/4, GTR 3/4, GTR 3 Pro, T-Rex 2/Ultra, Falcon
Not supported (MHS) GTR Mini

What they can do?

Action to be taken by application depends on what you give to the input.

You give... ZMake will...
App/watchface as bin-file unpack this file and convert all graphic assets into PNG. New folder appear near source bin-file
Empty directory generate new project template inside this folder. Type of project will be asked in prompt.
Unpacked app/watchface(directory with app.json inside) build your project, see action order bellow.
Any other files/directories try to convert them into PNG or ZeppOS TGA. Direction will be asked, if can't be detected automatically.

What actions will be performed when you attempt to build a project

  1. Convert all graphics to ZeppOS TGA
  2. If src dir exists, combine files into index.js
  3. If enabled, process all files in page/watchface dir via esbuild
  4. If enabled, process all files in page/watchface dir via uglifyjs
  5. If enabled, will create preview image via ZeppPlayer
  6. If enabled, will place smaller preview into assets dir
  7. If enabled, will upload result watchface to your phone via ADB |

Graphics processing

ZeppOS support images compressed in different ways. So, you can describe how zmake should process some images. When converting PNG to TGA, app selects compression method due to filename ending. There is a list of available compression options with some notices.

Name... Format Description
.p.png TGA-P Palette-encoded image. You can use any RGBA colors inside your image, but single image can't contain more than 256 different colors (one color with different transparency layer wasn't the same color). No specific compression will be applied. Final image filesize will be 64 + (count_of_colors * 4) + (width * height) bytes.
.rlp.png TGA-RLP Same as TGA-P, but also use per-line pixel compression. E.g. same pixels in one line will be written once. But images encoded in that way can't be rotated, so don't use this format for clock pointers.
.rgb.png TGA-16 16-bit RGB images, e.g. 5-6 bits per channel. Images in that format can't contain transparent parts. File size will be 64 + (2 * width * height) bytes.
.rgba.png TGA-32 Full 32-bit RGBA image, e.g. 8 bit for channel. No color limitations, but very big file size: 64 + (4 * width * height) bytes.

If you don't set compression format via filename, default will be used (TGA-P).

If some images have too much colors for TGA-RLP/TGA-P, they will be automatically quantized. Backup file will appear in backup directory near application.

Build from source code

Python 3.10+ with pip and venv is required.

Windows/linux

git clone https://github.com/melianmiko/zmake.git
cd zmake
python3 -m venv venv
pip3 install -r requirements.txt
python3 make_release.py

Result will appear in dist directory.

macOS

# Grab sources
git clone https://github.com/melianmiko/zmake.git
cd zmake

# Create and activate venv
python3.10 -m venv venv
source venv/bin/activate

# Install deps and build
pip install -r requirements.txt
python make_release.py

Result will appear in dist directory.

Donate

Look here.

License

zmake - Unofficial ZeppOS build tool
Copyright (C) 2022 MelianMiko <[email protected]>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

zmake's People

Contributors

melianmiko avatar mingaldrichgan avatar niziul avatar emircanerkul avatar arenasjuanf avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.