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

Commit db006c9

Browse files
authored
Merge pull request #624 from adobe/master
Merge master into release for Brackets 1.11
2 parents 21e602f + 7173fd2 commit db006c9

39 files changed

+918
-249
lines changed

Gruntfile.js

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
module.exports = function (grunt) {
2727
var common = require("./tasks/common")(grunt),
2828
platform = common.platform(),
29-
staging;
29+
staging,
30+
cef_version = "3.2623.1397";
3031

3132
if (platform === "mac") {
3233
staging = "installer/mac/staging/<%= build.name %>.app/Contents";
@@ -36,6 +37,10 @@ module.exports = function (grunt) {
3637
staging = "installer/linux/debian/package-root/opt/brackets";
3738
}
3839

40+
if (platform === "linux") {
41+
cef_version = "3.2704.1414";
42+
}
43+
3944
grunt.initConfig({
4045
"pkg": grunt.file.readJSON("package.json"),
4146
"config-json": staging + "/www/config.json",
@@ -58,6 +63,14 @@ module.exports = function (grunt) {
5863
"dest" : "<%= downloads %>",
5964
"src" : "http://nodejs.org/dist/v<%= node.version %>/node-v<%= node.version %>-linux-x64.tar.gz"
6065
},
66+
"icu-linux32": {
67+
"dest" : "<%= downloads %>",
68+
"src" : "<%= icu.url %>/icu_<%= icu.version %>_linux32_release.zip"
69+
},
70+
"icu-linux64": {
71+
"dest" : "<%= downloads %>",
72+
"src" : "<%= icu.url %>/icu_<%= icu.version %>_linux64_release.zip"
73+
},
6174
/* mac */
6275
"cef-mac": {
6376
"dest" : "<%= downloads %>",
@@ -91,6 +104,10 @@ module.exports = function (grunt) {
91104
"icu-win": {
92105
"dest" : "<%= downloads %>",
93106
"src" : "<%= icu.url %>/icu_<%= icu.version %>_windows32.zip"
107+
},
108+
"vs-crt-win": {
109+
"dest" : "<%= downloads %>",
110+
"src" : "<%= vsCrt.url %>/vs<%= vsCrt.version %>-crt-ia32.zip"
94111
}
95112
},
96113
"clean": {
@@ -123,6 +140,50 @@ module.exports = function (grunt) {
123140
"icuuc58.dll",
124141
"icuin58.dll",
125142
"icudt58.dll",
143+
"api-ms-win-core-console-l1-1-0.dll",
144+
"api-ms-win-core-handle-l1-1-0.dll",
145+
"api-ms-win-core-processenvironment-l1-1-0.dll",
146+
"api-ms-win-core-synch-l1-2-0.dll",
147+
"api-ms-win-crt-filesystem-l1-1-0.dll",
148+
"api-ms-win-crt-runtime-l1-1-0.dll",
149+
"vccorlib140.dll",
150+
"api-ms-win-core-datetime-l1-1-0.dll",
151+
"api-ms-win-core-heap-l1-1-0.dll",
152+
"api-ms-win-core-processthreads-l1-1-0.dll",
153+
"api-ms-win-core-sysinfo-l1-1-0.dll",
154+
"api-ms-win-crt-heap-l1-1-0.dll",
155+
"api-ms-win-crt-stdio-l1-1-0.dll",
156+
"vcruntime140.dll",
157+
"api-ms-win-core-debug-l1-1-0.dll",
158+
"api-ms-win-core-interlocked-l1-1-0.dll",
159+
"api-ms-win-core-processthreads-l1-1-1.dll",
160+
"api-ms-win-core-timezone-l1-1-0.dll",
161+
"api-ms-win-crt-locale-l1-1-0.dll",
162+
"api-ms-win-crt-string-l1-1-0.dll",
163+
"api-ms-win-core-errorhandling-l1-1-0.dll",
164+
"api-ms-win-core-libraryloader-l1-1-0.dll",
165+
"api-ms-win-core-profile-l1-1-0.dll",
166+
"api-ms-win-core-util-l1-1-0.dll",
167+
"api-ms-win-crt-math-l1-1-0.dll",
168+
"api-ms-win-crt-time-l1-1-0.dll",
169+
"api-ms-win-core-file-l1-1-0.dll",
170+
"api-ms-win-core-localization-l1-2-0.dll",
171+
"api-ms-win-core-rtlsupport-l1-1-0.dll",
172+
"api-ms-win-crt-conio-l1-1-0.dll",
173+
"api-ms-win-crt-multibyte-l1-1-0.dll",
174+
"api-ms-win-crt-utility-l1-1-0.dll",
175+
"api-ms-win-core-file-l1-2-0.dll",
176+
"api-ms-win-core-memory-l1-1-0.dll",
177+
"api-ms-win-core-string-l1-1-0.dll",
178+
"api-ms-win-crt-convert-l1-1-0.dll",
179+
"api-ms-win-crt-private-l1-1-0.dll",
180+
"msvcp140.dll",
181+
"api-ms-win-core-file-l2-1-0.dll",
182+
"api-ms-win-core-namedpipe-l1-1-0.dll",
183+
"api-ms-win-core-synch-l1-1-0.dll",
184+
"api-ms-win-crt-environment-l1-1-0.dll",
185+
"api-ms-win-crt-process-l1-1-0.dll",
186+
"ucrtbase.dll",
126187
"natives_blob.bin",
127188
"snapshot_blob.bin",
128189
"command/**"
@@ -171,7 +232,12 @@ module.exports = function (grunt) {
171232
"cef_100_percent.pak",
172233
"cef_200_percent.pak",
173234
"devtools_resources.pak",
235+
"cef_extensions.pak",
174236
"icudtl.dat",
237+
"libcef.so",
238+
"natives_blob.bin",
239+
"snapshot_blob.bin",
240+
"chrome-sandbox",
175241
],
176242
"dest" : "<%= build.staging %>"
177243
},
@@ -245,15 +311,19 @@ module.exports = function (grunt) {
245311
},
246312
"cef": {
247313
"url" : "http://s3.amazonaws.com/files.brackets.io/cef",
248-
"version" : "3.2623.1397"
314+
"version" : cef_version
249315
},
250316
"node": {
251-
"version" : "6.3.1"
317+
"version" : "6.11.0"
252318
},
253319
"icu": {
254320
"url" : "http://s3.amazonaws.com/files.brackets.io/icu",
255321
"version" : "58"
256-
}
322+
},
323+
"vsCrt": {
324+
"url" : "http://s3.amazonaws.com/files.brackets.io/vs-crt",
325+
"version" : "2015"
326+
},
257327
});
258328

259329
grunt.loadTasks("tasks");
@@ -263,4 +333,4 @@ module.exports = function (grunt) {
263333
grunt.loadNpmTasks("grunt-curl");
264334

265335
grunt.registerTask("default", ["setup", "build"]);
266-
};
336+
};

appshell.gyp

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,57 @@
177177
# Copy ICU dlls
178178
'destination': '<(PRODUCT_DIR)',
179179
'files': ['deps/icu/bin/icuuc58.dll', 'deps/icu/bin/icuin58.dll', 'deps/icu/bin/icudt58.dll'],
180-
}
180+
},
181+
{
182+
# Copy VS2015 CRT dlls
183+
'destination': '<(PRODUCT_DIR)',
184+
'files': [
185+
'deps/vs-crt/api-ms-win-core-console-l1-1-0.dll',
186+
'deps/vs-crt/api-ms-win-core-handle-l1-1-0.dll',
187+
'deps/vs-crt/api-ms-win-core-processenvironment-l1-1-0.dll',
188+
'deps/vs-crt/api-ms-win-core-synch-l1-2-0.dll',
189+
'deps/vs-crt/api-ms-win-crt-filesystem-l1-1-0.dll',
190+
'deps/vs-crt/api-ms-win-crt-runtime-l1-1-0.dll',
191+
'deps/vs-crt/vccorlib140.dll',
192+
'deps/vs-crt/api-ms-win-core-datetime-l1-1-0.dll',
193+
'deps/vs-crt/api-ms-win-core-heap-l1-1-0.dll',
194+
'deps/vs-crt/api-ms-win-core-processthreads-l1-1-0.dll',
195+
'deps/vs-crt/api-ms-win-core-sysinfo-l1-1-0.dll',
196+
'deps/vs-crt/api-ms-win-crt-heap-l1-1-0.dll',
197+
'deps/vs-crt/api-ms-win-crt-stdio-l1-1-0.dll',
198+
'deps/vs-crt/vcruntime140.dll',
199+
'deps/vs-crt/api-ms-win-core-debug-l1-1-0.dll',
200+
'deps/vs-crt/api-ms-win-core-interlocked-l1-1-0.dll',
201+
'deps/vs-crt/api-ms-win-core-processthreads-l1-1-1.dll',
202+
'deps/vs-crt/api-ms-win-core-timezone-l1-1-0.dll',
203+
'deps/vs-crt/api-ms-win-crt-locale-l1-1-0.dll',
204+
'deps/vs-crt/api-ms-win-crt-string-l1-1-0.dll',
205+
'deps/vs-crt/api-ms-win-core-errorhandling-l1-1-0.dll',
206+
'deps/vs-crt/api-ms-win-core-libraryloader-l1-1-0.dll',
207+
'deps/vs-crt/api-ms-win-core-profile-l1-1-0.dll',
208+
'deps/vs-crt/api-ms-win-core-util-l1-1-0.dll',
209+
'deps/vs-crt/api-ms-win-crt-math-l1-1-0.dll',
210+
'deps/vs-crt/api-ms-win-crt-time-l1-1-0.dll',
211+
'deps/vs-crt/api-ms-win-core-file-l1-1-0.dll',
212+
'deps/vs-crt/api-ms-win-core-localization-l1-2-0.dll',
213+
'deps/vs-crt/api-ms-win-core-rtlsupport-l1-1-0.dll',
214+
'deps/vs-crt/api-ms-win-crt-conio-l1-1-0.dll',
215+
'deps/vs-crt/api-ms-win-crt-multibyte-l1-1-0.dll',
216+
'deps/vs-crt/api-ms-win-crt-utility-l1-1-0.dll',
217+
'deps/vs-crt/api-ms-win-core-file-l1-2-0.dll',
218+
'deps/vs-crt/api-ms-win-core-memory-l1-1-0.dll',
219+
'deps/vs-crt/api-ms-win-core-string-l1-1-0.dll',
220+
'deps/vs-crt/api-ms-win-crt-convert-l1-1-0.dll',
221+
'deps/vs-crt/api-ms-win-crt-private-l1-1-0.dll',
222+
'deps/vs-crt/msvcp140.dll',
223+
'deps/vs-crt/api-ms-win-core-file-l2-1-0.dll',
224+
'deps/vs-crt/api-ms-win-core-namedpipe-l1-1-0.dll',
225+
'deps/vs-crt/api-ms-win-core-synch-l1-1-0.dll',
226+
'deps/vs-crt/api-ms-win-crt-environment-l1-1-0.dll',
227+
'deps/vs-crt/api-ms-win-crt-process-l1-1-0.dll',
228+
'deps/vs-crt/ucrtbase.dll',
229+
],
230+
},
181231
],
182232
}],
183233
[ 'OS=="win" and multi_threaded_dll', {
@@ -366,13 +416,19 @@
366416
],
367417
'link_settings': {
368418
'ldflags': [
419+
'-pthread',
369420
'-Wl,-rpath,\$$ORIGIN/',
370421
'<(march)'
371422
],
372423
'libraries': [
373424
"$(BUILDTYPE)/libcef.so",
374425
"-lX11",
375426
'appshell_extensions_js.o',
427+
'deps/icu/lib/libicuuc.a',
428+
'deps/icu/lib/libicuio.a',
429+
'deps/icu/lib/libicui18n.a',
430+
'deps/icu/lib/libicudata.a',
431+
'-ldl',
376432
],
377433
},
378434
'sources': [
@@ -572,4 +628,4 @@
572628
},
573629
}],
574630
],
575-
}
631+
}

