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

Commit

Permalink
Merge pull request #591 from ficristo/linux-chrome-version-string
Browse files Browse the repository at this point in the history
Support AppGetChromeVersionString and AppGetProductVersionString on Linux
  • Loading branch information
ficristo authored Oct 28, 2016
2 parents d59fad4 + d36a06e commit 3f4dbd1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
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);
});
};

0 comments on commit 3f4dbd1

Please sign in to comment.