Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Support AppGetChromeVersionString and AppGetProductVersionString on Linux #591

Merged
merged 1 commit into from
Oct 28, 2016
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
14 changes: 10 additions & 4 deletions appshell/appshell_helpers_gtk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include "appshell/browser/resource.h"
#include "appshell/common/client_switches.h"
#include "appshell/version_linux.h"
#include "include/cef_base.h"
#include "include/cef_version.h"

Expand Down Expand Up @@ -114,13 +115,18 @@ CefString AppGetCachePath() {
}

CefString AppGetProductVersionString() {
// TODO
return CefString("");
std::string s = APP_NAME "/" APP_VERSION;
CefString ret;
ret.FromString(s);
return ret;
}

CefString AppGetChromiumVersionString() {
// TODO
return CefString("");
std::wostringstream versionStream(L"");
versionStream << L"Chrome/" << cef_version_info(2) << L"." << cef_version_info(3)
<< L"." << cef_version_info(4) << L"." << cef_version_info(5);

return CefString(versionStream.str());
}

char* AppInitWorkingDirectory() {
Expand Down
1 change: 1 addition & 0 deletions appshell/version_linux.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define APP_VERSION "1.9.0.0"
10 changes: 10 additions & 0 deletions tasks/set-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ module.exports = function (grunt) {
buildInstallerScriptPath = "installer/mac/buildInstaller.sh",
versionRcPath = "appshell/version.rc",
infoPlistPath = "appshell/mac/Info.plist",
linuxVersionFile = "appshell/version_linux.h",
release = grunt.option("release") || "",
text,
newVersion;
Expand Down Expand Up @@ -113,5 +114,14 @@ module.exports = function (grunt) {
"$1" + newVersion.version + "$3"
);
grunt.file.write(infoPlistPath, text);

// 6. Open appshell/version_linux.h and change `APP_VERSION`
text = grunt.file.read(linuxVersionFile);
text = safeReplace(
text,
/APP_VERSION "(\d+\.\d+\.\d+\.\d+)"/,
'APP_VERSION "' + newVersion.major + "." + newVersion.minor + "." + newVersion.patch + "." + (newVersion.build.length ? newVersion.build : "0") + '"'
);
grunt.file.write(linuxVersionFile, text);
});
};