appshell/appshell_extensions.cpp

Lines changed: 70 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
#include "appshell_node_process.h"
2929
#include "config.h"
3030

31+
#ifdef OS_LINUX
32+
#include "appshell/browser/main_context.h"
33+
#include "appshell/browser/root_window_manager.h"
34+
#endif
35+
3136
#include <algorithm>
3237

3338
extern std::vector<CefString> gDroppedFiles;
@@ -394,10 +399,15 @@ class ProcessMessageDelegate : public ClientHandler::ProcessMessageDelegate {
394399
CefWindowInfo wi;
395400
CefBrowserSettings settings;
396401

397-
#if defined(OS_WIN)
398-
wi.SetAsPopup(NULL, "DevTools");
399-
#endif
400-
browser->GetHost()->ShowDevTools(wi, browser->GetHost()->GetClient(), settings, CefPoint());
402+
#if defined(OS_WIN)
403+
wi.SetAsPopup(NULL, "DevTools");
404+
#elif defined(OS_LINUX)
405+
handler->ShowDevTools(browser, CefPoint());
406+
#endif
407+
408+
#ifndef OS_LINUX
409+
browser->GetHost()->ShowDevTools(wi, browser->GetHost()->GetClient(), settings, CefPoint());
410+
#endif
401411

402412
} else if (message_name == "GetNodeState") {
403413
// Parameters:
@@ -423,7 +433,15 @@ class ProcessMessageDelegate : public ClientHandler::ProcessMessageDelegate {
423433

424434
// The DispatchCloseToNextBrowser() call initiates a quit sequence. The app will
425435
// quit if all browser windows are closed.
426-
handler->DispatchCloseToNextBrowser();
436+
#ifdef OS_LINUX
437+
if(client::MainContext::Get() &&
438+
client::MainContext::Get()->GetRootWindowManager()){
439+
client::MainContext::Get()->GetRootWindowManager()->DispatchCloseToNextWindow();
440+
}
441+
#else
442+
handler->DispatchCloseToNextBrowser();
443+
#endif
444+
427445

428446
} else if (message_name == "AbortQuit") {
429447
// Parameters - none
@@ -765,8 +783,53 @@ class ProcessMessageDelegate : public ClientHandler::ProcessMessageDelegate {
765783
// 0: int32 - callback id
766784

767785
responseArgs->SetString(2, GetSystemUniqueID());
768-
}
769-
else {
786+
}
787+
else if (message_name == "ReadDirWithStats") {
788+
// Parameters:
789+
// 0: int32 - callback id
790+
791+
CefRefPtr<CefListValue> uberDict = CefListValue::Create();
792+
CefRefPtr<CefListValue> dirContents = CefListValue::Create();
793+
CefRefPtr<CefListValue> allStats = CefListValue::Create();
794+
795+
ExtensionString path = argList->GetString(1);
796+
ReadDir(path, dirContents);
797+
798+
// Now we iterator through the contents of directoryContents.
799+
size_t theSize = dirContents->GetSize();
800+
for ( size_t iFileEntry = 0; iFileEntry < theSize ; ++iFileEntry) {
801+
CefRefPtr<CefListValue> fileStats = CefListValue::Create();
802+
803+
#ifdef OS_WIN
804+
ExtensionString theFile = path + L"/";
805+
#else
806+
ExtensionString theFile = path + "/";
807+
#endif
808+
809+
ExtensionString fileName = dirContents->GetString(iFileEntry);
810+
theFile = theFile + fileName;
811+
812+
ExtensionString realPath;
813+
uint32 modtime;
814+
double size;
815+
bool isDir;
816+
GetFileInfo(theFile, modtime, isDir, size, realPath);
817+
818+
fileStats->SetInt(0, modtime);
819+
fileStats->SetBool(1, isDir);
820+
fileStats->SetInt(2, size);
821+
fileStats->SetString(3, realPath);
822+
823+
allStats->SetList(iFileEntry, fileStats);
824+
825+
}
826+
827+
uberDict->SetList(0, dirContents);
828+
uberDict->SetList(1, allStats);
829+
responseArgs->SetList(2, uberDict);
830+
}
831+
832+
else {
770833
fprintf(stderr, "Native function not implemented yet: %s\n", message_name.c_str());
771834
return false;
772835
}

appshell/appshell_extensions.js

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,50 @@ if (!appshell.app) {
326326
}, path);
327327
};
328328

