From bf6ff0deb92abcf82570c1bf249b0e464ebaf9d0 Mon Sep 17 00:00:00 2001 From: shmyga Date: Fri, 30 Oct 2026 00:03:46 +0300 Subject: [PATCH] fix: fix default icon --- README.md | 24 +++++++----------------- example/haxetool.json | 6 +++--- src/core/config.ts | 5 ++++- src/impl/haxe.ts | 2 +- src/project/impl/packer/linux/deb.ts | 4 +--- 5 files changed, 16 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 9351ef4..4128050 100644 --- a/README.md +++ b/README.md @@ -51,23 +51,13 @@ JSON schema: https://shmyga.ru/public/haxetool.schema.json "app": { "buildSystem": "openfl", "platforms": ["flash", "html5", "linux", "windows", "android"], - "config": { - "meta": { - "title": "Example", - "filename": "example", - "icon": "./resources/icon.jpg", - "pack": "com.example", - "author": "Anonim ", - "company": "Any company" - }, - "libs": { - "lime": "8.3.2", - "openfl": "9.5.2", - "hxcpp": "4.3.2" - }, - "sources": ["src"], - "main": "Main" - } + "libs": { + "lime": "8.0.0", + "openfl": "9.2.0", + "hxcpp": "4.2.1" + }, + "sources": ["src"], + "main": "Main" } } ``` diff --git a/example/haxetool.json b/example/haxetool.json index 30291a4..705241d 100644 --- a/example/haxetool.json +++ b/example/haxetool.json @@ -3,9 +3,9 @@ "buildSystem": "openfl", "platforms": ["flash", "html5", "linux", "windows", "android"], "libs": { - "lime": "8.3.2", - "openfl": "9.5.2", - "hxcpp": "4.3.2" + "lime": "8.0.0", + "openfl": "9.2.0", + "hxcpp": "4.2.1" }, "sources": ["src"], "main": "Main" diff --git a/src/core/config.ts b/src/core/config.ts index 7701e9d..cccae16 100644 --- a/src/core/config.ts +++ b/src/core/config.ts @@ -1,7 +1,10 @@ import os from "os"; import path from "path"; +import asset from "../common/asset"; import { BuildSystem, type Config, type ConfigSource } from "./type"; +export const DEFAULT_ICON = asset("icon.jpg"); + export const DEFAULT_CONFIG: Config = { buildSystem: BuildSystem.HAXE, platforms: [], @@ -13,7 +16,7 @@ export const DEFAULT_CONFIG: Config = { libs: [], macros: [], flags: [], - icon: null, + icon: DEFAULT_ICON, meta: { width: 800, height: 600, diff --git a/src/impl/haxe.ts b/src/impl/haxe.ts index e371e90..a42ab3a 100755 --- a/src/impl/haxe.ts +++ b/src/impl/haxe.ts @@ -28,7 +28,7 @@ export class Haxe extends Sdk { static VERSION_4_0_5 = "4.0.5"; static VERSION_4_2_5 = "4.2.5"; static VERSION_4_3_7 = "4.3.7"; - static VERSION_4 = Haxe.VERSION_4_3_7; + static VERSION_4 = Haxe.VERSION_4_2_5; static VERSION = Haxe.VERSION_4; static buildDir = path.join(process.cwd(), "build"); diff --git a/src/project/impl/packer/linux/deb.ts b/src/project/impl/packer/linux/deb.ts index 3b5ad44..c5bedf9 100644 --- a/src/project/impl/packer/linux/deb.ts +++ b/src/project/impl/packer/linux/deb.ts @@ -4,14 +4,12 @@ import gulp from "gulp"; import deb from "gulp-debian"; import os from "os"; import path from "path"; -import asset from "../../../../common/asset"; import template from "../../../../common/template"; import { type Config, Platform } from "../../../../core/type"; import { Packer } from "../../../core/packer"; export class LinuxDEBPacker extends Packer { static NAME = "deb"; - static DEFAULT_ICON = asset("icon.jpg"); constructor(config: Config) { super(config, Platform.LINUX); @@ -20,7 +18,7 @@ export class LinuxDEBPacker extends Packer { call() { const target = this.targetPath; const buildDir = path.join(os.tmpdir(), "build", this.config.name, "debian"); - const icon = this.config.meta.icon || LinuxDEBPacker.DEFAULT_ICON; + const icon = this.config.meta.icon!; const iconfile = `${this.config.meta.filename}${path.extname(icon)}`; const desktop = template.render("linux/app.desktop", { iconfile: iconfile, ...this.config }); fse.ensureDirSync(`${buildDir}/usr/share/applications`);