Files
cocoa/Taskfile.yml
Shin'ya Minazuki be35533f80 Build system version was made irrelevant
* As far as Make implementations go, only GNU Make and schilytools
  smake have ways to print their own versions, while every other
  implementation does not.

Signed-off-by: Shin'ya Minazuki <shinyoukai@laidback.moe>
2026-03-02 13:42:54 -03:00

65 lines
1.6 KiB
YAML

# Copyright (C) 2026 Cocoa Developers
# SPDX-License-Identifier: CDDL-1.0
# https://taskfile.dev
# NOTE: This does not appear to work at the moment
version: '3'
vars:
PROJECT_NAME: "Cocoa"
VERSION:
sh: git describe --tags
tasks:
backend:
desc: "Build backend for {{.PROJECT_NAME}}"
internal: true
cmds:
- go generate -tags "{{.TAGS}}" ./...
- go build -v -ldflags "-s -w -X main.Version={{.VERSION}} -X main.Tags={{.TAGS}}" -tags "{{.TAGS}}" -o cocoa
vars:
TAGS: "bindata"
build:
desc: "Build {{.PROJECT_NAME}}"
cmds:
- task: frontend
- task: backend
clean:
desc: "Clean up generated artifacts"
cmds:
- rm -f {{.EXE}}
- rm -f modules/migration/bindata.*
- rm -f modules/public/bindata.*
- rm -f modules/options/bindata.*
- rm -f modules/templates/bindata.*
vars:
EXE: cocoa
clean-all:
desc: "Remove everything (implies clean)"
cmds:
- task: clean
- rm -rf node_modules
- rm -rf public/assets/css
- rm -rf public/assets/fonts
- rm -rf public/assets/js
default:
cmds:
- task -l
silent: true
frontend:
desc: "Build frontend for {{.PROJECT_NAME}}"
internal: true
cmds:
- pnpm install --frozen-lockfile
- pnpm exec webpack --disable-interpret
env:
BROWSERSLIST_IGNORE_OLD_DATA: "true"
NODE_ENV: "production"
sources:
- web_src/css/*.css
- web_src/js/*.js
generates:
- public/assets/css/*.css
- public/assets/fonts/*
- public/assets/js/*.js