329-
330-
329+
/**
330+
* Reads the contents of a directory and reports contents along with stats.
331+
*
332+
* @param {string} path The path of the directory to read.
333+
* @param {function(err, files)} callback Asynchronous callback function. The callback gets three arguments
334+
* (err, files, stats) where files is an array of the names of the files
335+
* in the directory excluding '.' and '..' and stats is an array of all stats of the files.
336+
* Possible error values:
337+
* NO_ERROR
338+
* ERR_UNKNOWN
339+
* ERR_INVALID_PARAMS
340+
* ERR_NOT_FOUND
341+
* ERR_CANT_READ
342+
*
343+
* @return None. This is an asynchronous call that sends all return information to the callback.
344+
*/
345+
// Test dictionary
346+
native function ReadDirWithStats();
347+
appshell.fs.readDirWithStats = function (path, callback){
348+
349+
ReadDirWithStats(function (err, allPaths){
350+
if (callback) {
351+
var finalArray = [];
352+
var allContents = allPaths[0];
353+
var allStats = allPaths[1];
354+
355+
allStats.forEach(function (val, idx) {
356+
finalArray[idx] = {
357+
isFile: function () {
358+
return !val[1];
359+
},
360+
isDirectory: function () {
361+
return val[1];
362+
},
363+
mtime: new Date(val[0] * 1000), // modtime is seconds since 1970, convert to ms
364+
size: new Number(val[2]),
365+
realPath: val[3] ? val[3] : null
366+
}
367+
});
368+
callback(err, allContents, finalArray);
369+
}
370+
}, path);
371+
};
372+
331373
/**
332374
* Quits native shell application
333375
*/

0 commit comments

Comments
 (0)