Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/lime/tools/MetaData.hx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ abstract MetaData({
@:optional var packageName:String;
@:optional var title:String;
@:optional var version:String;
@:optional var copyrightYears:String;
}) from Dynamic
{
@:noCompletion
Expand All @@ -21,6 +22,7 @@ abstract MetaData({
description: "",
packageName: "",
title: "",
version: ""
version: "",
copyrightYears: ""
};
}
4 changes: 2 additions & 2 deletions src/lime/tools/ProjectXMLParser.hx
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ class ProjectXMLParser extends HXProject
{
switch (attribute)
{
case "title", "description", "package", "version", "company", "company-id", "build-number", "company-url":
case "title", "description", "package", "version", "company", "company-id", "build-number", "company-url", "copyright-years":
var value = substitute(element.att.resolve(attribute));

defines.set("APP_" + StringTools.replace(attribute, "-", "_").toUpperCase(), value);
Expand Down Expand Up @@ -1738,7 +1738,7 @@ class ProjectXMLParser extends HXProject

case "gradle-version":
config.set("android.gradle-version", value);

case "gradle-plugin":
config.set("android.gradle-plugin", value);

Expand Down
33 changes: 33 additions & 0 deletions templates/windows/resource/ApplicationMain.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include "winres.h"

LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK

VS_VERSION_INFO VERSIONINFO
FILEVERSION ::VERSION_NUMBER::
PRODUCTVERSION ::VERSION_NUMBER::
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L

BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "::APP_COMPANY::"
VALUE "FileDescription", "::APP_DESCRIPTION::"
VALUE "FileVersion", "::FILE_VERSION::"
VALUE "InternalName", "::APP_FILE::"
VALUE "LegalCopyright", "Copyright (C) ::APP_COPYRIGHT_YEARS:: ::APP_COMPANY::"
VALUE "OriginalFilename", "::APP_FILE::"
VALUE "ProductName", "::APP_PACKAGE::"
VALUE "ProductVersion", "::FILE_VERSION::"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
36 changes: 32 additions & 4 deletions tools/platforms/WindowsPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,8 @@ class WindowsPlatform extends PlatformTarget
}
else
{
var haxeArgs = [hxml];
var flags = [];
var haxeArgs = [hxml, "-D", "resourceFile=ApplicationMain.rc"];
var flags = ["-DresourceFile=ApplicationMain.rc"];

if (is64)
{
Expand Down Expand Up @@ -679,6 +679,29 @@ class WindowsPlatform extends PlatformTarget
}
else
{
if (targetType == "cpp")
{
if (context.APP_DESCRIPTION == null || context.APP_DESCRIPTION == "")
{
context.APP_DESCRIPTION = project.meta.title;
}

if (context.APP_COPYRIGHT_YEARS == null || context.APP_COPYRIGHT_YEARS == "")
{
context.APP_COPYRIGHT_YEARS = Std.string(Date.now().getFullYear());
}

var versionParts = project.meta.version.split(".");

if (versionParts.length == 3)
{
versionParts.push("0");
}

context.FILE_VERSION = versionParts.join(".");
context.VERSION_NUMBER = versionParts.join(",");
}

context.NEKO_FILE = targetDirectory + "/obj/ApplicationMain.n";
context.NODE_FILE = targetDirectory + "/bin/ApplicationMain.js";
context.HL_FILE = targetDirectory + "/obj/ApplicationMain" + (project.defines.exists("hlc") ? ".c" : ".hl");
Expand Down Expand Up @@ -987,9 +1010,14 @@ class WindowsPlatform extends PlatformTarget
ProjectHelper.recursiveSmartCopyTemplate(project, "winrt/temp", targetDirectory + "/haxe/temp", context, false, true);
ProjectHelper.recursiveSmartCopyTemplate(project, "winrt/scripts", targetDirectory + "/scripts", context, true, true);
}
else if (targetType == "cpp" && project.targetFlags.exists("static"))
else if (targetType == "cpp")
{
ProjectHelper.recursiveSmartCopyTemplate(project, "cpp/static", targetDirectory + "/obj", context);
ProjectHelper.recursiveSmartCopyTemplate(project, "windows/resource", targetDirectory + "/obj", context);

if (project.targetFlags.exists("static"))
{
ProjectHelper.recursiveSmartCopyTemplate(project, "cpp/static", targetDirectory + "/obj", context);
}
}

/*if (IconHelper.createIcon (project.icons, 32, 32, Path.combine (applicationDirectory, "icon.png"))) {
Expand Down
Loading