Compare commits

..
3 Commits
Author SHA1 Message Date
Maxim Yaskevich 948a484ca5 set proper permissions on /user/share folders 2016-04-13 17:35:39 +03:00
Maxim Yaskevich cda3ee6bf9 added package icon files 2016-04-11 18:22:24 +03:00
Maxim Yaskevich 071e2132f1 added rpm package scenario 2016-04-08 18:06:23 +03:00
4912 changed files with 1005830 additions and 400044 deletions
-2
View File
@@ -96,5 +96,3 @@ Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
.vscode/settings.json
.vs/
-16
View File
@@ -1,16 +0,0 @@
os:
- linux
# - osx
# - windows
dist: xenial
sudo: require
language: cpp
script:
- bash bin/clean
- bash bin/configure
# - bash bin/build
# - bash bin/run-unit-tests
# end of file
+18 -282
View File
@@ -1,294 +1,30 @@
Download latest version:
https://robomongo.org/download
Robo 3T 1.4.4 (Aug/2021)
New Features:
- Support for Standard Connection String Format (Mongo URI)
Fixes:
- Fix Welcome Tab not loading the new content issue by disable/bypass HTTP cache
Robo 3T 1.4.3 (Jan/2021)
New Features:
- macOS Big Sur support
- New Welcome Tab - embeds Chromium using QtWebEngine (Windows, macOS only)
- Database explorer section has smaller default width (#1556)
- Remember size of database explorer section
- Import keys from old version: autoExpand, lineNumbers, debugMode and shellTimeoutSec
Fixes:
- Disable unsupported SSH tab for replica set connections (#1285 #1340)
- Fix crash when new shell tab executed in server unreachable case
- Fix crash when paging used in tabbed result window (#1661)
- Fix broken F2, F3, F4 shortcuts for tabbed result view
- One time re-order limit per new connections window to prevent data loss (macOS, #1790)
- Fix previously broken IPv6 support from command line: robo3t --ipv6
Robo 3T 1.4.2 (Oct/2020)
Fixes:
- Fix broken paging in DocumentDB (#1694)
Robo 3T 1.4.1 (Sep/2020)
Fixes:
- Force light mode on macOS (#1761, #1768, #1771)
- Fix broken macOS native theme/look (#1766)
- Fix broken Windows native theme/look
Robo 3T 1.4.0 (Aug/2020)
blog.robomongo.org/robo-3t-1-4/
New Features:
- Mongo shell 4.2 upgrade
- Support for Ubuntu 20.04 and macOS 10.15 (Catalina)
- SSH: ECDSA and Ed25519 keys support on Windows & macOS (#1719, #1530, #1590)
- Manually specify visible databases (#1696, #1368, #389)
Improvements:
- Qt Upgrade (v5.12.8 - Apr/2020, Windows & macOS only)
- OpenSSL upgrade (v1.1.1f - Mar/2020, Windows & macOS only)
- libssh2 upgrade (v1.9.0 - Jun/2019, Windows & macOS only)
Fixes:
- Authentication database option isn't used properly (#1696)
- Add/Edit index ops fixed (re-written) (#1692)
- Crash when expanding admin users (#1728)
- Unable to run query after shell timeout reached (#1529)
Robo 3T 1.3.1 (Apr, 2019)
http://blog.robomongo.org/robo-3t-1-3
New Features:
- Biggest change in this version is Mongo Shell version upgrade from 3.4 to 4.0.5.
- Support for importing from DNS SRV based MongoDB connection strings
- Query results windows now supports tabbed output #1591 #1403
- Adding support for SCRAM-SHA-256 auth mechanism #1569
- Support for Ubuntu 18.04 and Mac 10.14.
- Support for creating version 4 UUID #1554
Improvements:
- Encrypted passwords are used in config. file instead of clear text passwords
- Showing much better error reason string from Mongo drivers for connection failures
Fixes:
- Broken create/edit/view user features fixed and updated #638 #1041
- Attempt to fix #1547: Crash when right click on existing results plus a new long running query
- Fix for application crash when adding index with invalid JSON
- 'Repair Database' in Robo3T needs a confirm dialog box #1568
- Robo 3T the input space causes connection failure #1551
- Crash when loading results + right click #1547
- Attempt to fix major connection problems seen with the second edit/add/remove document operation after MongoDB 4.0 upgrade #1603
- Attempt to fix #1581: For CRUD ops showing progress bar and disabling context menu while waiting for edit op to finish
- Fixing UI issue where Functions folder freezing with "Functions..." when fails to refresh
- Fix for #1529: Pagination does not work when the aggregation queries have dotted fields
Robo 3T 1.3.0 Beta (16 Feb, 2019)
Details: https://github.com/Studio3T/robomongo/releases/tag/v1.3.0-beta
Robo 3T 1.2.1 (19 Feb, 2018)
http://blog.robomongo.org/robo-3t-1-2
Fixes:
- Aggregate query results are not pagaeble
- Big double numbers are showing incorrectly #1447
- Editing a document from a projection causes data loss (override) (#881)
- Error: Resources temporarily unavailable. Error when starting up SSH session: -8 #1426
- robo3t 1.1 failed to start on Ubuntu 17.04 #1385
- Robo 3T is not opening on MacOS High Sierra (#1412)
- Cannot load list of indexes #1454
- Robo 3T is not buildable on latest MacOS High Sierra
Improvements
- Qt version upgraded from Qt 5.7.0 to Qt 5.9.3
- Auto switch to HTTP from HTTPS if the program crashes due to HTTPS related operations
- Improvements for Robo 3T is crashing constantly on High Sierra #1412
- PR: Improved query time formatting (#1358) #1455
Robo 3T 1.2.0 Beta (18 Dec, 2017)
https://github.com/Studio3T/robomongo/releases/tag/v1.2.0-beta
Improvements & Fixes:
- Qt version upgraded from Qt 5.7.0 to Qt 5.9.3
- Fix for "Cannot load list of indexes #1454"
- Improvements for Robo 3T is crashing constantly on High Sierra #1412
- PR: Improved query time formatting (#1358) #1455
- Fix for "Robo 3T is not buildable on latest MacOS vesion High Sierra"
- Fix attempt for "Error: Resources temporarily unavailable. Error when starting up SSH session: -8 #1426"
- Fix for "robo3t 1.1 failed to start on Ubuntu 17.04 #1385"
Robo 3T 1.1 (13 June, 2017)
http://blog.robomongo.org/robomongo-1-1/
New Features:
- MongoDB 3.4 support
- New NumberDecimal (Decimal128) data type support
- ECMAScript 2015 aka ES6 Support (Modernized JavaScript Implementation)
- Re-naming from Robomongo to Robo 3T
Improvements & Fixes:
- Stability Improvements: Fix included to prevent a crash on MACOS Sierra
- Shell timeout is configurable on UI now 'Options->Change Shell Timeout'
- Fix for Robomongo Shell Timeout Issue (silently, prematurely finishing long lasting scripts)
- Security Improvements: OpenSSL version upgrade to openssl-1.0.1u (22-Sep-2016)
- Tool chain upgrades: Modern C++14 features are enabled and usable for developers
Robomongo 1.1 Beta (12 May, 2017)
https://github.com/Studio3T/robomongo/releases/tag/v1.1.0-beta
New Features:
- MongoDB 3.4 Support
- New NumberDecimal (Decimal128) data type support
- ECMAScript 2015 (Modernized JavaScript Implementation aka ES6) Support
Improvements:
- Security Improvements: OpenSSL version upgrade to openssl-1.0.1u (22-Sep-2016)
- Tool Chain Improvements: Modern C++14 features are enabled
Robomongo 1.0 (21 Apr, 2017)
http://blog.robomongo.org/robomongo-1-0
New Features:
- Update Notifications Bar
- Welcome Tab
- Welcome Wizard
Improvements:
- Replica set name configurable on UI
- Configuration file system location change
- "About Robomongo" dialog changes
Fixes:
- Fix to avoid the same set name problem (https://github.com/Studio3T/robomongo/issues/1302)
- Timestamp value is represented incorrectly (https://github.com/Studio3T/robomongo/issues/1159)
- Local Timezone shows wrong date (https://github.com/Studio3T/robomongo/issues/501)
- Time zone shown as "000:00" when UTC +00:00 is used as local timezone(https://github.com/Studio3T/robomongo/issues/1309)
Robomongo 1.0-RC1 (1 Feb, 2017)
http://blog.robomongo.org/robomongo-1-rc1/
New Features:
- Replica set support.
- New 'Attributes' column in connections list window showing connection properties such as 'Replica Set', 'SSL' and 'SSH'.
- New operation logging for almost all operations.
Improvements:
- Improved error handling (no double error windows) for all fail and success conditions for the following operations:
. Create, Drop Database
. Create, Edit User
. Create, Drop, Duplicate, Rename Collection
. Insert Document
. Remove document, Delete document, Remove all documents (triggered both from explorer and from result widget)
. Refresh Users
. Refresh Functions
. Refresh Collections
. Connection establish & refresh server fail and success cases.
- Windows size is saved and restored for Edit, View and Insert Document dialogs.
- Connections are automatically imported from the latest Robomongo version.
- Better error reporting/handling and logging have been added for the operations below:
. Create, Drop Function
. Drop User
- More informative and adjusted log level prefix strings haven added for log window. (Error, Warn, Info etc..).
- After a new connection is created, now the focus goes to the newly created connection (end of list) instead of the
beginning of connections list. And when Robomongo is opened, the focus goes to the end of the connection list instead
of beginning.
- Error messages added and error handling for 'remove document', 'remove all documents' operations triggered explorer
and single or multi 'delete document' from results window have been re-implemented and improved.
- Relevant errors are shown for the following cases now:
. Drop attempt of non-existing collection.
. Duplicating a collection with a collection name which already exists finishes silently.
Fixes:
- Fix for the problem where the connections list comes empty if the Robomongo config file or it's directory do not exist.
- Fix for the problem where 'in-progress bar' widget was not centered on main window for "Update Documents/Remove Documents"
operations. https://github.com/paralect/robomongo/issues/1256
- Fix for two problems where the operations 'insert or update documents' in one tab was causing auto reloading of other
unrelated tabs and also multiple error windows to popup. https://github.com/paralect/robomongo/issues/1236
- Fix for the problem where the operations 'remove document', 'remove all documents' triggered explorer and single or
multi 'delete document' from results window were causing auto reloading of other unrelated tabs.
Robomongo 0.9:
Major Features:
- Support for MongoDB 3.x and WiredTiger engine. Robomongo now embeds MongoDB 3.2 shell.
(Ability to use the latest shell functionality)
- SSH tunnel support for connections
- SSL support
- MongoDB Atlas (Cloud MongoDB) support
- Both MONGODB-CR and SCRAM-SHA-1 authentication mechanisms are supported.
- Allow direct connections to Replica Set members and support IPv6 protocol.
- Loading of huge list of collections is now faster.
- Create Collection dialog is now expandable to support all advanced options.
(Supporting all major mongoDB versions 3.2, 3.0, 2.6 and all storage engine types (WiredTiger
and MMAPV1) is added.)
- Windows High DPI support.
- Full size editor with dockable output window.
Fixed:
- Incorrect representation of floating-point numbers (fixed since RC3). This bug was a reason of a big number of issues:
#910, #748, #697, #699, #760, #815, #870, #892,
#894, #905, #945, #974, #978, #990, #831, #842
- SSH connection failure to servers on Ubuntu and OS X with the following error:
"Resource temporarily unavailable. Error when starting up SSH session: -8" (#1090)
What's new in 0.9.0 Final (30 Sep, 2016)
http://blog.robomongo.org/robomongo-0-9-0-final/
New Features:
- Full size editor with dockable output window.
- New JSON object context menu items: "Copy Name" and "Copy Path" are added.
- New database context menu items: "Current Operations" and "Kill Operation" are added.
- Minimize to Tray Icon for Windows.
Other Changes
- Cloud platforms Compose, mLab and Amazon EC2 were tested and added as supported platforms.
- Maximize/Restore result button behavior and icon have been improved.
- For better code quality and code reviews, Robomongo Code Quality and Robomongo Code Review pages have been created.
https://github.com/paralect/robomongo/wiki/Robomongo-Code-Review
https://github.com/paralect/robomongo/wiki/Robomongo-Code-Quality
0.9.0-RC6 / February 13, 2016
What's new in RC10 (Aug 8, 2016)
http://blog.robomongo.org/robomongo-rc10/
New Features:
- SSL connections with advanced options are now supported.
- MongoDB Atlas (Cloud MongoDB) is supported.
- Cross Platform High DPI enhancements.
Enhancements:
- For better security, OpenSSL has been upgraded to OpenSSL 1.0.1p.
- Qt has been updated from Qt 5.5 to latest Qt 5.7. With this update there are many
enhancements including cross platform High DPI support.
Most important changes: support for MongoDB 3.x and WiredTiger engine. Robomongo
now embeds MongoDB 3.2 shell. It means that you can now use the latest
shell functionality. Both MONGODB-CR and SCRAM-SHA-1 authentication mechanisms are
supprted. Also, we now allow direct connections to Replica Set members and
support IPv6 protocol. Loading of huge list of collections is now faster.
What's new in RC9 (May 30, 2016)
http://blog.robomongo.org/robomongo-rc9/
New Features:
- Create Collection dialog with advanced options.
- New feature has been added to save/restore window sizes. (#1102)
- Connection settings from previous versions of Robomongo are
now automatically imported starting from Robomongo 0.9.0 RC9. (#1086)
- Support for querying documents by UUIDs is added, both in legacy and new encoding. (#432)
Fixed:
- SSH connection failure to servers on Ubuntu and OS X with the following error:
"Resource temporarily unavailable. Error when starting up SSH session: -8" (#1090)
- Correct handling of create/drop of databases and collections. (#1083)
What's new in RC8 (April 14, 2016)
http://blog.robomongo.org/robomongo-rc8/
What's new in RC7 (March 4, 2016)
Fixed incorrect representation of floating-point numbers (fixed since RC3).
This bug was a reason of a big number of issues:
#910, #748, #697, #699, #760, #815, #870, #892,
#894, #905, #945, #974, #978, #990, #831, #842
What's new in RC7 (March 4, 2016 )
http://blog.robomongo.org/robomongo-rc7
What's new in RC6 (February 13, 2016)
What's new in RC6 (February 13, 2016 )
http://blog.robomongo.org/ipv6-protocol
What's new in RC5 (February 8, 2016)
What's new in RC5 (February 8, 2016 )
http://blog.robomongo.org/campaign-is-over-robomongo-is-not/
What's new in RC4 (February 1, 2016)
What's new in RC4 (February 1, 2016 )
http://blog.robomongo.org/robomongo-rc4
What's new in RC3 (January 29, 2016)
What's new in RC3 (January 29, 2016 )
http://blog.robomongo.org/robomongo-0-9-0-rc3-released
What's new in RC2 (January 26, 2016)
@@ -350,7 +86,7 @@ Robomongo 0.9:
* [Andres Kievsky]
- Added new app icon in a variety of png and iDraw formats (#693)
* [Michael Steinacher]
- Retina text display support (#724)
- Retina text display support (#724)
0.8.4 / November 27, 2013
+10 -35
View File
@@ -1,20 +1,16 @@
cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.0.0)
project(Robomongo)
# Where to look first for CMake modules, before "${CMAKE_ROOT}/Modules" is checked
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
# Project version
set(PROJECT_VERSION_MAJOR "1")
set(PROJECT_VERSION_MINOR "4")
set(PROJECT_VERSION_PATCH "4")
set(PROJECT_VERSION_BUILD "")
set(PROJECT_VERSION_MAJOR "0")
set(PROJECT_VERSION_MINOR "9")
set(PROJECT_VERSION_PATCH "0")
set(PROJECT_VERSION_BUILD "-RC8")
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${PROJECT_VERSION_BUILD}")
# Enable C++17 features
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Modules
include(RobomongoPrintUtils)
include(RobomongoCMakeDefaults)
@@ -31,41 +27,20 @@ find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5PrintSupport REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5Xml REQUIRED)
if(NOT SYSTEM_LINUX)
find_package(Qt5WebEngineWidgets REQUIRED)
endif()
find_package(MongoDB REQUIRED)
find_package(OpenSSL REQUIRED)
if (SYSTEM_MACOSX)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14)
find_package(Qt5MacExtras REQUIRED)
endif()
# Projects
set(LIBSSH2_VERSION 1.9.0)
if(SYSTEM_LINUX)
set(LIBSSH2_VERSION 1.7.0)
endif()
set(LIBSSH2_DIR src/third-party/libssh2-${LIBSSH2_VERSION})
set(QJSON_VERSION 0.8.1)
set(QJSON_DIR src/third-party/qjson-${QJSON_VERSION})
set(QSCINTILLA_VERSION 2.8.4)
set(QSCINTILLA_DIR src/third-party/qscintilla-${QSCINTILLA_VERSION})
set(ESPRIMA_VERSION 2.7.3)
set(ESPRIMA_DIR src/third-party/esprima-${ESPRIMA_VERSION})
# todo: Use equivalent vars from googletest cmake files. Currently they are somehow not working.
set(GOOGLE_TEST_VERSION 1.8.1)
set(GOOGLE_TEST_DIR src/third-party/googletest-${GOOGLE_TEST_VERSION})
add_subdirectory(${LIBSSH2_DIR})
add_subdirectory(src/third-party/openssl)
add_subdirectory(src/third-party/libssh2)
add_subdirectory(src/robomongo/ssh)
add_subdirectory(${QJSON_DIR})
add_subdirectory(${QSCINTILLA_DIR})
add_subdirectory(${GOOGLE_TEST_DIR})
add_subdirectory(src/third-party/qjson)
add_subdirectory(src/third-party/qscintilla)
add_subdirectory(src/robomongo)
add_subdirectory(src/robomongo-unit-tests)
# Show configuration summary
include(RobomongoConfigurationSummary)
+4 -4
View File
@@ -1,11 +1,11 @@
Robo 3T, shell-centric cross-platform MongoDB management tool.
Robomongo, shell-centric cross-platform MongoDB management tool.
Copyright 2014-2017 3T Software Labs Ltd.
Copyright 2013, Paralect.
The Robo 3T is released under the terms of the GNU General Public
The Robomongo is released under the terms of the GNU General Public
License, version 3.
The Robo 3T Project includes files written by third parties
The Robomongo Project includes files written by third parties
and used with permission or subject to their respective license
agreements.
+1 -1
View File
@@ -1,3 +1,3 @@
Robo 3T is a shell-centric cross-platform open source MongoDB management
Robomongo is a shell-centric cross-platform open source MongoDB management
tool (i.e. Admin GUI). Robomongo embeds the same JavaScript engine that
powers MongoDB's mongo shell.
+52 -103
View File
@@ -1,96 +1,67 @@
About Robo 3T
About Robomongo
===============
[Robo 3T](http://www.robomongo.org) (formerly Robomongo *) is a shell-centric cross-platform MongoDB management tool. Unlike most other MongoDB admin UI tools, Robo 3T embeds the actual `mongo` shell in a tabbed interface with access to a shell command line as well as GUI interaction.
[Robomongo](http://www.robomongo.org) is a shell-centric cross-platform MongoDB management tool. Unlike most other MongoDB admin UI tools, Robomongo embeds the actual `mongo` shell in a tabbed interface with access to a shell command line as well as GUI interaction.
The latest stable release **Robo 3T 1.4** embeds **MongoDB 4.2** shell.
Starting from version 0.9, Robomongo is compatibile with MongoDB 3.x (including SCRAM-SHA-1 auth and support for WiredTiger storage engine). Robomongo 0.9 embeds the **MongoDB 3.2** shell.
Blog: http://blog.robomongo.org/robo-3t-1-4/
Download: https://robomongo.org/download
All Releases: https://github.com/Studio3T/robomongo/releases
Watch: [Robo 3T Youtube channel](https://www.youtube.com/channel/UCM_7WAseRWeeiBikExppstA)
Follow: https://twitter.com/Robomongo
Robomongo 0.8.x embeds the **MongoDB 2.4.0** shell.
**Embedded MongoDB shell history:**
Robo 3T 1.4 -> MongoDB 4.2
Robo 3T 1.3 -> MongoDB 4.0
Robo 3T 1.1 -> MongoDB 3.4
Robo 3T 0.9 -> MongoDB 3.2
Robo 3T 0.8.x -> MongoDB 2.4.0
\* [Robomongo has been acquired by 3T](https://studio3t.com/press/3t-software-labs-acquires-robomongo-the-most-widely-used-mongodb-tool/)
Download
========
What's new in latest Robo 3T 1.4?
You can download tested install packages for OS X, Windows, and Linux from our site: [www.robomongo.org](http://www.robomongo.org).
The latest stable release is currently **Robomongo 0.8.5**.
Support
=======
Robomongo is an open source project driven by volunteers. We'll try to get to your questions as soon as we can, but please be patient :).
You can:
- [Create a new issue in the Github issue queue](https://github.com/paralect/robomongo/issues)
- [Join developer discussion on Gitter](https://gitter.im/paralect/robomongo) [![Join the chat at https://gitter.im/paralect/robomongo](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/paralect/robomongo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Build
=====
The wiki contains prerequisites and instructions to [Build Robomongo](https://github.com/paralect/robomongo/wiki/Build-Robomongo).
If you want to compile from source yourself, you should be able to do so cleanly from a [release branch](https://github.com/paralect/robomongo/releases).
What's Planned for the Next Release?
====================================
New Features:
- Mongo shell 4.2 upgrade
- Support for Ubuntu 20.04, macOS Big Sur and macOS 10.15 (Catalina)
- SSH: ECDSA and Ed25519 keys support on Windows & macOS (issues #1719, #1530, #1590)
- Manually specify visible databases (issues #1696, #1368, #389)
- New Welcome Tab - embeds Chromium using QtWebEngine (Windows, macOS only)
- Import keys from old version: autoExpand, lineNumbers, debugMode and shellTimeoutSec
Improvements:
- Qt Upgrade (v5.12.8 - Apr/2020, Windows & macOS only)
- OpenSSL upgrade (v1.1.1f - Mar/2020, Windows & macOS only)
- libssh2 upgrade (v1.9.0 - Jun/2019, Windows & macOS only)
- Database explorer section has smaller default width (#1556)
- Remember database explorer section size
Fixes:
- Fix previously broken IPv6 support from command line: robo3t --ipv6
- Fix crash when paging used in tabbed result window (#1661)
- Fix broken paging in DocumentDB (#1694)
- Authentication database option isn't used properly (#1696)
- Add/Edit index ops fixed (re-written) (#1692)
- Crash when expanding admin users (#1728)
- Unable to run query after shell timeout reached (#1529)
- Fix broken F2, F3, F4 shortcuts for tabbed result view
- One time re-order limit per new connections window to prevent data loss (macOS, #1790)
- Fix crash when new shell tab executed in server unreachable case
Supported Platforms
===============
Note: This sections is for Robo 3T and it directly depends on what MongoDB suppports
(See: https://docs.mongodb.com/manual/administration/production-notes/#prod-notes-supported-platforms)
| MongoDB Versions | MongoDB Cloud Platforms |
| :-------------------- | :-------------------- |
| 4.2 | Mongo Atlas |
| 4.0 |
| 3.6 |
| Windows | Mac | Linux |
|:---------------------- | :--------------------------------| :---------------------------|
| Windows 64-bit 10 | Mac OS X 11 (Big Sur) | Linux Ubuntu 20.04 64-bit |
Windows 64-bit 8.1 | Mac OS X 10.15 (Catalina) | Linux Ubuntu 18.04 64-bit |
| Windows 64-bit 7 | Mac OS X 10.14 (Mojave) | |
We are currently working toward a [0.9.0 release milestone](https://github.com/paralect/robomongo/milestones/Robomongo%200.9.0)
with some major features targeted including compatibility with MongoDB 3.0
(updated shell, SCRAM-SHA-1 auth, support for WiredTiger storage engine)
and full support for replica sets.
Contribute!
===========
### Vote for Features
Please view our [Magic Backlog](http://app.robomongo.org/backlog) to see features prioritised by donation. The small amount of donations we currently receive are put toward hosting costs.
### Suggest Features
New feature suggestions or UI improvements are always welcome.
This project is powered by open source volunteers, so we have a limited amount of development resource to address all requests. We will certainly make best efforts to progress (particularly for those with strong community upvotes).
### Code Contributions
See all docs here: https://github.com/Studio3T/robomongo/wiki
**Some important docs:**
- [Build Diagram](https://github.com/Studio3T/robomongo/wiki/Robo-3T-Schematics:-Build,-Class-and-UI-Diagrams#1-build-diagram)
- [Static Code Analysis](https://github.com/Studio3T/robomongo/wiki/Static-Code-Analysis)
- [Robo 3T Feature Specisification](https://github.com/Studio3T/robomongo/wiki/Feature-Spec)
- [Debugging](https://github.com/Studio3T/robomongo/blob/master/docs/Debug.md)
- [Schematics](https://github.com/Studio3T/robomongo/tree/master/schematics)
Code contributions are always welcome! Just try to follow our pre-commit checks and coding style:
- [Robo 3T Code Quality](https://github.com/paralect/robomongo/wiki/Robomongo-Code-Quality)
- [Robo 3T C++11/14 Transition Guide](https://github.com/Studio3T/robomongo/wiki/Robomongo-Cplusplus-11,-14-Transition-Guide)
- [Robo 3T Coding Style](https://github.com/paralect/robomongo/wiki/Robomongo-Coding-Style)
Code contributions are always welcome! Just try to follow our coding style: [Robomongo Coding Style](https://github.com/paralect/robomongo/wiki/Robomongo-Coding-Style).
If you plan to contribute, please create a Github issue (or comment on the relevant existing issue) so we can help coordinate with upcoming release plans.
For a general workflow, see Github's guide to [Fork a Repo](https://help.github.com/articles/fork-a-repo/).
Pull requests (PRs) should generally be for discrete issues (i.e. one issue per PR please) and be clean to merge against the current master branch. It would also be helpful if you can confirm what testing has been done (specific O/S targets and MongoDB versions if applicable).
A usual naming approach for feature branches is `issue-###`. Include the issue number in your commit message / pull request description to link the PR to the original issue.
@@ -98,41 +69,19 @@ A usual naming approach for feature branches is `issue-###`. Include the issue n
For example:
```#248: updated QScintilla to 2.4.8 for retina display support".```
### Design
There are some cosmetic issues we could use help with (designing images or UI). They are marked in the issue queue with a [`Cosmetic`](https://github.com/paralect/robomongo/labels/cosmetic) label. If you see an open issue that you'd like to contribute to, please feel free to volunteer by commenting on it.
### Testing
- [Unit-Tests](https://github.com/Studio3T/robomongo/wiki/Unit-Tests)
- [Manual Tests](wiki/Tests)
- See all docs here: https://github.com/Studio3T/robomongo/wiki
### Suggest Features
New feature suggestions or UI improvements are always welcome.
[Create a new feature request on github](https://github.com/paralect/robomongo/issues/new)
This project is powered by open source volunteers, so we have a limited amount of development resource to address all requests. We will certainly make best efforts to progress (particularly for those with strong community upvotes).
Download
========
You can download tested installer packages for macOS, Windows, and Linux from our site: [www.robomongo.org](http://www.robomongo.org).
Support
=======
Robo 3T is an open source project driven by volunteers. We'll try to get to your questions as soon as we can, but please be patient :).
You can:
- [Create a new issue in the Github issue queue](https://github.com/paralect/robomongo/issues)
- [Join developer discussion on Gitter](https://gitter.im/paralect/robomongo)
There are a number of issues we could use help with reproducing. They are marked in the issue queue with a [`Needs Repro`](https://github.com/paralect/robomongo/labels/needs%20repro) label. If you see an open issue that doesn't appear to be reproducible yet, please feel free to test and comment with your findings.
License
=======
Copyright 2014-2021 [3T Software Labs Ltd](https://studio3t.com/). All rights reserved.
Copyright (C) 2013-2015 [Paralect, Inc](http://www.paralect.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
-11
View File
@@ -3,8 +3,6 @@ Bash fronted for CMake
If you want to use this scripts, you need to set single environment variable:
E.g.:
export ROBOMONGO_CMAKE_PREFIX_PATH="/path/to/qt-5/5.5/gcc_64;/path/to/robomongo-shell"
Build Robomongo:
@@ -16,16 +14,7 @@ Install Robomongo:
$ bin/install
Run Robomongo:
$ bin/run
Pack Robomongo:
$ bin/pack
More:
- [Build Robo 3T - Mac OS X and Linux](https://github.com/paralect/robomongo/blob/master/docs/BuildRobo3TOnMacAndLinux.md)
- [Build Robo 3T - Windows](https://github.com/paralect/robomongo/blob/master/docs/BuildRobo3TOnWindows.md)
- [Unit Tests](wiki/Unit-Tests)
- [Static Code Analysis](wiki/Static-Code-Analysis)
+2 -2
View File
@@ -2,7 +2,7 @@
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1 # $1: release or debug
source $BIN_DIR/common/setup $1
cd $BUILD_DIR
cmake --build . "${@:2}" -- -j8
cmake --build . "${@:2}" -- -j8
-7
View File
@@ -1,7 +0,0 @@
#!/usr/bin/env bash
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/build || exit $?
source $BIN_DIR/run-tests $1
-15
View File
@@ -1,15 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem Path to bin and project folder
set BIN_DIR_WITH_BACKSLASH=%~dp0%
set BIN_DIR=%BIN_DIR_WITH_BACKSLASH:~0,-1%
set PROJECT_DIR=%BIN_DIR%\..
rem Run build
call "%BIN_DIR%\build.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run tests
call "%BIN_DIR%\run-tests.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
-5
View File
@@ -13,8 +13,3 @@ if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run build
cd "%BUILD_DIR%"
cmake --build . --config %BUILD_TYPE%
rem Install debug *.dll files
if "%BUILD_TYPE%" == "Debug" (
call "%BIN_DIR%\install-debug-dlls.bat" %*
)
-10
View File
@@ -1,10 +0,0 @@
bugprone-*
cert-*
clang-analyzer-*
cppcoreguidelines-*
concurrency-*
hicpp-*
llvm-*
misc-*
performance-*
readability-*
-4
View File
@@ -1,4 +0,0 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<EnableClangTidyCodeAnalysis>true</EnableClangTidyCodeAnalysis>
<ClangTidyChecks></ClangTidyChecks>
</PropertyGroup>
+20 -1
View File
@@ -27,4 +27,23 @@ PACK_PREFIX=$BUILD_DIR/package
PREFIX_PATH=$ROBOMONGO_CMAKE_PREFIX_PATH
mkdir -p $BUILD_DIR
mkdir -p $BUILD_DIR
if [ "$(uname -s)" == "Darwin" ]; then
# On Mac OS we specify minimal OS version that we support.
#
# The following environment variable will set "-mmacosx-version-min=10.6" option
# for compiler. From documentation to GCC or Clang:
#
# -mmacosx-version-min=version
#
# The earliest version of MacOS X that this executable will run on is
# version. Typical values of version include 10.1, 10.2, and 10.3.9.
#
# This value can also be set with the MACOSX_DEPLOYMENT_TARGET environment
# variable. If both the command-line option is specified and the
# environment variable is set, the command-line option will take precedence.
#
export MACOSX_DEPLOYMENT_TARGET=10.9
fi
+2 -3
View File
@@ -2,8 +2,7 @@
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1 # $1: release or debug
source $BIN_DIR/common/setup $1
cd $BUILD_DIR
# $BUILD_TYPE: Release or Debug
cmake -D "CMAKE_PREFIX_PATH=$PREFIX_PATH" -D "CMAKE_BUILD_TYPE=$BUILD_TYPE" -D "CMAKE_INSTALL_PREFIX=$INSTALL_PREFIX" "${@:2}" $PROJECT_DIR
cmake -D "CMAKE_PREFIX_PATH=$PREFIX_PATH" -D "CMAKE_BUILD_TYPE=$BUILD_TYPE" -D "CMAKE_INSTALL_PREFIX=$INSTALL_PREFIX" "${@:2}" $PROJECT_DIR
+1 -7
View File
@@ -11,11 +11,5 @@ call "%BIN_DIR%\common\setup.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run CMake configuration step
rem BUILD_TYPE: Release or Debug
cd "%BUILD_DIR%"
cmake -G "Visual Studio 15 2017 Win64" -D "CMAKE_PREFIX_PATH=%PREFIX_PATH%" -D "CMAKE_BUILD_TYPE=%BUILD_TYPE%" -D "CMAKE_INSTALL_PREFIX=%INSTALL_PREFIX%" %PROJECT_DIR%
@REM echo ___________________________________________________________________
@REM rem Enable Clang Tidy for Visual Studio 2019 IDE ...
@REM set ROBO_PROJ_FILE=%BUILD_DIR%/src/robomongo/robomongo.vcxproj
@REM python %BIN_DIR%\enable-visual-studio-clang-tidy.py %ROBO_PROJ_FILE% %BIN_DIR%
cmake -G "Visual Studio 12 2013 Win64" -D "CMAKE_PREFIX_PATH=%PREFIX_PATH%" -D "CMAKE_BUILD_TYPE=%BUILD_TYPE%" -D "CMAKE_INSTALL_PREFIX=%INSTALL_PREFIX%" %PROJECT_DIR%
-44
View File
@@ -1,44 +0,0 @@
import sys
from lxml import etree
print('\nEnabling Clang Tidy for Visual Studio 2019')
robo_proj_xml = sys.argv[1]
clang_tidy_xml = sys.argv[2] + '/clang-tidy.xml'
clang_checks_txt = sys.argv[2] + '/clang-checks.txt'
print(sys.argv[0] + ":\nProcessing: " + sys.argv[1])
## Read clang checks
clang_checks = None
with open(clang_checks_txt, "r") as file:
clang_checks = file.read().replace('\n', ',')
##
tree = etree.parse(robo_proj_xml)
ns = {'ns':'http://schemas.microsoft.com/developer/msbuild/2003'}
if(tree.find('//ns:EnableClangTidyCodeAnalysis', namespaces=ns) is not None):
tree.find('//ns:ClangTidyChecks', namespaces=ns).text = clang_checks
tree.write(robo_proj_xml)
print('Finished')
sys.exit()
## Append clang_tidy_xml - Todo: refactor using etree
with open(robo_proj_xml, "r") as in_file:
buf = in_file.readlines()
with open(clang_tidy_xml, "r") as in_file:
clang_tidy_xml_buf = in_file.read()
appended = False
with open(robo_proj_xml, "w") as out_file:
for line in buf:
if "</ItemGroup>" in line and appended == False:
line = line + clang_tidy_xml_buf
appended = True
out_file.write(line)
## Add clang checks
tree = etree.parse(robo_proj_xml)
tree.find('//ns:ClangTidyChecks', namespaces=ns).text = clang_checks
tree.write(robo_proj_xml)
print('Finished')
-54
View File
@@ -1,54 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem // This script installs debug *.dll files
rem -------------------------------------------
set INSTALL_DIR=%BUILD_DIR%\src\robomongo\Debug\
if not exist %INSTALL_DIR%*.dll (
echo ----------------------------------------
echo Installing debug *.dll files ...
echo INSTALL_DIR: %INSTALL_DIR%
echo ----------------------------------------
)
rem // Find OpenSSL and Qt paths
for %%i in (%ROBOMONGO_CMAKE_PREFIX_PATH%) do (
set xx=%%i
if not "!xx!"=="!xx:ssl=!" ( set OPENSSL_DIR=!xx! )
if not "!xx!"=="!xx:qt=!" ( set Qt_DIR=!xx! )
)
set OPENSSL_DIR=%OPENSSL_DIR: =%
set Qt_DIR=%Qt_DIR: =%
rem // Copy dll files
for /d %%a in (
"%VS140COMNTOOLS%\..\..\VC\redist\debug_nonredist\x64\Microsoft.VC140.DebugCRT\msvcp140d.dll"
"%VS140COMNTOOLS%\..\..\VC\redist\debug_nonredist\x64\Microsoft.VC140.DebugCRT\vcruntime140d.dll"
"%OPENSSL_DIR%\libssl-1_1-x64.dll"
"%OPENSSL_DIR%\libcrypto-1_1-x64.dll"
"%Qt_DIR%\bin\Qt5Cored.dll"
"%Qt_DIR%\bin\Qt5Guid.dll"
"%Qt_DIR%\bin\Qt5Networkd.dll"
"%Qt_DIR%\bin\Qt5Widgetsd.dll"
"%Qt_DIR%\bin\Qt5Positioningd.dll"
"%Qt_DIR%\bin\Qt5Qmld.dll"
"%Qt_DIR%\bin\Qt5Quickd.dll"
"%Qt_DIR%\bin\Qt5QuickWidgetsd.dll"
"%Qt_DIR%\bin\Qt5WebChanneld.dll"
"%Qt_DIR%\bin\Qt5WebEngineCored.dll"
"%Qt_DIR%\bin\Qt5WebEngineWidgetsd.dll"
"%Qt_DIR%\bin\Qt5PrintSupportd.dll"
) do (
if not exist !INSTALL_DIR!%%~NXa (
xcopy %%a !INSTALL_DIR! /d /y
)
)
if not exist %INSTALL_DIR%\imageformats\qgifd.dll (
xcopy /s "%Qt_DIR%\plugins\imageformats" %INSTALL_DIR%\imageformats\ /d /y
)
if not exist %INSTALL_DIR%\platforms\qminimald.dll (
xcopy /s "%Qt_DIR%\plugins\platforms" %INSTALL_DIR%\platforms\ /d /y
)
-6
View File
@@ -1,6 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
call "clean.bat" %*
call "configure.bat" %*
call "build.bat" %*
+4 -6
View File
@@ -4,11 +4,9 @@ BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get director
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1
echo "Note: ./install must be executed before this script."
if [ "$(uname -s)" == "Darwin" ]; then
echo "Starting $BUILD_DIR/install/Robo 3T.app/Contents/MacOS/Robo 3T"
"$BUILD_DIR/install/Robo 3T.app/Contents/MacOS/Robo 3T"
# On Mac OS we should run executable from bundle
"$BUILD_DIR/src/robomongo/Robomongo.app/Contents/MacOS/Robomongo"
else
echo "Starting $BUILD_DIR/install/bin/robo3t"
"$BUILD_DIR/install/bin/robo3t"
fi
"$BUILD_DIR/src/robomongo/robomongo"
fi
-33
View File
@@ -1,33 +0,0 @@
#!/usr/bin/env bash
### Common Setup
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1 # $1: release or debug
### Setup
CLANG_TIDY_BUILD_DIR=$PROJECT_DIR/build/clang-tidy-$BUILD_TYPE
rm -rf $CLANG_TIDY_BUILD_DIR
mkdir -p $CLANG_TIDY_BUILD_DIR && cd $CLANG_TIDY_BUILD_DIR
### Configure cmake
# Info: $BUILD_TYPE == Release or Debug
cmake -D "CMAKE_EXPORT_COMPILE_COMMANDS=ON" -D "CMAKE_PREFIX_PATH=$PREFIX_PATH" -D "CMAKE_BUILD_TYPE=$BUILD_TYPE" -D "CMAKE_INSTALL_PREFIX=$INSTALL_PREFIX" "${@:2}" $PROJECT_DIR
echo -e "\n------------------------------------------------"
echo "clang-tidy configured. Mode: $BUILD_TYPE"
echo -e "------------------------------------------------\n"
### Run clang-tidy
FILE_OR_PATH=/opt/robo/src/robomongo/ # or MainWindow.cpp
CHECKS=clang-analyzer-*,readability-implicit-bool-conversion
# All Checks: https://clang.llvm.org/extra/clang-tidy/checks/list.html
# e.g. $BIN_DIR/run-clang-tidy.py -checks=clang-analyzer-*,readability-implicit-bool-conversion /opt/robo/src/robomongo/
$BIN_DIR/run-clang-tidy.py -checks=$CHECKS $FILE_OR_PATH
echo -e "\n------------------------------------------------"
echo "clang-tidy finished"
echo "Mode : $BUILD_TYPE"
echo "CLANG_TIDY_BUILD_DIR: $CLANG_TIDY_BUILD_DIR"
echo "Command executed : $BIN_DIR/run-clang-tidy.py -checks=$CHECKS $FILE_OR_PATH"
echo -e "------------------------------------------------\n"
-326
View File
@@ -1,326 +0,0 @@
#!/usr/bin/env python
#
#===- run-clang-tidy.py - Parallel clang-tidy runner ---------*- python -*--===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===------------------------------------------------------------------------===#
# FIXME: Integrate with clang-tidy-diff.py
"""
Parallel clang-tidy runner
==========================
Runs clang-tidy over all files in a compilation database. Requires clang-tidy
and clang-apply-replacements in $PATH.
Example invocations.
- Run clang-tidy on all files in the current working directory with a default
set of checks and show warnings in the cpp files and all project headers.
run-clang-tidy.py $PWD
- Fix all header guards.
run-clang-tidy.py -fix -checks=-*,llvm-header-guard
- Fix all header guards included from clang-tidy and header guards
for clang-tidy headers.
run-clang-tidy.py -fix -checks=-*,llvm-header-guard extra/clang-tidy \
-header-filter=extra/clang-tidy
Compilation database setup:
http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html
"""
from __future__ import print_function
import argparse
import glob
import json
import multiprocessing
import os
import re
import shutil
import subprocess
import sys
import tempfile
import threading
import traceback
try:
import yaml
except ImportError:
yaml = None
is_py2 = sys.version[0] == '2'
if is_py2:
import Queue as queue
else:
import queue as queue
def find_compilation_database(path):
"""Adjusts the directory until a compilation database is found."""
result = './'
while not os.path.isfile(os.path.join(result, path)):
if os.path.realpath(result) == '/':
print('Error: could not find compilation database.')
sys.exit(1)
result += '../'
return os.path.realpath(result)
def make_absolute(f, directory):
if os.path.isabs(f):
return f
return os.path.normpath(os.path.join(directory, f))
def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path,
header_filter, extra_arg, extra_arg_before, quiet,
config):
"""Gets a command line for clang-tidy."""
start = [clang_tidy_binary]
if header_filter is not None:
start.append('-header-filter=' + header_filter)
if checks:
start.append('-checks=' + checks)
if tmpdir is not None:
start.append('-export-fixes')
# Get a temporary file. We immediately close the handle so clang-tidy can
# overwrite it.
(handle, name) = tempfile.mkstemp(suffix='.yaml', dir=tmpdir)
os.close(handle)
start.append(name)
for arg in extra_arg:
start.append('-extra-arg=%s' % arg)
for arg in extra_arg_before:
start.append('-extra-arg-before=%s' % arg)
start.append('-p=' + build_path)
if quiet:
start.append('-quiet')
if config:
start.append('-config=' + config)
start.append(f)
return start
def merge_replacement_files(tmpdir, mergefile):
"""Merge all replacement files in a directory into a single file"""
# The fixes suggested by clang-tidy >= 4.0.0 are given under
# the top level key 'Diagnostics' in the output yaml files
mergekey="Diagnostics"
merged=[]
for replacefile in glob.iglob(os.path.join(tmpdir, '*.yaml')):
content = yaml.safe_load(open(replacefile, 'r'))
if not content:
continue # Skip empty files.
merged.extend(content.get(mergekey, []))
if merged:
# MainSourceFile: The key is required by the definition inside
# include/clang/Tooling/ReplacementsYaml.h, but the value
# is actually never used inside clang-apply-replacements,
# so we set it to '' here.
output = { 'MainSourceFile': '', mergekey: merged }
with open(mergefile, 'w') as out:
yaml.safe_dump(output, out)
else:
# Empty the file:
open(mergefile, 'w').close()
def check_clang_apply_replacements_binary(args):
"""Checks if invoking supplied clang-apply-replacements binary works."""
try:
subprocess.check_call([args.clang_apply_replacements_binary, '--version'])
except:
print('Unable to run clang-apply-replacements. Is clang-apply-replacements '
'binary correctly specified?', file=sys.stderr)
traceback.print_exc()
sys.exit(1)
def apply_fixes(args, tmpdir):
"""Calls clang-apply-fixes on a given directory."""
invocation = [args.clang_apply_replacements_binary]
if args.format:
invocation.append('-format')
if args.style:
invocation.append('-style=' + args.style)
invocation.append(tmpdir)
subprocess.call(invocation)
def run_tidy(args, tmpdir, build_path, queue, lock, failed_files):
"""Takes filenames out of queue and runs clang-tidy on them."""
while True:
name = queue.get()
invocation = get_tidy_invocation(name, args.clang_tidy_binary, args.checks,
tmpdir, build_path, args.header_filter,
args.extra_arg, args.extra_arg_before,
args.quiet, args.config)
proc = subprocess.Popen(invocation, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, err = proc.communicate()
if proc.returncode != 0:
failed_files.append(name)
with lock:
sys.stdout.write(' '.join(invocation) + '\n' + output.decode('utf-8'))
if len(err) > 0:
sys.stdout.flush()
sys.stderr.write(err.decode('utf-8'))
queue.task_done()
def main():
parser = argparse.ArgumentParser(description='Runs clang-tidy over all files '
'in a compilation database. Requires '
'clang-tidy and clang-apply-replacements in '
'$PATH.')
parser.add_argument('-clang-tidy-binary', metavar='PATH',
default='clang-tidy',
help='path to clang-tidy binary')
parser.add_argument('-clang-apply-replacements-binary', metavar='PATH',
default='clang-apply-replacements',
help='path to clang-apply-replacements binary')
parser.add_argument('-checks', default=None,
help='checks filter, when not specified, use clang-tidy '
'default')
parser.add_argument('-config', default=None,
help='Specifies a configuration in YAML/JSON format: '
' -config="{Checks: \'*\', '
' CheckOptions: [{key: x, '
' value: y}]}" '
'When the value is empty, clang-tidy will '
'attempt to find a file named .clang-tidy for '
'each source file in its parent directories.')
parser.add_argument('-header-filter', default=None,
help='regular expression matching the names of the '
'headers to output diagnostics from. Diagnostics from '
'the main file of each translation unit are always '
'displayed.')
if yaml:
parser.add_argument('-export-fixes', metavar='filename', dest='export_fixes',
help='Create a yaml file to store suggested fixes in, '
'which can be applied with clang-apply-replacements.')
parser.add_argument('-j', type=int, default=0,
help='number of tidy instances to be run in parallel.')
parser.add_argument('files', nargs='*', default=['.*'],
help='files to be processed (regex on path)')
parser.add_argument('-fix', action='store_true', help='apply fix-its')
parser.add_argument('-format', action='store_true', help='Reformat code '
'after applying fixes')
parser.add_argument('-style', default='file', help='The style of reformat '
'code after applying fixes')
parser.add_argument('-p', dest='build_path',
help='Path used to read a compile command database.')
parser.add_argument('-extra-arg', dest='extra_arg',
action='append', default=[],
help='Additional argument to append to the compiler '
'command line.')
parser.add_argument('-extra-arg-before', dest='extra_arg_before',
action='append', default=[],
help='Additional argument to prepend to the compiler '
'command line.')
parser.add_argument('-quiet', action='store_true',
help='Run clang-tidy in quiet mode')
args = parser.parse_args()
db_path = 'compile_commands.json'
if args.build_path is not None:
build_path = args.build_path
else:
# Find our database
build_path = find_compilation_database(db_path)
try:
invocation = [args.clang_tidy_binary, '-list-checks']
invocation.append('-p=' + build_path)
if args.checks:
invocation.append('-checks=' + args.checks)
invocation.append('-')
if args.quiet:
# Even with -quiet we still want to check if we can call clang-tidy.
with open(os.devnull, 'w') as dev_null:
subprocess.check_call(invocation, stdout=dev_null)
else:
subprocess.check_call(invocation)
except:
print("Unable to run clang-tidy.", file=sys.stderr)
sys.exit(1)
# Load the database and extract all files.
database = json.load(open(os.path.join(build_path, db_path)))
files = [make_absolute(entry['file'], entry['directory'])
for entry in database]
max_task = args.j
if max_task == 0:
max_task = multiprocessing.cpu_count()
tmpdir = None
if args.fix or (yaml and args.export_fixes):
check_clang_apply_replacements_binary(args)
tmpdir = tempfile.mkdtemp()
# Build up a big regexy filter from all command line arguments.
file_name_re = re.compile('|'.join(args.files))
return_code = 0
try:
# Spin up a bunch of tidy-launching threads.
task_queue = queue.Queue(max_task)
# List of files with a non-zero return code.
failed_files = []
lock = threading.Lock()
for _ in range(max_task):
t = threading.Thread(target=run_tidy,
args=(args, tmpdir, build_path, task_queue, lock, failed_files))
t.daemon = True
t.start()
# Fill the queue with files.
for name in files:
if file_name_re.search(name):
task_queue.put(name)
# Wait for all threads to be done.
task_queue.join()
if len(failed_files):
return_code = 1
except KeyboardInterrupt:
# This is a sad hack. Unfortunately subprocess goes
# bonkers with ctrl-c and we start forking merrily.
print('\nCtrl-C detected, goodbye.')
if tmpdir:
shutil.rmtree(tmpdir)
os.kill(0, 9)
if yaml and args.export_fixes:
print('Writing fixes to ' + args.export_fixes + ' ...')
try:
merge_replacement_files(tmpdir, args.export_fixes)
except:
print('Error exporting fixes.\n', file=sys.stderr)
traceback.print_exc()
return_code=1
if args.fix:
print('Applying fixes ...')
try:
apply_fixes(args, tmpdir)
except:
print('Error applying fixes.\n', file=sys.stderr)
traceback.print_exc()
return_code=1
if tmpdir:
shutil.rmtree(tmpdir)
sys.exit(return_code)
if __name__ == '__main__':
main()
-22
View File
@@ -1,22 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
set CPP_VER=c++17
set FILE_OR_DIR=..\src\robomongo\
set PARAM_1=%1
if not "%PARAM_1%" == "" (
set FILE_OR_DIR=%PARAM_1%
)
rem Run analysis
echo.
echo ---------------------- Running cppcheck ----------------------
echo.
call cppcheck %FILE_OR_DIR% --enable=all --std=%CPP_VER%
echo.
echo ---------------------- End of cppcheck ----------------------
echo.
echo ---------------------- Info ----------------------
call cppcheck --version
echo Command called: cppcheck %FILE_OR_DIR% --enable=all --std=%CPP_VER%
-17
View File
@@ -1,17 +0,0 @@
#!/usr/bin/env bash
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1 # $1: release or debug
mkdir -p ../scan-build && cd ../scan-build
# $BUILD_TYPE: Release or Debug
# Hint: Use "--use-analyzer /usr/local/opt/llvm/bin/clang++" after "-v"
scan-build -v cmake -D "CMAKE_PREFIX_PATH=$PREFIX_PATH" -D "CMAKE_BUILD_TYPE=$BUILD_TYPE" -D "CMAKE_INSTALL_PREFIX=$INSTALL_PREFIX" "${@:2}" $PROJECT_DIR
echo -e "\n------------------------------------------------"
echo "Configured with scan-build in $BUILD_TYPE mode"
echo -e "------------------------------------------------\n"
scan-build cmake --build . "${@:2}" -- -j8
echo -e "\n------------------------------------------------"
echo "Built with scan-build in $BUILD_TYPE mode"
echo -e "------------------------------------------------\n"
-21
View File
@@ -1,21 +0,0 @@
#!/usr/bin/env bash
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1
echo
echo "******************* Running unit tests in $BUILD_TYPE mode *******************"
echo
if [ "$(uname -s)" == "Darwin" ]; then
EXE="$BUILD_DIR/src/robomongo-unit-tests/robo_unit_tests"
echo "Running file: $EXE"
"$EXE"
else # Linux
echo "Error: Currently unit testing is disabled for Linux due to MongoDB linking problem"
exit 0
EXE="$BUILD_DIR/src/robomongo-unit-tests/robo_unit_tests"
echo "Running file: $EXE"
"$EXE"
fi
-20
View File
@@ -1,20 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem Path to bin and project folder
set BIN_DIR_WITH_BACKSLASH=%~dp0%
set BIN_DIR=%BIN_DIR_WITH_BACKSLASH:~0,-1%
set PROJECT_DIR=%BIN_DIR%\..
rem Run common setup code
call "%BIN_DIR%\common\setup.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run tests
echo.
echo ******************* Running unit tests *******************
echo Mode: %BUILD_TYPE%
set TEST_EXE_DIR=%PROJECT_DIR%\\build\%BUILD_TYPE%\src\robomongo-unit-tests\%BUILD_TYPE%
echo Run : %TEST_EXE_DIR%\robo_unit_tests.exe
echo.
call "%TEST_EXE_DIR%\robo_unit_tests.exe" %*
-29
View File
@@ -1,29 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem Path to bin and project folder
set BIN_DIR_WITH_BACKSLASH=%~dp0%
set BIN_DIR=%BIN_DIR_WITH_BACKSLASH:~0,-1%
set PROJECT_DIR=%BIN_DIR%\..
rem Run common setup code
call "%BIN_DIR%\common\setup.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run Visual Studio with RunCodeAnalysis
cd "%BUILD_DIR%"
set RULE_SET="/p:CodeAnalysisRuleSet=NativeRecommendedRules.ruleset"
set OUT_FILE=vs-code-analysis-%BUILD_TYPE%.txt
echo ------------- Running Visual Studio with RunCodeAnalysis -------------
echo Result will be written into file "%OUT_FILE%" in the end.
echo ...
cmake --build . --config %BUILD_TYPE% -- "/p:RunCodeAnalysis=true" %RULE_SET% > %BIN_DIR%\%OUT_FILE%
rem Rules: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets
rem https://docs.microsoft.com/en-us/visualstudio/code-quality/rule-set-reference?view=vs-2019
echo ------------- End of RunCodeAnalysis -------------
echo.
echo ------------- Info -------------
echo Mode : %BUILD_TYPE%
echo RULE_SET: %RULE_SET% (see the script comments for more info)
-42
View File
@@ -1,42 +0,0 @@
import os
from os.path import join
###
def force_warning_level_3(file):
with open(file, "r") as in_file:
buf = in_file.readlines()
push = '#pragma warning(push, 3)\n'
pop = '#pragma warning(pop)\n'
last_line_has_mongo = False
with open(file, "w") as out_file:
for line in buf:
if line.startswith(('#include <mongo', '#include "mongo')):
if last_line_has_mongo:
pass # line = line + pop
else:
line = push + line
last_line_has_mongo = True
else:
if last_line_has_mongo:
line = pop + line
last_line_has_mongo = False
out_file.write(line)
### main
root_dir = 'E:\\robo\\src\\robomongo\\'
# root_dir = 'E:\\robo\\src\\robomongo\\shell\\bson\\' # for testing
print('Processing all source files in root & sub directories...')
print('Root Dir:', root_dir)
print('---------------------------------------------------------')
for path, subdirs, files in os.walk(root_dir):
for name in files:
if name.endswith(('.h', '.cpp')):
file = os.path.join(path, name)
print(file)
force_warning_level_3(file)
-20
View File
@@ -1,20 +0,0 @@
#!/usr/bin/env bash
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
VERSION="$(echo $1 | tr '[A-Z]' '[a-z]')"
if [ -z "$VERSION" ]; then
echo "Usage: tag <name>"
echo "Example: tag 0.9.0-rc9"
exit
fi
if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then
echo "Error: You are not on master branch"
exit
fi
cd $PROJECT_DIR
git tag -a "v${VERSION}" -m "${VERSION}"
git push --tags
+11 -38
View File
@@ -41,46 +41,38 @@ set(MongoDB_DEFINITIONS
BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS
BOOST_THREAD_HAS_BUG
MONGO_CONFIG_HAVE_HEADER_UNISTD_H
# Suppress "warning C4996: std::allocator..." from third_party\abseil-cpp-master
_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING
# Suppress "warning C4996: std::iterator..." from third_party\mozjs-60
_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING
)
# Set common compiler include directories
set(MOZJS_VER mozjs-60)
set(MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src
${MongoDB_DIR}/src/third_party/abseil-cpp-master/abseil-cpp
${MongoDB_DIR}/src/third_party/boost-1.70.0
${MongoDB_DIR}/src/third_party/fmt/dist/include
${MongoDB_DIR}/src/third_party/${MOZJS_VER}/include
${MongoDB_DIR}/src/third_party/${MOZJS_VER}/mongo_sources
${MongoDB_DIR}/src/third_party/pcre-8.42
${MongoDB_DIR}/src/third_party/SafeInt
${MongoDB_DIR}/src
${MongoDB_DIR}/src/third_party/boost-1.56.0
${MongoDB_DIR}/src/third_party/mozjs-38/include
${MongoDB_DIR}/src/third_party/mozjs-38/mongo_sources
${MongoDB_DIR}/src/third_party/pcre-8.37
${MongoDB_BUILD_DIR}
)
if(SYSTEM_LINUX)
set(MongoDB_OBJECT_LIST_PLATFORM_PART linux)
list(APPEND MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src/third_party/${MOZJS_VER}/platform/x86_64/linux/include)
${MongoDB_DIR}/src/third_party/mozjs-38/platform/x86_64/linux/include)
elseif(SYSTEM_WINDOWS)
set(MongoDB_OBJECT_LIST_PLATFORM_PART windows)
list(APPEND MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src/third_party/${MOZJS_VER}/platform/x86_64/windows/include)
${MongoDB_DIR}/src/third_party/mozjs-38/platform/x86_64/windows/include)
elseif(SYSTEM_MACOSX)
set(MongoDB_OBJECT_LIST_PLATFORM_PART macosx)
list(APPEND MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src/third_party/${MOZJS_VER}/platform/x86_64/macOS/include)
${MongoDB_DIR}/src/third_party/mozjs-38/platform/x86_64/osx/include)
elseif(SYSTEM_FREEBSD)
set(MongoDB_OBJECT_LIST_PLATFORM_PART freebsd)
list(APPEND MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src/third_party/${MOZJS_VER}/platform/x86_64/freebsd/include)
${MongoDB_DIR}/src/third_party/mozjs-38/platform/x86_64/freebsd/include)
elseif(SYSTEM_OPENBSD)
set(MongoDB_OBJECT_LIST_PLATFORM_PART openbsd)
list(APPEND MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src/third_party/${MOZJS_VER}/platform/x86_64/openbsd/include)
${MongoDB_DIR}/src/third_party/mozjs-38/platform/x86_64/openbsd/include)
endif()
# Read list of object files
@@ -94,30 +86,11 @@ string(STRIP "${MongoDB_RELATIVE_LIBS}" MongoDB_RELATIVE_LIBS)
# Convert string to list
string(REPLACE " " ";" MongoDB_RELATIVE_LIBS ${MongoDB_RELATIVE_LIBS})
# todo: Find a better solution
# Robo 1.4: Added as workaround fix for build error:
# fatal error LNK1170: line in command file contains 131071 or more characters
# Happens when the path of robo-shell is a long string (e.g. "E:/user/code/robomongo-shell")
set(MongoDB_OBJECTS_DIR_ENV $ENV{MongoDB_OBJECTS})
if(MongoDB_OBJECTS_DIR_ENV)
set(MongoDB_OBJECTS_DIR ${MongoDB_OBJECTS_DIR_ENV})
else()
set(MongoDB_OBJECTS_DIR ${MongoDB_DIR})
endif()
# Convert to absolute path
foreach(lib ${MongoDB_RELATIVE_LIBS})
list(APPEND MongoDB_LIBS ${MongoDB_OBJECTS_DIR}/${lib})
list(APPEND MongoDB_LIBS ${MongoDB_DIR}/${lib})
endforeach()
if(SYSTEM_WINDOWS)
list(APPEND MongoDB_LIBS Crypt32.lib Secur32.lib Dnsapi.lib winhttp.lib)
elseif(SYSTEM_MACOSX)
list(APPEND MongoDB_LIBS -lcurl)
elseif(SYSTEM_LINUX)
list(APPEND MongoDB_LIBS -lresolv -lcurl)
endif()
# Get MongoDB repository recent tag
execute_process(
COMMAND git describe --abbrev=0 --tags
-129
View File
@@ -1,129 +0,0 @@
##################################################
# Find and Add OpenSSL shared (dynamic) library
#
# - This module defines the following variables:
# OpenSSL_DIR
# OPENSSL_VERSION
#
# - Imported shared(dynamic) libraries "ssl" and "crypto" are created.
#
# - It is assumed that OpenSSL has been built and path to OpenSSL build directory is
# added into system(environment) variable ROBOMONGO_CMAKE_PREFIX_PATH.
#
##################################################
# Try to find OpenSSL directory (uses CMAKE_PREFIX_PATH locations)
#-------------------------------------------
find_path(
OpenSSL_DIR include/openssl/ssl.h
DOC "Path to OpenSSL (github.com/openssl/openssl) root directory"
)
# Find OpenSSL version
#-------------------------------------------
set (OPENSSL_INCLUDE_DIR "${OpenSSL_DIR}/include")
function(from_hex HEX DEC)
string(TOUPPER "${HEX}" HEX)
set(_res 0)
string(LENGTH "${HEX}" _strlen)
while (_strlen GREATER 0)
math(EXPR _res "${_res} * 16")
string(SUBSTRING "${HEX}" 0 1 NIBBLE)
string(SUBSTRING "${HEX}" 1 -1 HEX)
if (NIBBLE STREQUAL "A")
math(EXPR _res "${_res} + 10")
elseif (NIBBLE STREQUAL "B")
math(EXPR _res "${_res} + 11")
elseif (NIBBLE STREQUAL "C")
math(EXPR _res "${_res} + 12")
elseif (NIBBLE STREQUAL "D")
math(EXPR _res "${_res} + 13")
elseif (NIBBLE STREQUAL "E")
math(EXPR _res "${_res} + 14")
elseif (NIBBLE STREQUAL "F")
math(EXPR _res "${_res} + 15")
else()
math(EXPR _res "${_res} + ${NIBBLE}")
endif()
string(LENGTH "${HEX}" _strlen)
endwhile()
set(${DEC} ${_res} PARENT_SCOPE)
endfunction()
if (OPENSSL_INCLUDE_DIR)
if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
# The version number is encoded as 0xMNNFFPPS: major minor fix patch status
# The status gives if this is a developer or prerelease and is ignored here.
# Major, minor, and fix directly translate into the version numbers shown in
# the string. The patch field translates to the single character suffix that
# indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and so
# on.
string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F]).*$"
"\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}")
list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR)
list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX)
list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
if (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
from_hex("${OPENSSL_VERSION_PATCH}" _tmp)
# 96 is the ASCII code of 'a' minus 1
math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96")
unset(_tmp)
# Once anyone knows how OpenSSL would call the patch versions beyond 'z'
# this should be updated to handle that, too. This has not happened yet
# so it is simply ignored here for now.
string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
endif ()
set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
endif ()
endif ()
# Add imported ssl and crypto libraries
#-------------------------------------------
# Add imported target ssl (ssleay32)
add_library(ssl SHARED IMPORTED)
# Add imported target for crypto (libeay32)
add_library(crypto SHARED IMPORTED)
# todo: refactor
if(SYSTEM_WINDOWS)
set_target_properties(ssl PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/include"
IMPORTED_IMPLIB "${OpenSSL_DIR}/libssl.lib"
)
set_target_properties(crypto PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/include"
IMPORTED_IMPLIB "${OpenSSL_DIR}/libcrypto.lib"
)
else()
if(SYSTEM_MACOSX)
SET(EXT "dylib")
elseif(SYSTEM_LINUX)
SET(EXT "so")
endif()
set_target_properties(ssl PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/include"
IMPORTED_LOCATION "${OpenSSL_DIR}/libssl.${EXT}"
)
set_target_properties(crypto PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/include"
IMPORTED_LOCATION "${OpenSSL_DIR}/libcrypto.${EXT}"
)
endif()
# End of file
View File
+2 -2
View File
@@ -1,3 +1,3 @@
set(ROBOMONGO_DISPLAY_NAME "Robo 3T")
set(ROBOMONGO_DISPLAY_FULL_NAME "Robo 3T ${PROJECT_VERSION}")
set(ROBOMONGO_DISPLAY_NAME "Robomongo")
set(ROBOMONGO_DISPLAY_FULL_NAME "Robomongo ${PROJECT_VERSION}")
+16 -49
View File
@@ -1,63 +1,30 @@
# Set MONGO_BUILD_FOLDER
set(MONGO_BUILD_FOLDER "build/opt") # Release
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(MONGO_BUILD_FOLDER "build/debug")
endif()
# Show configuration summary and build tip
message("")
message(" _______________[ Robo 3T configuration summary ]________________")
message(" _______________[ Robomongo configuration summary ]________________")
message("| ")
message("|-- Dependencies:")
message("| ")
message("| Qt5 Core: ${Qt5Core_VERSION} ${Qt5Core_DIR}")
message("| Qt5 Gui: ${Qt5Gui_VERSION} ${Qt5Gui_DIR}")
message("| Qt5 Widgets: ${Qt5Widgets_VERSION} ${Qt5Widgets_DIR}")
message("| Qt5 PrintSupport: ${Qt5Widgets_VERSION} ${Qt5PrintSupport_DIR}")
message("| Qt5 Network: ${Qt5Network_VERSION} ${Qt5Network_DIR}")
message("| Qt5 Xml: ${Qt5Xml_VERSION} ${Qt5Xml_DIR}")
if(NOT SYSTEM_LINUX)
message("| Qt5 WebEng*Widgets: ${Qt5WebEngineWidgets_VERSION} ${Qt5WebEngineWidgets_DIR}")
endif()
message("| MongoDB: ${MongoDB_VERSION} ${MongoDB_DIR}")
message("| MongoDB Objects: ${MongoDB_VERSION} ${MongoDB_OBJECTS_DIR}/${MONGO_BUILD_FOLDER}")
message("| OpenSSL: ${OPENSSL_VERSION} ${OpenSSL_DIR}")
message("| libssh2: ${LIBSSH2_VERSION} ${LIBSSH2_DIR}")
message("| QJson: ${QJSON_VERSION} ${QJSON_DIR}")
message("| QScintilla: ${QSCINTILLA_VERSION} ${QSCINTILLA_DIR}")
message("| Google Test: ${GOOGLE_TEST_VERSION} ${GOOGLE_TEST_DIR}")
message("| ESPRIMA: ${ESPRIMA_VERSION} ${ESPRIMA_DIR}")
message("| Qt5 Core: ${Qt5Core_VERSION} ${Qt5Core_DIR}")
message("| Qt5 Gui: ${Qt5Gui_VERSION} ${Qt5Gui_DIR}")
message("| Qt5 Widgets: ${Qt5Widgets_VERSION} ${Qt5Widgets_DIR}")
message("| Qt5 PrintSupport: ${Qt5Widgets_VERSION} ${Qt5PrintSupport_DIR}")
message("| MongoDB: ${MongoDB_VERSION} ${MongoDB_BUILD_DIR}")
message("|")
message("|-- Summary:")
message("|")
message("| Version: ${PROJECT_VERSION}")
message("| System: ${CMAKE_SYSTEM_NAME}")
message("| System: ${CMAKE_SYSTEM_NAME}")
if (SYSTEM_MACOSX)
message("| Target SDK: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
message("| Target SDK: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
message("| Build type: ${CMAKE_BUILD_TYPE}")
message("| Commit: ${BUILD_NUMBER}")
message("| Install path: ${CMAKE_INSTALL_PREFIX}")
message("| Build type: ${CMAKE_BUILD_TYPE}")
message("| Install path: ${CMAKE_INSTALL_PREFIX}")
message("|")
message("|-- Build, Run and Install:")
message("|-- Building and installing:")
message("| ")
message("| $ bin/build")
message("| $ bin/run")
message("| $ bin/install")
message("| Now you can build Robomongo with the following command:")
message("| $ cmake --build .")
message("|")
message("|-- Run Unit Tests:")
message("| ")
message("| $ bin/build-and-run-tests")
message("| $ bin/run-tests")
message("|")
message("|-- Run Static Code Analysis:")
message("|")
if (SYSTEM_WINDOWS)
message("| $ bin/run-cppcheck <FILE_PATH OR DIR> (Default: /src/robomongo/)")
message("| $ bin/run-vs-code-analysis")
else()
message("| $ bin/run-clang-tidy")
message("| $ bin/run-scan-build")
endif()
message("| And install it to ${CMAKE_INSTALL_PREFIX}:")
message("| $ cmake --build . --target install")
message("|__________________________________________________________________")
message("")
message("")
+8 -2
View File
@@ -9,14 +9,17 @@
# SYSTEM_OPENBSD
# SYSTEM_NETBSD
#
# 2) Build types checks
# 2) Additional Linux distro check
# SYSTEM_LINUX_RHEL
#
# 3) Build types checks
#
# BUILD_DEBUG
# BUILD_RELEASE
# BUILD_RELWITHDEBINFO
# BUILD_MINSIZEREL
#
# 3) Link "lib groups" and "whole-archive" options
# 4) Link "lib groups" and "whole-archive" options
#
# LINK_LIBGROUP_START
# LINK_LIBGROUP_END
@@ -30,6 +33,9 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(SYSTEM_WINDOWS TRUE)
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(SYSTEM_LINUX TRUE)
if(EXISTS "/etc/redhat-release")
set(SYSTEM_LINUX_RHEL TRUE)
endif()
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
set(SYSTEM_FREEBSD TRUE)
set(SYSTEM_BSD TRUE)
+16 -58
View File
@@ -18,17 +18,16 @@ if(SYSTEM_LINUX)
set(bin_dir bin)
set(lib_dir lib)
set(resources_dir share)
set(license_dir .)
set(license_dir ${resources_dir}/doc/robomongo)
set(qt_plugins_dir ${lib_dir})
set(qt_conf_dir ${bin_dir})
set(qt_conf_plugins "../lib")
elseif(SYSTEM_MACOSX)
set(bundle_name "Robo 3T.app")
set(bundle_name Robomongo.app)
set(contents_path ${bundle_name}/Contents)
set(bin_dir ${contents_path}/MacOS)
set(styles_dir ${contents_path}/MacOS/styles)
set(lib_dir ${contents_path}/Frameworks)
set(resources_dir ${contents_path}/Resources)
set(license_dir ${resources_dir})
@@ -38,9 +37,8 @@ elseif(SYSTEM_MACOSX)
set(qt_conf_plugins "PlugIns/Qt")
elseif(SYSTEM_WINDOWS)
set(bin_dir .)
set(styles_dir ${bin_dir}/styles)
set(lib_dir .)
set(resources_dir ./resources)
set(resources_dir .)
set(license_dir .)
set(qt_plugins_dir ${lib_dir})
@@ -58,29 +56,6 @@ install(
FILES "${CMAKE_BINARY_DIR}/qt.conf"
DESTINATION "${qt_conf_dir}")
# Install OpenSSL dynamic lib files
if(SYSTEM_WINDOWS)
install(
FILES
"${OpenSSL_DIR}/libssl-1_1-x64.dll"
"${OpenSSL_DIR}/libcrypto-1_1-x64.dll"
DESTINATION ${bin_dir})
elseif(SYSTEM_MACOSX)
install(
FILES
"${OpenSSL_DIR}/libssl.1.1.dylib"
"${OpenSSL_DIR}/libcrypto.1.1.dylib"
DESTINATION ${lib_dir}/lib)
elseif(SYSTEM_LINUX)
install(
FILES
"${OpenSSL_DIR}/libssl.so"
"${OpenSSL_DIR}/libssl.so.1.0.0"
"${OpenSSL_DIR}/libcrypto.so"
"${OpenSSL_DIR}/libcrypto.so.1.0.0"
DESTINATION ${lib_dir})
endif()
# Install binary
install(
TARGETS robomongo
@@ -97,28 +72,26 @@ install(
DESTINATION ${license_dir})
# Install common dependencies
SET(QT_LIBS Core Gui Widgets PrintSupport Network Xml)
if(NOT SYSTEM_LINUX)
SET(QT_LIBS ${QT_LIBS} WebEngineWidgets WebEngineCore Quick
QuickWidgets WebChannel Qml Positioning)
endif()
install_qt_lib(${QT_LIBS})
install_qt_lib(Core Gui Widgets PrintSupport)
install_qt_plugins(QGifPlugin QICOPlugin)
install_icu_libs()
set(QT_STYLES_DIR ${Qt5Core_DIR}/../../../plugins/styles/)
set(QT_BIN_DIR ${Qt5Core_DIR}/../../../bin/)
set(QT_RESOURCES_DIR ${Qt5Core_DIR}/../../../resources/)
if(SYSTEM_LINUX)
install_qt_lib(XcbQpa DBus)
install_qt_plugins(
QGtk2ThemePlugin
QXcbIntegrationPlugin)
# Install icons
install(
FILES
"/usr/lib/x86_64-linux-gnu/libstdc++.so.6"
"/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28"
DESTINATION ${lib_dir})
DIRECTORY "${CMAKE_SOURCE_DIR}/install/linux/icons/"
DESTINATION "${resources_dir}/icons")
# Install desktop shortcut
install(
FILES "${CMAKE_SOURCE_DIR}/install/linux/robomongo.desktop"
DESTINATION "${resources_dir}/applications")
elseif(SYSTEM_MACOSX)
install_qt_lib(MacExtras DBus)
install_qt_plugins(
@@ -128,29 +101,14 @@ elseif(SYSTEM_MACOSX)
# Install icon
install(
FILES "${CMAKE_SOURCE_DIR}/install/macosx/robomongo.icns"
FILES "${CMAKE_SOURCE_DIR}/install/macosx/Robomongo.icns"
DESTINATION "${resources_dir}")
# Install styles
install(FILES "${QT_STYLES_DIR}/libqmacstyle.dylib" DESTINATION ${styles_dir})
elseif(SYSTEM_WINDOWS)
install_qt_plugins(
QWindowsIntegrationPlugin
QMinimalIntegrationPlugin
QOffscreenIntegrationPlugin)
# Qt WebEngine dependencies
install(DIRECTORY ${QT_RESOURCES_DIR} DESTINATION ${resources_dir})
install(FILES
"${QT_BIN_DIR}/libEGL.dll"
"${QT_BIN_DIR}/libGLESv2.dll"
"${QT_BIN_DIR}/opengl32sw.dll"
"${QT_BIN_DIR}/QtWebEngineProcess.exe"
DESTINATION ${bin_dir})
# Install Styles
install(FILES "${QT_STYLES_DIR}/qwindowsvistastyle.dll" DESTINATION ${styles_dir})
# Install runtime libraries:
# msvcp120.dll
# msvcr120.dll
-1
View File
@@ -28,7 +28,6 @@ function(install_qt_lib)
install(
DIRECTORY ${qt_lib_dir}/${module_name}.framework
DESTINATION ${lib_dir}
USE_SOURCE_PERMISSIONS
PATTERN "*_debug" EXCLUDE # Exclude debug libraries
PATTERN "Headers" EXCLUDE) # Exclude Headers folders
endif()
+14 -7
View File
@@ -15,7 +15,7 @@ execute_process(
string(TIMESTAMP timestamp "%Y-%m-%d")
# Package name (as it should appear in UI)
set(CPACK_PACKAGE_NAME robo3t)
set(CPACK_PACKAGE_NAME Robomongo)
# Version of the package
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
@@ -34,10 +34,10 @@ set(CPACK_MONOLITHIC_INSTALL ON)
set(CPACK_STRIP_FILES ON)
# Additional information
set(CPACK_PACKAGE_VENDOR "3T Software Labs Ltd")
set(CPACK_PACKAGE_CONTACT robo3t@3t.io)
set(CPACK_PACKAGE_VENDOR Paralect)
set(CPACK_PACKAGE_CONTACT robomongo@paralect.com)
set(CPACK_PACKAGE_DESCRIPTION "Shell-centric cross-platform MongoDB management tool.")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Robo 3T is a shell-centric cross-platform MongoDB management tool.")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Robomongo is a shell-centric cross-platform MongoDB management tool.")
# Use lowercase for system name and package file name
string(TOLOWER ${CMAKE_SYSTEM_NAME} system_name)
@@ -52,9 +52,16 @@ target_architecture(target_arch)
# Package file name
set(CPACK_PACKAGE_FILE_NAME ${package_file_name}-${package_file_version}-${system_name}-${target_arch}-${git_hash})
if(SYSTEM_LINUX)
set(CPACK_GENERATOR TGZ)
if(SYSTEM_LINUX_RHEL)
set(CPACK_GENERATOR RPM)
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/DESCRIPTION")
set(CPACK_RPM_PACKAGE_LICENSE "GPLv3")
set(CPACK_RPM_PACKAGE_DEBUG 1)
list(APPEND CPACK_RPM_USER_FILELIST "%attr(755,root,root) /usr/share/icons")
list(APPEND CPACK_RPM_USER_FILELIST "%attr(755,root,root) /usr/share/applications")
elseif(SYSTEM_LINUX)
set(CPACK_GENERATOR TGZ)
elseif(SYSTEM_MACOSX)
set(CPACK_GENERATOR DragNDrop)
@@ -62,7 +69,7 @@ elseif(SYSTEM_MACOSX)
elseif(SYSTEM_WINDOWS)
set(files_dir "${CMAKE_SOURCE_DIR}/install/windows")
set(exe_name "robo3t.exe")
set(exe_name "Robomongo.exe")
set(CPACK_GENERATOR NSIS ZIP)
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/DESCRIPTION")
+6 -6
View File
@@ -15,13 +15,13 @@ elseif(SYSTEM_WINDOWS)
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} psapi.lib bcrypt.lib Iphlpapi.lib dbghelp.lib ws2_32.lib winmm.lib version.lib")
endif()
set(PROJECT_NAME "Robo 3T")
set(PROJECT_NAME "Robomongo")
set(PROJECT_NAME_TITLE ${PROJECT_NAME})
set(PROJECT_DOMAIN "www.robomongo.org")
set(PROJECT_COMPANYNAME "3T Software Labs Ltd")
set(PROJECT_COPYRIGHT "Copyright (C) 2014-2017 ${PROJECT_COMPANYNAME} All Rights Reserved.")
set(PROJECT_COMPANYNAME_DOMAIN "https://studio3t.com/")
set(PROJECT_GITHUB_FORK "www.github.com/Studio3T/robomongo")
set(PROJECT_GITHUB_ISSUES "www.github.com/Studio3T/robomongo/issues")
set(PROJECT_COMPANYNAME "Paralect")
set(PROJECT_COPYRIGHT "Copyright (C) 2013-2015 ${PROJECT_COMPANYNAME} All Rights Reserved.")
set(PROJECT_COMPANYNAME_DOMAIN "www.paralect.com")
set(PROJECT_GITHUB_FORK "www.github.com/paralect/robomongo")
set(PROJECT_GITHUB_ISSUES "www.github.com/paralect/robomongo/issues")
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWERCASE)
-8
View File
@@ -1,11 +1,3 @@
See these docs for the latest info about this topic:
-------------
- [Build Robo 3T - Mac OS X and Linux](https://github.com/paralect/robomongo/blob/master/docs/BuildRobo3TOnMacAndLinux.md)
- [Build Robo 3T - Windows](https://github.com/paralect/robomongo/blob/master/docs/BuildRobo3TOnWindows.md)
------------------------------------
What is this?
-------------
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-243
View File
@@ -1,243 +0,0 @@
Building Robo 3T (macOS and Linux)
==================
A. Prerequisites
-------------
1. Modern Compiler
A modern and complete C++17 compiler:
```
GCC 8.0 or newer
Clang 7 (or Apple XCode 10 Clang) or newer
On Linux and macOS, the libcurl library and header is required. macOS includes libcurl.
Fedora/RHEL - dnf install libcurl-devel
Ubuntu/Debian - apt-get install libcurl-dev
Python 3.7
```
For details see: https://github.com/mongodb/mongo/wiki/Build-Mongodb-From-Source
2. Install CMake (3.10.0 or later)
Example:
```
sudo apt-get install build-essential
// or
wget http://www.cmake.org/files/v3.10/cmake-3.10.0.tar.gz
tar xf cmake-3.10.0.tar.gz
cd cmake-3.10.0
./configure // macos: env CC=gcc ./bootstrap
make
sudo make install
(sudo make uninstall)
```
3. Install [Scons](http://scons.org/tag/releases.html) (3.1.2 or later)
```
cd scons-**
python setup.py install
```
4. Install Qt
macOS: Qt 5.12.8
Linux: Qt 5.9.3
```sh
Example installation for macOS and Ubuntu:
Go to http://download.qt.io/archive/qt/5.x/5.x.y/
Download, run and install
qt-opensource-mac-x64-clang-5.x.y.dmg (for macOS)
qt-opensource-linux-x64-5.x.y.run (for Linux)
After successful installation you should have
/path/to/qt-5.x.y/5.x/clang_64 (for macOS)
/path/to/qt-5.x.y/5.x/gcc_64 (for Linux)
More information for installing on Ubuntu:
https://wiki.qt.io/Install_Qt_5_on_Ubuntu
```
5. Download and Build OpenSSL - (explained below in section B)
B. Building Robo 3T and Dependencies
-------------
Ref: https://wiki.openssl.org/index.php/Compilation_and_Installation#OS_X
#### 1. Build OpenSSL
(Todo: Can we find pre-built OpenSSL? To check => https://wiki.openssl.org/index.php/Binaries)
Version 1.1.1f (Mar/2020) on macOS
Version 1.0.2o (Mar/2018) on Linux
**macOS:**
```sh
wget https://www.openssl.org/source/old/1.1.1/openssl-1.1.1f.tar.gz
tar -xf openssl-1.1.1f.tar.gz
cd /opt/openssl-1.1.1f
(make clean)
./Configure darwin64-x86_64-cc shared no-ssl2 no-ssl3 no-comp -mmacosx-version-min=xy.zt
// Notes:
// 1. Change -mmacosx-version same as CMAKE_OSX_DEPLOYMENT_TARGET in
// https://github.com/Studio3T/robomongo/blob/master/CMakeLists.txt
// 2. With openssl version 1.1.1, configure command with rpath stopped working
// Last working configure command with rpath was:
// ./Configure darwin64-x86_64-cc shared --openssldir="@rpath"
make (or sudo make)
// Verify libssl.dylib and libcrypto.dylib files are created
ll lib*.dylib
// Due to broken './Configure' command with rpath above, these extra steps are also required:
install_name_tool -id "@rpath/lib/libssl.1.1.dylib" libssl.1.1.dylib
install_name_tool -change /usr/local/lib/libcrypto.1.1.dylib @rpath/lib/libcrypto.1.1.dylib libssl.1.1.dylib
install_name_tool -id "@rpath/lib/libcrypto.1.1.dylib" libcrypto.1.1.dylib
// Finally, we should have this output using otool:
otool -L libssl.1.1.dylib
libssl.dylib:
@rpath/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
@rpath/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
otool -L libcrypto.1.1.dylib
libcrypto.dylib:
@rpath/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
// For robo-unit-test dependency:
mkdir lib/
cp lib*.dylib/lib/
```
**Linux:**
```sh
wget https://www.openssl.org/source/old/1.0.2/openssl-1.0.2o.tar.gz
tar -xf openssl-1.0.2o.tar.gz
cd /opt/openssl-1.0.2o
(make clean)
./config shared
make
// Verify libssl.so and libcrypto.so are created
```
#### 2. Build Robo 3T Shell (fork of MongoDB)
Clone Robo 3T Shell and make sure you are on latest branch:
```sh
$ git clone https://github.com/paralect/robomongo-shell.git
$ cd robomongo-shell
$ git branch // "roboshell-v4.2"
```
Set special environment variable `ROBOMONGO_CMAKE_PREFIX_PATH` to point to a set of
directories:
1. Location of Qt 5 SDK
2. Location of Robo 3T Shell
3. Location of OpenSSL
Separate directories by semicolon `;` (not colon):
// macOS example:
export ROBOMONGO_CMAKE_PREFIX_PATH="/path/to/qt-5.x.y/5.x/clang_64;/opt/robo-shell;/opt/openssl-x.y.z"
// Ubuntu example:
export ROBOMONGO_CMAKE_PREFIX_PATH="/home/<user>/Qt5.x.y/5.x.y/gcc_64/;/opt/<user>/robo-shell;/opt/openssl-x.y.z"
Install pip requirements
```
// macOS / Linux
pip3 install --user -r etc/pip/compile-requirements.txt
pip3 install --user -r etc/pip/dev-requirements.txt
```
```
// For ubuntu, the followings might be needed
sudo aptitude install libcurl-dev
sudo pip3 install Typing
sudo pip3 install Cheetah
```
Build Robo 3T Shell (in release mode by default):
```sh
$ bin/build
```
Build Robo 3T Shell in debug mode:
```sh
$ bin/build debug
```
Clean build files for release mode:
```sh
$ bin/clean
```
Clean build files for debug mode:
```sh
$ bin/clean debug
```
For more information refer to [Building Robo 3T Shell](BuildRobo3TShell.md)
#### 3. Build Robo 3T
Download Robo 3T:
$ git clone https://github.com/Studio3T/robomongo
$ cd robomongo
Run configuration step:
$ bin/configure
And finally, build Robo 3T:
$ bin/build
To run robomongo:
$ bin/run
**Debug mode**
For debug mode append `debug` for each command
e.g. `bin/configure debug` or `bin/build debug` etc..
**Helper commands**
Clean build files (in order to start build from scratch):
$ bin/clean
Install Robo 3T to `build/release/install` folder:
$ bin/install
Create package for your OS in `build/release/package` folder:
$ bin/pack
**Important Notes**
- For macOS builds, it might be needed to patch QScintilla with `QScintilla-2.9.3-xcode8.patch` found at robomongo repository's root.
- For Ubuntu 16.04 builds, it has been reported that Robo 3T /bin/configure step might fail and installing `mesa-common-dev` package solves it. Details: https://github.com/paralect/robomongo/issues/1268
- For Centos builds, Robo 3T /bin/configure step might fail due to error: `failed to find gl/gl.h`. In this case, the following packages must be installed:
```sh
$ sudo yum install mesa-libGL
$ sudo yum install mesa-libGL-devel
```
-229
View File
@@ -1,229 +0,0 @@
Building Robo 3T (Windows)
==============================
A. Prerequisites
-------------
#### 0. Git
Download Git installer from http://git-scm.com (we are using Git-2.7.0-64-bit).
When you'll see "Adjusting your PATH environment" wizard page, select
"Use Git from the Windows Command Prompt" option. This will allow to
execute Git from both Windows Command Prompt and Bash. This is required,
because both MongoDB and Robo 3T uses `git` command during build process
which must be perfomed from Windows Command Prompt (not Bash).
On "Configuring the line ending conversion" wizard page, select "Checkout
Windows-style, commit Unix-style line ending" option. This is a common mode
for cross-platform projects and required by both MongoDB and Robo 3T.
All other Git installer options are not important (use defaults).
If you are using SSH clone url, start SSH agent and add your private key
with this commands in Git Bash:
$ eval `ssh-agent` # starts ssh agent
$ ssh-add ~/.ssh/mykey # add your key (which can be in any folder)
#### 1. Visual Studio 2017 version 15.9 or newer (complete C++17 compiler)
We use Visual Studio 2017 version 15.9.22, and recommend to use this version to save
time for Qt compilation. Currently prebuilt binaries for Qt are available
from official Qt site. But you can use any newer version and compile Qt library
yourself.
#### 2. ActivePython 3.7.4
Download ActivePython from http://www.activestate.com/activepython/downloads
Download MSI x64 version. Use default settings in installation wizard.
This installer will add path to `python.exe` to your `PATH` variable.
#### 3. SCons 3.1.2 or newer
We use SCons 3.1.2
Download Scons from http://scons.org/tag/releases.html
Use ZIP archive, not MSI
Open Command Prompt, navigate to Scons directory and run:
$ setup.py install
This command will make `scons` command accessible from Command Prompt
#### 4. CMake
We use CMake 3.10.0
Download CMake from https://cmake.org/download
Use installer package, it will allow you to configure your PATH variable and `cmake`
command will be available from Command Prompt. For this set "Add CMake to the system
PATH for current user" in the installer wizard page.
#### 5. Qt 5.12.8
Download and install Qt from http://download.qt.io/archive/qt
Run the installer and select only 'msvc2017 64-bit'
#### 6. OpenSSL (1.1.1f)
Download openssl from https://www.openssl.org/source/old/1.1.1/openssl-1.1.1f.tar.gz
B. Building Robo 3T and Dependencies
-------------
#### 1. Build OpenSSL
(Todo: Can we find pre-built OpenSSL? To check => https://wiki.openssl.org/index.php/Binaries)
Steps to build OpenSSL on windows:
- Ensure you have perl installed on your machine (e.g. ActiveState or Strawberry), and available on your %PATH%
- Ensure you have NASM installed on your machine, and available on your %PATH%
```sh
Open Visual Studio tool x64 Cross Tools Command prompt
cd to the directory where you have openssl sources cd c:\myPath\openssl
perl Configure VC-WIN64A
(nmake clean)
nmake
// Verify these files are created:
libcrypto-1_1x64.dll, libssl-1_1-x64.dll (with all the build additionals such as .pdb .lik or static .lib)
```
Refer to OpenSSL documentation for more information:
https://wiki.openssl.org/index.php/Compilation_and_Installation#OpenSSL_1.1.0
#### 2. Build Robo 3T Shell (fork of MongoDB)
Clone Robo 3T Shell and make sure to be at `roboshell-v4.2` branch:
```sh
$ git clone https://github.com/paralect/robomongo-shell.git
$ cd robomongo-shell
$ git branch // roboshell-v4.2
```
Set environment variable `ROBOMONGO_CMAKE_PREFIX_PATH`, required by Robo 3T-Shell and Robo 3T build scripts, needs to be set according to the following directories:
1. Location of Qt SDK
2. Location of Robo 3T Shell
3. Location of OpenSSL
**Important:**
Make sure to move all your repos (robo, openssl, robo-shell etc..) into root directory of your drives (e.g. e:\robo-shell) and keep short repo names (e.g. robo-shell instead of robomongo-shell) otherwise you might end up with this error `If you see fatal error LNK1170: line in command file contains 131071 or more characters`
Separate directories by semicolon `;` (not colon). You can do this in Command Prompt:
> setx ROBOMONGO_CMAKE_PREFIX_PATH "e:\Qt\Qt5.9.3\5.9.3\msvc2015_64;e:\robo-shell;e:\openssl-x.y.z"
Open '**a new**' VS2017 x64 Native Tools Command Prompt and navigate to `robomongo-shell` folder.
**Note:**
Run
`pip3 install --user -r ../etc/pip/dev-requirements.txt`
If you have this type of errors:
```
// 1st error
ImportError: No module named typing
// Solution:
pip install Typing
pip install Cheetah
// 2nd error: shell: cheetah module not found
// Solution:
copy C:\Users\<user>\AppData\Roaming\Python\Python27\site-packages
to C:\Python27\Lib\site-packages
```
Build shell in release mode:
> bin\build
Build shell in debug mode:
> bin\build debug
Note that backslash is used (`\`), and not forward slash (`/`).
Clean build files for release mode:
> bin\clean
Clean build files for debug mode:
> bin\clean debug
Refer to MongoDB documentation for additional information:
https://docs.mongodb.org/manual/contributors/tutorial/build-mongodb-from-source/#windows-specific-instructions
#### 3. Build Robo 3T
Clone Robo 3T:
```sh
$ git clone https://github.com/paralect/robomongo.git
```
Open VS2017 x64 Native Tools Command Prompt and navigate to `robomongo` folder.
Run configuration step:
> bin\configure
And finally, build Robo 3T:
> bin\build
```
// If you see fatal error LNK1170: line in command file contains 131071 or more characters
Solution-1:
1. Move all your repos (robo, openssl, robo-shell etc..) into root directory of your drives.
2. Use short names e.g. robo-shell instead of robomongo-shell.
3. Update ROBOMONGO_CMAKE_PREFIX_PATH env. variable and try a fresh (clean) build.
Solution-2:
1. Create environment variable MongoDB_OBJECTS, set a short path e.g. "C:/"
2. Open a new VS2017 x64 Native Tools Command Prompt and build Robo 3T Shell
3. Robo 3T Shell build script will copy the object files into MongoDB_OBJECTS directory
4. Build Robo 3T again (clean build might be needed)
```
**Run Robo 3T**
Install Robo 3T to `build\Release\install` folder:
> bin\install
And run Robo 3T
> \robomongo\build\Release\install\robo3t.exe
**Package Robo 3T**
Install Robo 3T to `build\Release\install` folder:
> bin\pack
Note: nsis-2.46-setup.exe with Full setup must be present.
**Debug mode**
For debug mode append `debug` for each command
e.g. `bin\configure debug` or `bin\build debug` etc..
**Helper commands**
Clean build files (in order to start build from scratch):
> bin\clean
-57
View File
@@ -1,57 +0,0 @@
Building Robo 3T Shell
========================
Robo 3T uses [modified version](https://github.com/paralect/robomongo-shell/tree/roboshell-v3.4) of MongoDB that we call Robo 3T Shell.
Before you can build Robo 3T, you have to build Robo 3T Shell. The following instructions are applicable only for Mac OS X and Linux. For Windows instructions please check [Building Robo 3T on Windows](BuildRobo3TOnWindows.md).
Build for Mac OS X or Linux
---------------------------
#### Prerequisites
1. Install [Scons](http://scons.org/tag/releases.html) (2.3.5 or newer)
2. Clone Robo 3T Shell and checkout to `roboshell-v3.4` branch:
```sh
$ git clone https://github.com/paralect/robomongo-shell.git
$ cd robomongo-shell
$ git checkout roboshell-v3.4
```
3. Build Robo 3T Shell:
```sh
$ bin/build
```
Done! Now you can continue with building Robo 3T
with embedded MongoDB 3.4 shell (that you've just built).
<br/>
#### Advanced helper commands
The following commands are needed only if you are planning to develop or deeper understand
Robo 3T or Robo 3T Shell build processes.
Clean build files for release mode (folder `build/opt` will be removed):
$ bin/clean
Here is a command that is executed by `bin/build` script:
$ scons mongo -j8 --release --osx-version-min=10.9
Argument `--osx-version-min` is required only for Mac OS.
Build MongoDB shell in debug mode:
$ scons mongo -j8 --dbg
Clear builds:
$ scons -c mongo # clears release build
$ scons -c --dbg mongo # clears debug build
+3 -12
View File
@@ -1,21 +1,12 @@
Building Robomongo Shell (Old Document)
Building Robomongo Shell
========================
**Important Note:**
This document is for versions 1.0 and earlier and for MongoDB 3.2.
See latest documents here: https://github.com/Studio3T/robomongo/wiki
Robomongo uses [modified version](https://github.com/paralect/robomongo-shell/tree/roboshell-v3.2) of MongoDB that we call Robomongo Shell. Before you can build Robomongo, you have to build Robomongo Shell. The following instructions are applicable only for Mac OS X and Linux. For Windows instructions please check [Building Robomongo on Windows](BuildingRobomongoOnWindows.md).
Build for Mac OS X or Linux
---------------------------
#### Prerequisites
1. Install [Scons](http://scons.org/tag/releases.html) (2.4 or later)
2. Clone Robomongo Shell and checkout to `roboshell-v3.2` branch:
1. Clone Robomongo Shell and checkout to `roboshell-v3.2` branch:
```sh
$ git clone https://github.com/paralect/robomongo-shell.git
@@ -23,7 +14,7 @@ Build for Mac OS X or Linux
$ git checkout roboshell-v3.2
```
3. Build Robomongo Shell:
2. Build Robomongo Shell:
```sh
$ bin/build
+20 -111
View File
@@ -1,108 +1,28 @@
Building Robomongo (Mac OS X and Linux)
Building Robomongo
==================
**Important Note:**
This document is for versions 1.0 and earlier and for MongoDB 3.2.
See latest documents here: https://github.com/Studio3T/robomongo/wiki
#### Step 1.
A. Prerequisites
-------------
Download and build Robomongo Shell (our fork of MongoDB).
Refer to [Building Robomongo Shell](BuildingMongoDB.md) document.
1. Install CMake (3.2 or later)
2. Install [Scons](http://scons.org/tag/releases.html) (2.4 or later)
3. Install Qt 5.7
```sh
Example installation for MAC OSX and Ubuntu:
Go to http://download.qt.io/archive/qt/5.7/5.7.0/
Download, run and install
qt-opensource-mac-x64-clang-5.7.0.dmg (for MAC OSX)
qt-opensource-linux-x64-5.7.0.run (for Linux)
After successful installation you should have
/path/to/qt-5.7.0/5.7/clang_64 (for MAC OSX)
/path/to/qt-5.7.0/5.7/gcc_64 (for Linux)
More information for installing on Ubuntu:
https://wiki.qt.io/Install_Qt_5_on_Ubuntu
```
4. Download and Build OpenSSL (1.0.1p) - (explained below in section B)
B. Building Robomongo and Dependencies
-------------
#### Step 1. Build OpenSSL (1.0.1p)
Steps to build OpenSSL on MAC:
```sh
Download openssl-1.0.1p (ftp://ftp.openssl.org/source/old/1.0.1/openssl-1.0.1p.tar.gz)
tar -xvzf openssl-1.0.1p.tar.gz
cd /Users/<user>/Downloads/openssl-1.0.1p
./Configure darwin64-x86_64-cc shared --openssldir="@rpath"
make (or sudo make)
mkdir lib
cp libssl.1.0.0.dylib libcrypto.1.0.0.dylib lib/
```
Helper Commands
```sh
// to start fresh build
make clean
```
Steps to build OpenSSL on Linux:
```sh
Download openssl-1.0.1p (ftp://ftp.openssl.org/source/old/1.0.1/openssl-1.0.1p.tar.gz)
tar -xvzf openssl-1.0.1p.tar.gz
cd /home/<user>/Downloads/openssl-1.0.1p
./config shared
make
mkdir lib
cp libssl* libcrypto* lib/
```
#### Step 2. Build Robomongo Shell (fork of MongoDB)
Clone Robomongo Shell and checkout to `roboshell-v3.2` branch:
```sh
$ git clone https://github.com/paralect/robomongo-shell.git
$ cd robomongo-shell
$ git checkout roboshell-v3.2
```
Set special environment variable `ROBOMONGO_CMAKE_PREFIX_PATH` to point to a set of
directories:
1. Location of Qt 5 SDK
2. Location of Robomongo Shell
3. Location of OpenSSL
Separate directories by semicolon `;` (not colon):
// MAC OSX example:
$ export ROBOMONGO_CMAKE_PREFIX_PATH="/path/to/qt-5.7.0/5.7/clang_64;/path/to/robomongo-shell;/path/to/openssl-1.0.1p"
// Ubuntu example:
$ export ROBOMONGO_CMAKE_PREFIX_PATH="/path/to/qt-5.7.0/5.7/gcc_64;/path/to/robomongo-shell;/path/to/openssl-1.0.1p"
Build Robomongo Shell:
```sh
$ bin/build
```
For more information refer to [Building Robomongo Shell](BuildingMongoDB.md)
#### Step 3. Build Robomongo
#### Step 2.
Download Robomongo:
$ git clone https://github.com/paralect/robomongo
$ cd robomongo
Set special environment variable `ROBOMONGO_CMAKE_PREFIX_PATH` to point to a set of
directories:
1. Location of Qt 5 SDK
2. Location of Robomongo Shell (built in "Step 1")
Separate directories by semicolon `;` (not colon):
$ export ROBOMONGO_CMAKE_PREFIX_PATH="/path/to/qt-5.5/5.5/clang_64;/path/to/robomongo-shell"
Run configuration step:
$ bin/configure
@@ -110,14 +30,14 @@ Run configuration step:
And finally, build Robomongo:
$ bin/build
<br>
## Helper commands
To run robomongo:
Execute just built Robomongo:
$ bin/run
**Helper commands**
Clean build files (in order to start build from scratch):
$ bin/clean
@@ -129,15 +49,4 @@ Install Robomongo to `build/release/install` folder:
Create package for your OS in `build/release/package` folder:
$ bin/pack
**Important Notes**
- For Ubuntu 16.04 builds, it has been reported that Robomongo /bin/configure step might fail and installing mesa-common-dev package solves it. Details: https://github.com/paralect/robomongo/issues/1268
- For Centos builds, Robomongo /bin/configure step might fail due to error: `failed to find gl/gl.h`. In this case, the following packages must be installed:
```sh
$ sudo yum install mesa-libGL
$ sudo yum install mesa-libGL-devel
```
+22 -78
View File
@@ -1,11 +1,7 @@
Building Robomongo (Windows)
Building Robomongo for Windows
==============================
**Important Note:**
This document is for versions 1.0 and earlier and for MongoDB 3.2.
See latest documents here: https://github.com/Studio3T/robomongo/wiki
A. Prerequisites
Prerequisites
-------------
#### 0. Git
@@ -68,70 +64,25 @@ A. Prerequisites
command will be available from Command Prompt. For this set "Add CMake to the system
PATH for current user" in the installer wizard page.
#### 5. Qt 5.7
#### 5. Qt 5.5
Download Qt from http://www.qt.io/download-open-source/ (we use Qt Online installer)
When installing Qt, only one component is required by Robomongo:
Qt 5.7
Qt 5.5
[x] msvc2013 64-bit.
This components contains prebuilt 64-bit binaries for Visual Studio 2013.
You may uncheck all other components to download as little as possible.
#### 6. OpenSSL (1.0.1p)
Download openssl-1.0.1p (ftp://ftp.openssl.org/source/old/1.0.1/openssl-1.0.1p.tar.gz)
B. Building Robomongo and Dependencies
-------------
#### 1. Build OpenSSL (1.0.1p)
Steps to build OpenSSL on windows:
```sh
Open Visual Studio tool x64 Cross Tools Command prompt
cd to the directory where you have openssl sources cd c:\myPath\openssl
perl Configure VC-WIN64A
ms\do_win64a
nmake -f ms\ntdll.mak
```
**Check Point:**
After successful build, newly created sub directory out32dll should contain dynamic lib files libeay32.lib (and libeay32.dll) and ssleay32.lib (and ssleay32.dll); and associated include files will be in newly created folder "inc32".
Helper Commands:
```sh
// clean to start fresh build
nmake -f ms\ntdll.mak clean
```
Refer to OpenSSL documentation for more information:
https://wiki.openssl.org/index.php/Compilation_and_Installation#W64
#### 2. Build Robomongo Shell (fork of MongoDB)
Clone Robomongo Shell and checkout to roboshell-v3.2 branch:
```sh
$ git clone https://github.com/paralect/robomongo-shell.git
$ cd robomongo-shell
$ git checkout roboshell-v3.2
```
Set environment variable `ROBOMONGO_CMAKE_PREFIX_PATH`, required by Robomongo-Shell and Robomongo build scripts, needs to be set according to the following directories:
1. Location of Qt SDK
2. Location of Robomongo Shell
3. Location of OpenSSL
Separate directories by semicolon `;` (not colon). You can do this in Command Prompt:
> setx ROBOMONGO_CMAKE_PREFIX_PATH "d:\Qt-5\5.7\msvc2013_64;d:\Projects\robomongo-shell;c:\myPath\openssl-1.0.1p"
## Build Robomongo Shell (fork of MongoDB)
Refer to MongoDB documentation for additional information:
https://docs.mongodb.org/manual/contributors/tutorial/build-mongodb-from-source/#windows-specific-instructions
Open VS2013 x64 Native Tools Command Prompt and navigate to `robomongo-shell` folder.
@@ -145,19 +96,20 @@ Clean build files:
> bin\clean
Refer to MongoDB documentation for additional information:
https://docs.mongodb.org/manual/contributors/tutorial/build-mongodb-from-source/#windows-specific-instructions
## Build Robomongo
#### 3. Build Robomongo
Set special environment variable `ROBOMONGO_CMAKE_PREFIX_PATH` to point to set of
directories:
Clone Robomongo:
1. Location of Qt SDK
2. Location of Robomongo Shell
```sh
$ git clone https://github.com/paralect/robomongo.git
```
Open VS2013 x64 Native Tools Command Prompt and navigate to `robomongo` folder.
Separate directories by semicolon `;` (not colon). You can do this in Command Prompt:
> setx ROBOMONGO_CMAKE_PREFIX_PATH "d:\Qt-5\5.5\msvc2013_64;d:\Projects\robomongo-shell"
Reopen your Command Prompt to make this variable available.
Run configuration step:
@@ -166,23 +118,15 @@ Run configuration step:
And finally, build Robomongo:
> bin\build
**Run Robomongo**
Install Robomongo to `build\Release\install` folder:
> bin\install
And run Robomongo
> \robomongo\build\Release\install\Robomongo.exe
**Helper commands**
#### Helper commands
Clean build files (in order to start build from scratch):
> bin\clean
Install Robomongo to `build\Release\install` folder:
> bin\install
-181
View File
@@ -1,181 +0,0 @@
Runtime Dependencies
====================
This information is for maintainers. If you want to just use Robomongo - download
prebuild packages for your platform.
Runtime dependencies that are not privided by platforms but required by Robomongo are:
1. Qt libraries
2. Qt plugins
Diagnostic of dependencies
--------------------------
### Windows
GUI: http://dependencywalker.com/
### Linux
#### a. View dependencies of executable or shared library:
$ ldd robomongo
$ readelf -d robomongo
#### b. View dependency tree of executable or shared library:
$ lddtree robomongo
$ ldd -v robomongo
#### c. View RPATH or RUNPATH records of executable or shared library:
$ objdump -x bin/robomongo | grep "RPATH\|RUNPATH"
$ readelf -d bin/robomongo | grep RPATH
For Robomongo binary it should be `$ORIGIN/../lib`
#### d. Enable extensive logging for run-time shared library search
$ export LD_DEBUG=files
$ bin/robomongo
Source:
http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
#### e. Modify RPATH using `chrpath` and the dynamic linker and RPATH using paths `patchelf`
$ patchelf --set-rpath '$ORIGIN/../lib' robo
More: https://nixos.org/patchelf.html
$ chrpath -r "/somepath/lib/" robomongo
More:
https://linux.die.net/man/1/chrpath
http://www.programering.com/a/MTOwcDNwATU.html // examples
#### f. Show symbols of shared lib file
Error:
```
/opt/robo-shell/src/mongo/util/net/ssl_manager_openssl.cpp:667:
undefined reference to `SSL_library_init'
```
How to debug:
```
openssl-1.1.1f: nm -gD libssl.so | grep SSL_library_init
// not found, since SSL_library_init() is deprecated in 1.1.1
openssl-1.0.2o: nm -gD libssl.so | grep SSL_library_init
0000000000055520 T SSL_library_init
```
#### g. Update path of a dependency of an executable
```
ldd exec_file | grep libcurlpp
libcurlpp.so.1 => not found
patchelf --replace-needed libcurlpp.so.1 /foo/bar/libcurlpp.so.1 exec_file
```
Another example (libcrypto.so.1.1 => not found):
```
cd /opt/openssl-1.1.1f
ldd libssl.so
linux-vdso.so.1 => (0x00007ffcaf911000)
libcrypto.so.1.1 => not found
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd4087b4000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd4083ea000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd408c65000)
sudo cp libcrypto.so.1.1 /lib/x86_64-linux-gnu/
ldd libssl.so
linux-vdso.so.1 => (0x00007fff0f5d8000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007fd3dcc1e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd3dc854000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd3dc650000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd3dd2d6000)
```
### Mac OS X
#### a. Show dependencies of executable or shared library:
Show dependencies of executable or shared library:
$ otool -L robomongo
View LC_RPATH records of executable or shared library:
$ otool -l robomongo | grep -C2 RPATH
(option `-C2` asks grep to output 2 context lines before and after the match)
For Robomongo binary it should be `$executable_path/../Frameworks`
More about `otool -l`
```
$ otool -l /opt/robo/build/release/src/robomongo/Robo\ 3T.app/Contents/MacOS/Robo\ 3T
....
Load command 23
cmd LC_LOAD_DYLIB
cmdsize 56
name @rpath/lib/libssl.1.1.dylib (offset 24)
time stamp 2 Thu Jan 1 03:00:02 1970
current version 1.1.0
compatibility version 1.1.0
Load command 24
cmd LC_LOAD_DYLIB
cmdsize 56
name @rpath/lib/libcrypto.1.1.dylib (offset 24)
time stamp 2 Thu Jan 1 03:00:02 1970
current version 1.1.0
compatibility version 1.1.0
....
Load command 27
cmd LC_RPATH
cmdsize 48
path /opt/Qt5.9.3/5.9.3/clang_64/lib (offset 12)
Load command 28
cmd LC_RPATH
cmdsize 32
path /opt/openssl-1.1.1f (offset 12)
```
#### b. Edit dependencies of executable or shared library:
```
// Before
otool -L libssl.dylib
libssl.dylib:
/usr/local/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
/usr/local/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
// Edit
install_name_tool -id "@rpath/lib/libssl.1.1.dylib" libssl.dylib
install_name_tool -change /usr/local/lib/libcrypto.1.1.dylib @rpath/lib/libcrypto.1.1.dylib libssl.dylib
// After
otool -L libssl.dylib
libssl.dylib:
@rpath/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
@rpath/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
```
Diagnostic of Qt plugins
------------------------
Run Robomongo in the following way to see how plugins are resolved:
$ QT_DEBUG_PLUGINS=1 ./robomongo
+49
View File
@@ -0,0 +1,49 @@
Runtime Dependencies
====================
This information is for maintainers. If you want to just use Robomongo - download
prebuild packages for your platform.
Runtime dependencies that are not privided by platforms but required by Robomongo are:
1. Qt libraries
2. Qt plugins
Diagnostic of dependencies
--------------------------
##### Linux
View dependencies of executable or shared library:
$ ldd robomongo
View RPATH or RUNPATH records of executable or shared library:
$ objdump -x bin/robomongo | grep "RPATH\|RUNPATH"
For Robomongo binary it should be `$ORIGIN/../lib`
##### Mac OS X
Show dependencies of executable or shared library:
$ otool -L robomongo
View LC_RPATH records of executable or shared library:
$ otool -l robomongo | grep -C2 RPATH
(option `-C2` asks grep to output 2 context lines before and after the match)
For Robomongo binary it should be `$executable_path/../Frameworks`
Diagnostic of Qt plugins
------------------------
Run Robomongo in the following way to see how plugins are resolved:
$ QT_DEBUG_PLUGINS=1 ./robomongo

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

+8
View File
@@ -0,0 +1,8 @@
[Desktop Entry]
Encoding=UTF-8
Name=Robomongo
Comment=Shell-centric cross-platform MongoDB management tool
Exec=robomongo
Icon=robomongo
Type=Application
Categories=Development;Utility;
Binary file not shown.
+1 -3
View File
@@ -7,7 +7,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Robo 3T</string>
<string>Robomongo</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
@@ -36,7 +36,5 @@
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
<key>NSRequiresAquaSystemAppearance</key>
<true/>
</dict>
</plist>

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Before

Width:  |  Height:  |  Size: 827 B

After

Width:  |  Height:  |  Size: 827 B

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

+1 -1
View File
@@ -14,7 +14,7 @@ File `robomongo.ico` will be generated.
Which icon sizes are used on Windows?
=====================================
The most important sizes are the one that is small. Robo 3T should include
The most important sizes are the one that is small. Robomongo should include
16, 20, 24, 40, 48. The bigger sizes are usually scaled well, without notable
degrading in quality.
+6 -6
View File
@@ -26,14 +26,14 @@ IDI_ICON1 ICON "@windows_icon@"
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "CompanyName", "3T Software Labs Ltd\0"
VALUE "FileDescription", "Robo 3T, MongoDB management tool\0"
VALUE "CompanyName", "Paralect, Inc\0"
VALUE "FileDescription", "Robomongo, MongoDB management tool\0"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "LegalCopyright", "Copyright 3T Software Labs Ltd, 2014 - 2017\0"
VALUE "ProductName", "Robo 3T\0"
VALUE "LegalCopyright", "Copyright Paralect, 2013 - 2016\0"
VALUE "ProductName", "Robomongo\0"
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
VALUE "OriginalFilename", "robo3t.exe\0"
VALUE "InternalName", "Robo 3T\0"
VALUE "OriginalFilename", "Robomongo.exe\0"
VALUE "InternalName", "Robomongo\0"
END
END
BLOCK "VarFileInfo"
+11
View File
@@ -0,0 +1,11 @@
This is a logbook for notes about migration to MongoDB 3.2
DocumentTextEditor.cpp
----------------------
Commented error reporting.
Logger.cpp
----------
Commented Logger::print().
Binary file not shown.

Before

Width:  |  Height:  |  Size: 468 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

+1 -1
View File
@@ -1,6 +1,6 @@
Robomongo shortcut key reference
================================
"3T", "Robomongo"
### Windows/Linux users
Ctrl+Enter or F5 or Ctrl+R
-123
View File
@@ -1,123 +0,0 @@
#########################################
### Unit Testing with Google Test ###
#########################################
### --- Important Note
if (SYSTEM_LINUX)
message("\n *Note: Currently unit testing is disabled for Linux "
"due to MongoDB linking problems")
return()
endif()
### --- Enable and setup gtest
enable_testing()
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
### --- Setup test source files
# New test & source file pairs MUST have the following format:
# Test file: /path/Foo_test.cpp
# Source file: /path/Foo.cpp or /path/Foo.h
set(ROBO_SRC_DIR ${CMAKE_HOME_DIRECTORY}/src/robomongo)
set(SOURCES_TEST
${ROBO_SRC_DIR}/utils/RoboCrypt_test.cpp
${ROBO_SRC_DIR}/utils/StringOperations_test.cpp
${ROBO_SRC_DIR}/core/HexUtils_test.cpp
)
### --- Setup robo_unit_tests exec. & link ROBO_OBJ_FILES
add_executable(robo_unit_tests ${SOURCES_TEST})
add_dependencies(robo_unit_tests robomongo)
target_include_directories(robo_unit_tests PRIVATE ${CMAKE_HOME_DIRECTORY}/src)
get_target_property(ROBO_SOURCES robomongo SOURCES)
list(FILTER ROBO_SOURCES INCLUDE REGEX "cpp")
list(FILTER ROBO_SOURCES EXCLUDE REGEX "main.cpp")
if(SYSTEM_WINDOWS)
set(OBJ_DIR ${CMAKE_BINARY_DIR}/src/robomongo/robomongo.dir/${CMAKE_BUILD_TYPE}/)
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}mocs_compilation.obj;")
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}qrc_gui.obj;")
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}qrc_robo.obj;")
foreach(SRC_FILE ${ROBO_SOURCES})
get_filename_component(FILENAME ${SRC_FILE} NAME)
string(REPLACE ".cpp" ".obj" FILENAME ${FILENAME})
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}${FILENAME};")
endforeach()
elseif(SYSTEM_MACOSX)
set(OBJ_DIR ${CMAKE_BINARY_DIR}/src/robomongo/CMakeFiles/robomongo.dir/)
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}/robomongo_autogen/mocs_compilation.cpp.o;")
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}/robomongo_autogen/YHP5W5E6RA/qrc_gui.cpp.o;")
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}/robomongo_autogen/3YJK5W5UP7/qrc_robo.cpp.o;")
foreach(SRC_FILE ${ROBO_SOURCES})
string(REPLACE ".cpp" ".cpp.o" OBJ_FILE ${SRC_FILE})
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}${OBJ_FILE};")
endforeach()
find_library(SECURITY NAMES Security)
find_library(CORE_FOUNDATION NAMES CoreFoundation)
set(SSL_LIBRARIES ${SECURITY} ${CORE_FOUNDATION})
target_link_libraries(robo_unit_tests ${SSL_LIBRARIES} -lresolv)
# elseif(SYSTEM_LINUX)
# set(OBJ_DIR ${CMAKE_BINARY_DIR}/src/robomongo/CMakeFiles/robomongo.dir/)
# message("--- OBJ_DIR: " ${OBJ_DIR})
# set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}/robomongo_automoc.cpp.o;")
# set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}/robomongo_automoc.dir/gui/resources/qrc_gui.cpp.o;")
# set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}/robomongo_automoc.dir/resources/qrc_robo.cpp.o;")
# foreach(SRC_FILE ${ROBO_SOURCES})
# string(REPLACE ".cpp" ".cpp.o" OBJ_FILE ${SRC_FILE})
# set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}${OBJ_FILE};")
# endforeach()
endif()
# Disable WebEngineWidgets for Linux
SET(WebEngineWidgets "Qt5::WebEngineWidgets")
if(SYSTEM_LINUX)
SET(WebEngineWidgets)
endif()
target_link_libraries(robo_unit_tests
gtest
gtest_main
Qt5::Widgets
Qt5::Network
Qt5::Xml
${WebEngineWidgets}
qjson
qscintilla
mongodb
ssh
Threads::Threads
${ROBO_OBJ_FILES}
)
### --- Install DLLs for Windows
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(D "d")
endif()
if(SYSTEM_WINDOWS)
get_target_property(target_path Qt5::Core LOCATION)
get_filename_component(qt_bin_dir ${target_path} DIRECTORY)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Core${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Gui${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Network${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5PrintSupport${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Widgets${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Xml${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Positioning${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Qml${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Quick${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5QuickWidgets${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5WebChannel${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5WebEngineCore${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5WebEngineWidgets${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5PrintSupport${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
get_target_property(TESTS_BIN_DIR robo_unit_tests BINARY_DIR)
file(COPY ${QT_BIN_FILES} DESTINATION ${TESTS_BIN_DIR}/${CMAKE_BUILD_TYPE})
file(COPY
${OpenSSL_DIR}/libssl-1_1-x64.dll
${OpenSSL_DIR}/libcrypto-1_1-x64.dll
DESTINATION ${TESTS_BIN_DIR}/${CMAKE_BUILD_TYPE})
endif()
-14
View File
@@ -1,14 +0,0 @@
This is just a placeholder for `cmake`.
Test source files are located in the same directory alongside the tested file in `robomongo/src/robomongo/` dir and sub-dirs.
e.g.
```
...
RoboCrypt.cpp
RoboCrypt_test.cpp
...
StringOperations.cpp
StringOperations_test.cpp
...
```
+24 -94
View File
@@ -5,11 +5,8 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
#set(sanitize "-fsanitize=address")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${sanitize}")
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${sanitize}")
set(SOURCES
# Isolated Scope #1
core/utils/QtUtils.cpp
core/utils/StdUtils.cpp
@@ -27,11 +24,14 @@ set(SOURCES
core/EventBus.cpp
core/KeyboardManager.cpp
core/domain/MongoNamespace.cpp
core/domain/MongoUser.cpp
core/domain/MongoUser.cpp
core/domain/MongoFunction.cpp
core/domain/MongoUtils.cpp
core/domain/MongoCollection.cpp
core/domain/MongoCollectionInfo.cpp
core/domain/MongoQueryInfo.cpp
core/domain/MongoShellResult.cpp
core/domain/CursorPosition.cpp
core/domain/ScriptInfo.cpp
core/events/MongoEventsInfo.cpp
@@ -49,18 +49,12 @@ set(SOURCES
core/domain/App.cpp
core/mongodb/MongoClient.cpp
core/mongodb/MongoWorker.cpp
core/mongodb/ReplicaSet.cpp
core/settings/SettingsManager.cpp
core/AppRegistry.cpp
utils/StringOperations.cpp
utils/common.cpp
utils/SimpleCrypt.cpp
utils/RoboCrypt.cpp
# Isolated Scope #3
gui/GuiRegistry.cpp
gui/dialogs/AboutDialog.cpp
gui/dialogs/EulaDialog.cpp
gui/dialogs/ConnectionAdvancedTab.cpp
gui/dialogs/ConnectionAuthTab.cpp
gui/dialogs/ConnectionBasicTab.cpp
@@ -68,7 +62,6 @@ set(SOURCES
gui/dialogs/ConnectionDialog.cpp
gui/dialogs/CopyCollectionDialog.cpp
gui/widgets/workarea/IndicatorLabel.cpp
gui/dialogs/CreateCollectionDialog.cpp
gui/dialogs/CreateDatabaseDialog.cpp
gui/dialogs/CreateUserDialog.cpp
gui/utils/ComboBoxUtils.cpp
@@ -77,23 +70,17 @@ set(SOURCES
# Isolated scope #4
gui/dialogs/PreferencesDialog.cpp
gui/dialogs/ConnectionsDialog.cpp
gui/dialogs/ExportDialog.cpp
gui/dialogs/ChangeShellTimeoutDialog.cpp
# Isolated scope #5
gui/editors/PlainJavaScriptEditor.cpp
gui/editors/JSLexer.cpp
gui/editors/FindFrame.cpp
gui/widgets/explorer/AddEditIndexDialog.cpp
gui/widgets/explorer/EditIndexDialog.cpp
gui/widgets/workarea/ScriptWidget.cpp
# Isolated scope #6
gui/widgets/explorer/ExplorerCollectionTreeItem.cpp
gui/widgets/explorer/ExplorerCollectionIndexesDir.cpp
gui/widgets/explorer/ExplorerCollectionIndexItem.cpp
gui/widgets/explorer/ExplorerTreeItem.cpp
gui/widgets/explorer/ExplorerReplicaSetFolderItem.cpp
gui/widgets/explorer/ExplorerReplicaSetTreeItem.cpp
gui/widgets/explorer/ExplorerDatabaseTreeItem.cpp
gui/widgets/explorer/ExplorerDatabaseCategoryTreeItem.cpp
gui/widgets/explorer/ExplorerUserTreeItem.cpp
@@ -124,82 +111,37 @@ set(SOURCES
gui/widgets/workarea/QueryWidget.cpp
gui/widgets/workarea/WorkAreaTabBar.cpp
gui/widgets/workarea/WorkAreaTabWidget.cpp
gui/widgets/workarea/WelcomeTab.cpp
# Final scope
gui/widgets/LogWidget.cpp
gui/MainWindow.cpp
gui/dialogs/SSHTunnelTab.cpp
gui/dialogs/SSLTab.cpp
core/settings/SshSettings.cpp
core/settings/SslSettings.cpp
core/settings/ReplicaSetSettings.cpp
core/mongodb/SshTunnelWorker.cpp
resources/robo.qrc
gui/resources/gui.qrc
)
# Robomongo target
add_executable(robomongo MACOSX_BUNDLE WIN32 app/main.cpp ${SOURCES})
# Disable WebEngineWidgets for Linux
SET(WebEngineWidgets "Qt5::WebEngineWidgets")
if(SYSTEM_LINUX)
SET(WebEngineWidgets)
endif()
target_link_libraries(robomongo
PRIVATE
Qt5::Widgets
Qt5::Network
Qt5::Xml
${WebEngineWidgets}
qjson
qscintilla
mongodb
ssh
Threads::Threads) # Target from FindThreads CMake module
if(APPLE)
find_library(SECURITY NAMES Security)
find_library(CORE_FOUNDATION NAMES CoreFoundation)
set(SSL_LIBRARIES ${SECURITY} ${CORE_FOUNDATION})
target_link_libraries(robomongo
PRIVATE
${SSL_LIBRARIES}
-lresolv)
endif(APPLE)
target_include_directories(robomongo
PRIVATE
${CMAKE_HOME_DIRECTORY}/src)
# Get build number
find_package(Git)
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE BUILD_NUMBER
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else(GIT_FOUND)
MESSAGE( FATAL_ERROR "Unable to find Git" )
set(BUILD_NUMBER 0)
endif(GIT_FOUND)
if(BUILD_NUMBER STREQUAL "")
MESSAGE( FATAL_ERROR "Failed to get BUILD_NUMBER" )
endif()
set(BUILD_NUMBER ${BUILD_NUMBER} CACHE INTERNAL "")
target_compile_definitions(robomongo
PRIVATE
BUILDING_ROBO
PROJECT_NAME="${PROJECT_NAME}"
PROJECT_NAME_TITLE="${PROJECT_NAME_TITLE}"
PROJECT_COPYRIGHT="${PROJECT_COPYRIGHT}"
@@ -209,17 +151,7 @@ target_compile_definitions(robomongo
PROJECT_GITHUB_FORK="${PROJECT_GITHUB_FORK}"
PROJECT_GITHUB_ISSUES="${PROJECT_GITHUB_ISSUES}"
PROJECT_VERSION="${PROJECT_VERSION}"
PROJECT_VERSION_SHORT="${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
BUILD_NUMBER="${BUILD_NUMBER}"
PROJECT_NAME_LOWERCASE="${PROJECT_NAME_LOWERCASE}"
PROJECT_QT_VERSION="${Qt5Core_VERSION}"
MongoDB_VERSION="${MongoDB_VERSION}"
OPENSSL_VERSION="${OPENSSL_VERSION}"
LIBSSH2_VERSION="${LIBSSH2_VERSION}"
QJSON_VERSION="${QJSON_VERSION}"
GOOGLE_TEST_VERSION="${GOOGLE_TEST_VERSION}"
ESPRIMA_VERSION="${ESPRIMA_VERSION}"
)
PROJECT_NAME_LOWERCASE="${PROJECT_NAME_LOWERCASE}")
if(SYSTEM_WINDOWS)
# Create Windows Resource file
@@ -230,47 +162,45 @@ if(SYSTEM_WINDOWS)
unset(windows_icon)
# Add additional source file to "robomongo" target
target_sources(robomongo PRIVATE "${CMAKE_BINARY_DIR}/winres.rc")
target_sources(robomongo
PRIVATE
"${CMAKE_BINARY_DIR}/winres.rc")
# Rename output name for Windows
set_target_properties(robomongo PROPERTIES OUTPUT_NAME "robo3t")
# Suppress "warning C4477: 'sprintf'..." from robomongo\shell\db\ptimeutil.cpp
# Suppress "warning C4291: ...no matching operator delete found" from third_party\mozjs-60
set_target_properties(robomongo PROPERTIES COMPILE_FLAGS "/wd4477 /wd4291")
# Start debug program with console
set_target_properties(robomongo PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:CONSOLE")
set_target_properties(robomongo PROPERTIES
OUTPUT_NAME "Robomongo")
# Seems that we do not need to do this with recent versions of Qt
target_link_libraries(robomongo PRIVATE Qt5::WinMain)
target_link_libraries(robomongo
PRIVATE
Qt5::WinMain)
elseif(SYSTEM_MACOSX)
string(TIMESTAMP CURRENT_YEAR "%Y")
set_target_properties(robomongo PROPERTIES
INSTALL_RPATH "@executable_path/../Frameworks"
OUTPUT_NAME "Robo 3T"
OUTPUT_NAME "Robomongo"
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/install/macosx/Info.plist.in"
MACOSX_BUNDLE_BUNDLE_NAME "Robo 3T"
MACOSX_BUNDLE_GUI_IDENTIFIER "com.3tsoftwarelabs.robo3t"
MACOSX_BUNDLE_INFO_STRING "Robo 3T ${PROJECT_VERSION}. Copyright 3T Software Labs Ltd, 2014 - ${CURRENT_YEAR}"
MACOSX_BUNDLE_BUNDLE_NAME "Robomongo"
MACOSX_BUNDLE_GUI_IDENTIFIER "com.paralect.Robomongo"
MACOSX_BUNDLE_INFO_STRING "Robomongo ${PROJECT_VERSION}. Copyright Paralect, 2013 - 2016"
MACOSX_BUNDLE_SHORT_VERSION "${PROJECT_VERSION}"
MACOSX_BUNDLE_LONG_VERSION "${PROJECT_VERSION}"
MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}"
MACOSX_BUNDLE_COPYRIGHT "Copyright 3T Software Labs Ltd, 2014 - ${CURRENT_YEAR}"
MACOSX_BUNDLE_ICON_FILE "robomongo")
MACOSX_BUNDLE_COPYRIGHT "Copyright Paralect, 2013 - 2016"
MACOSX_BUNDLE_ICON_FILE "Robomongo")
elseif(SYSTEM_LINUX)
set_target_properties(robomongo PROPERTIES
INSTALL_RPATH "$ORIGIN/../lib"
OUTPUT_NAME "robo3t")
INSTALL_RPATH "$ORIGIN/../lib")
endif()
# Install
include(RobomongoInstall)
#
# Tests targets (code below should be moved to separate file)
#
add_executable(tests WIN32 EXCLUDE_FROM_ALL app/main_test.cpp gui/editors/JSLexer.cpp)
target_link_libraries(tests Qt5::Widgets qjson qscintilla mongodb Threads::Threads)
target_include_directories(tests
+20 -63
View File
@@ -6,27 +6,20 @@
// Header "mongo/util/net/sock" is needed for mongo::enableIPv6()
// Header "mongo/platform/basic" is required by "sock.h" under Windows
#include <mongo/platform/basic.h>
#include <mongo/util/net/socket_utils.h>
#include <mongo/util/net/sock.h>
#include <mongo/base/initializer.h>
#include <mongo/util/net/ssl_options.h>
#include <mongo/db/service_context.h>
#include <mongo/transport/transport_layer_asio.h>
#include <mongo/shell/shell_options.h>
#include <mongo/db/storage/storage_engine_init.h>
#include "robomongo/core/AppRegistry.h"
#include "robomongo/core/settings/SettingsManager.h"
#include "robomongo/core/utils/Logger.h"
#include "robomongo/gui/MainWindow.h"
#include "robomongo/gui/AppStyle.h"
#include "robomongo/gui/dialogs/EulaDialog.h"
#include "robomongo/ssh/ssh.h"
#include "robomongo/utils/RoboCrypt.h"
int main(int argc, char *argv[], char** envp)
{
if (rbm_ssh_init())
if (rbm_ssh_init()) {
return 1;
}
// Please check, do we really need envp for other OSes?
#ifdef Q_OS_WIN
@@ -36,27 +29,8 @@ int main(int argc, char *argv[], char** envp)
// Support for IPv6 is disabled by default. Enable it.
mongo::enableIPv6(true);
// Perform SSL-enabled mongo initialization
mongo::sslGlobalParams.sslMode.store(mongo::SSLParams::SSLMode_allowSSL);
// Cross Platform High DPI support - Qt 5.7
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
// Initialization routine for MongoDB shell
mongo::runGlobalInitializersOrDie(argc, argv, envp);
mongo::setGlobalServiceContext(mongo::ServiceContext::make());
// Todo from mongo repo: This should use a TransportLayerManager or TransportLayerFactory
auto serviceContext = mongo::getGlobalServiceContext();
mongo::transport::TransportLayerASIO::Options opts;
// When true, it breaks connection to localhost, github #1757
opts.enableIPv6 = mongo::shellGlobalParams.enableIPv6;
opts.mode = mongo::transport::TransportLayerASIO::Options::kEgress;
serviceContext->setTransportLayer(
std::make_unique<mongo::transport::TransportLayerASIO>(opts, nullptr)
);
auto tlPtr = serviceContext->getTransportLayer();
uassertStatusOK(tlPtr->setup());
uassertStatusOK(tlPtr->start());
// Initialize Qt application
QApplication app(argc, argv);
@@ -65,47 +39,30 @@ int main(int argc, char *argv[], char** envp)
// This can cause a conflict when using POSIX functions, for instance, when
// converting between data types such as floats and strings, since the notation
// may differ between locales. To get around this problem, call the POSIX
// function setlocale(LC_NUMERIC, "C") right after initializing QApplication or
// function setlocale(LC_NUMERIC,"C") right after initializing QApplication or
// QCoreApplication to reset the locale that is used for number formatting to "C"-locale.
// (http://doc.qt.io/qt-5/qcoreapplication.html#locale-settings)
setlocale(LC_NUMERIC, "C");
#ifdef Q_OS_MAC
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
// EULA License Agreement
auto const& settings { Robomongo::AppRegistry::instance().settingsManager() };
if (!settings->acceptedEulaVersions().contains(PROJECT_VERSION)) {
bool const showFormPage { settings->programExitedNormally() && !settings->disableHttpsFeatures() };
Robomongo::EulaDialog eulaDialog(showFormPage);
settings->setProgramExitedNormally(false);
settings->save();
int const result = eulaDialog.exec();
settings->setProgramExitedNormally(true);
settings->save();
if (QDialog::Rejected == result) {
rbm_ssh_cleanup();
return 1;
}
// EULA accepted
settings->addAcceptedEulaVersion(PROJECT_VERSION);
settings->save();
}
// Init GUI style
Robomongo::AppStyleUtils::initStyle();
// To be set true at normal program exit
settings->setProgramExitedNormally(false);
settings->save();
// Application main window
Robomongo::MainWindow mainWindow;
mainWindow.show();
Robomongo::MainWindow win;
for(auto const& msgAndSeverity : Robomongo::RoboCrypt::roboCryptLogs())
Robomongo::LOG_MSG(msgAndSeverity.first, msgAndSeverity.second);
// Resize main window. We are trying to keep it "almost" maximized.
QRect screenGeometry = QApplication::desktop()->availableGeometry();
int horizontalMargin = (int)(screenGeometry.width() * 0.1);
int verticalMargin = (int)(screenGeometry.height() * 0.1);
int width = screenGeometry.width() - horizontalMargin;
int height = screenGeometry.height() - verticalMargin;
win.resize(QSize(width, height));
// Center main window
int x = (screenGeometry.width() - win.width()) / 2;
int y = (screenGeometry.height() - win.height()) / 2;
win.move(x, y);
win.show();
int rc = app.exec();
rbm_ssh_cleanup();
-7
View File
@@ -33,19 +33,12 @@ void precisionAssert(const std::string &text, double d) {
std::stringstream s;
s.precision(std::numeric_limits<double>::digits10);
s << d;
if (d == (long long)d)
s << ".0";
std::cout << "Checking " << text << " - ";
assert(text == s.str());
std::cout << "Correct. " << std::endl;
}
void testPrecision() {
precisionAssert("-9.987654321", -9.987654321);
precisionAssert("-1.0", -1.0);
precisionAssert("-0.0", -0.0);
precisionAssert("0.0", 0.0);
precisionAssert("9.0", 9.0);
precisionAssert("9.8", 9.8);
precisionAssert("9.9", 9.9);
precisionAssert("9.98", 9.98);
-17
View File
@@ -30,21 +30,4 @@ namespace Robomongo
class MongoDocument;
typedef boost::shared_ptr<MongoDocument> MongoDocumentPtr;
// todo: Use enum class
enum ConnectionType {
// This type of connection is shown in Explorer and also opens SSH tunnel for secondary
// connections (if needed)
ConnectionPrimary = 0,
// Never shown in Explorer and uses SSH tunnel from primary connection (if needed)
ConnectionSecondary = 1,
// The same as Primary, but is specifically for testing connections.
ConnectionTest = 2,
// Never shown in Explorer and can be used to refresh (via reconnecting) current connection view
// (i.e. db version, storage engine, current replica set primary, status of replica set etc...)
ConnectionRefresh = 3
};
}
+2 -2
View File
@@ -10,9 +10,9 @@ namespace
template<typename type, int size>
inline type findTypeInArray(const char *(&arr)[size], const char *text)
{
for (int i = 0; i < size; ++i )
for (int i=0; i < size;++i )
{
if (strcmp(text, arr[i]) == 0)
if (strcmp(text,arr[i])==0)
{
return static_cast<type>(i);
}
+17 -15
View File
@@ -13,11 +13,11 @@
namespace
{
struct RemoveIfReciver
struct RemoveIfReciver : public std::unary_function<const Robomongo::EventBus::SubscribersType&, bool>
{
RemoveIfReciver(QObject *receiver) : _receiver(receiver) {}
bool operator()(const Robomongo::EventBus::EventTypeAndSubscriber& item) const {
bool operator()(const Robomongo::EventBus::SubscribersType& item) const {
if (item.second->receiver == _receiver) {
delete item.second;
return true;
@@ -28,13 +28,13 @@ namespace
QObject *_receiver;
};
struct FindIfReciver
struct FindIfReciver : public std::unary_function<const Robomongo::EventBus::SubscribersType&, bool>
{
FindIfReciver(QThread *thread) : _thread(thread) {}
bool operator()(const Robomongo::EventBus::ThreadAndDispatcher &item) const {
if (item.first == _thread)
bool operator()(const Robomongo::EventBus::DispatchersType &item) const {
if (item.first == _thread) {
return true;
}
return false;
}
QThread *_thread;
@@ -50,16 +50,19 @@ namespace Robomongo
EventBus::~EventBus()
{
for (auto const& dispatchersByThread : _dispatchersByThread)
delete dispatchersByThread.second;
for (DispatchersContainerType::iterator it = _dispatchersByThread.begin(); it != _dispatchersByThread.end(); ++it) {
DispatchersType item = *it;
delete item.second;
}
}
void EventBus::publish(Event *event)
{
QMutexLocker lock(&_lock);
QList<QObject*> theReceivers;
EventBusDispatcher *dis = nullptr;
for (auto const& item : _subscribersByEventType) {
EventBusDispatcher *dis = NULL;
for (SubscribersContainerType::iterator it = _subscribersByEventType.begin(); it != _subscribersByEventType.end(); ++it ) {
SubscribersType item = *it;
if (event->type() == item.first) {
EventBusSubscriber *subscriber = item.second;
if (!subscriber->sender || subscriber->sender == event->sender()) {
@@ -115,7 +118,7 @@ namespace Robomongo
VERIFY(connect(receiver, SIGNAL(destroyed(QObject*)), this, SLOT(unsubscibe(QObject*))));
// add subscriber
_subscribersByEventType.push_back(EventTypeAndSubscriber(type, new EventBusSubscriber(dis, receiver, sender)));
_subscribersByEventType.push_back(SubscribersType(type, new EventBusSubscriber(dis, receiver, sender)));
}
void EventBus::unsubscibe(QObject *receiver)
@@ -131,9 +134,8 @@ namespace Robomongo
*/
EventBusDispatcher *EventBus::dispatcher(QThread *thread)
{
auto const& disIt = std::find_if(
_dispatchersByThread.begin(), _dispatchersByThread.end(), FindIfReciver(thread)
);
DispatchersContainerType::iterator disIt = std::find_if(
_dispatchersByThread.begin(), _dispatchersByThread.end(), FindIfReciver(thread));
if (disIt != _dispatchersByThread.end()) {
return (*disIt).second;
@@ -141,7 +143,7 @@ namespace Robomongo
else {
EventBusDispatcher *dis = new EventBusDispatcher();
dis->moveToThread(thread);
_dispatchersByThread.push_back(ThreadAndDispatcher(thread, dis));
_dispatchersByThread.push_back(DispatchersType(thread, dis));
return dis;
}
}
+6 -5
View File
@@ -21,9 +21,10 @@ namespace Robomongo
Q_OBJECT
public:
typedef std::pair<QEvent::Type, EventBusSubscriber *> EventTypeAndSubscriber;
typedef std::pair<QThread *, EventBusDispatcher *> ThreadAndDispatcher;
typedef std::pair<QEvent::Type, EventBusSubscriber *> SubscribersType;
typedef std::vector<SubscribersType > SubscribersContainerType;
typedef std::pair<QThread *, EventBusDispatcher *> DispatchersType;
typedef std::vector<DispatchersType> DispatchersContainerType;
EventBus();
~EventBus();
@@ -64,7 +65,7 @@ namespace Robomongo
private:
QMutex _lock;
std::vector<EventTypeAndSubscriber> _subscribersByEventType;
std::vector<ThreadAndDispatcher> _dispatchersByThread;
SubscribersContainerType _subscribersByEventType;
DispatchersContainerType _dispatchersByThread;
};
}

Some files were not shown because too many files have changed in this diff Show More