├── .clang-format ├── .github ├── ISSUE_TEMPLATE │ ├── bug.yml │ ├── config.yml │ └── feature.yml ├── actions │ └── publish-doxygen │ │ └── action.yml ├── advanced-issue-labeler.yml ├── auto_assign.yml └── workflows │ ├── Issue-Needs-Attention.yml │ ├── auto-assign.yml │ ├── check-changelog.yml │ ├── check-pr-title.yml │ ├── cmake.yml │ ├── conan.yml │ ├── issue-labeler.yml │ ├── lock-threads.yml │ ├── no-response.yml │ ├── publish-doxygen-on-release.yml │ ├── swiftpm.yml │ ├── vcpkg.yml │ └── wipe-clusters.yml ├── .gitignore ├── .gitmodules ├── Android.bp ├── CHANGELOG.md ├── CMakeLists.txt ├── CMakePresets.json ├── Doxyfile ├── LICENSE ├── Package.swift ├── README.md ├── cmake ├── ccache.cmake ├── cmake-build-xcode.sh ├── launch-c.in └── launch-cxx.in ├── conanfile.py ├── contributing └── release-process.md ├── dependencies.list ├── docs └── fix-doxygen-titles.sh ├── examples ├── Android │ ├── README.md │ └── RealmExample │ │ ├── .gitignore │ │ ├── .idea │ │ ├── .gitignore │ │ ├── compiler.xml │ │ ├── deploymentTargetDropDown.xml │ │ ├── gradle.xml │ │ ├── misc.xml │ │ └── vcs.xml │ │ ├── app │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── mongodb │ │ │ │ └── realmexample │ │ │ │ └── ExampleInstrumentedTest.kt │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── cpp │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── native-lib.cpp │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── mongodb │ │ │ │ │ └── realmexample │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── drawable │ │ │ │ └── ic_launcher_background.xml │ │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── values-night │ │ │ │ └── themes.xml │ │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── themes.xml │ │ │ │ └── xml │ │ │ │ ├── backup_rules.xml │ │ │ │ └── data_extraction_rules.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── mongodb │ │ │ └── realmexample │ │ │ └── ExampleUnitTest.kt │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── settings.gradle ├── Qt │ └── coffee │ │ ├── ApplicationFlow.qml │ │ ├── ApplicationFlowForm.ui.qml │ │ ├── Brewing.qml │ │ ├── BrewingForm.ui.qml │ │ ├── CMakeLists.txt │ │ ├── ChoosingCoffee.ui.qml │ │ ├── CoffeeButton.qml │ │ ├── Cup.qml │ │ ├── CupForm.ui.qml │ │ ├── EmptyCup.qml │ │ ├── EmptyCupForm.ui.qml │ │ ├── LICENSE.txt │ │ ├── NavigationButton.ui.qml │ │ ├── README.md │ │ ├── SideBar.qml │ │ ├── assets │ │ ├── coffee.gif │ │ └── setup.png │ │ ├── coffee.qdoc │ │ ├── coffee_manager.cpp │ │ ├── coffee_manager.hpp │ │ ├── images │ │ ├── cup structure │ │ │ ├── coffee_cup_large.png │ │ │ ├── coffee_cup_outline.png │ │ │ ├── cup elements │ │ │ │ ├── coffee_cup_back.png │ │ │ │ ├── coffee_cup_coverplate.png │ │ │ │ └── coffee_cup_front.png │ │ │ └── liquids │ │ │ │ ├── liquid_coffee.png │ │ │ │ ├── liquid_foam.png │ │ │ │ └── liquid_milk.png │ │ ├── icons │ │ │ ├── coffees │ │ │ │ ├── Americano.png │ │ │ │ ├── Espresso.png │ │ │ │ ├── Latte.png │ │ │ │ ├── Macchiato.png │ │ │ │ └── cappucino.png │ │ │ └── contents │ │ │ │ ├── coffee.png │ │ │ │ ├── milk.png │ │ │ │ └── sugar.png │ │ └── ui controls │ │ │ ├── buttons │ │ │ ├── back │ │ │ │ └── white.png │ │ │ └── go │ │ │ │ └── white.png │ │ │ └── line.png │ │ ├── imports │ │ └── Coffee │ │ │ ├── Constants.qml │ │ │ ├── TitilliumWeb-Regular.ttf │ │ │ └── qmldir │ │ ├── main.cpp │ │ ├── main.qml │ │ ├── qml.qrc │ │ ├── qt_attribution.json │ │ ├── qtquickcontrols2.conf │ │ └── realm_models.hpp ├── SPM │ ├── .gitignore │ ├── Package.swift │ ├── README.md │ └── Sources │ │ └── RealmCppExample │ │ └── main.cpp └── cmake │ ├── CMakeLists.txt │ ├── README.md │ ├── helloworld.cpp │ └── vcpkg.json ├── include └── cpprealm │ ├── accessors.hpp │ ├── analytics.hpp │ ├── app.hpp │ ├── bson.hpp │ ├── client_reset.hpp │ ├── db.hpp │ ├── flex_sync.hpp │ ├── internal │ ├── bridge │ │ ├── async_open_task.hpp │ │ ├── binary.hpp │ │ ├── col_key.hpp │ │ ├── decimal128.hpp │ │ ├── dictionary.hpp │ │ ├── list.hpp │ │ ├── lnklst.hpp │ │ ├── mixed.hpp │ │ ├── obj.hpp │ │ ├── obj_key.hpp │ │ ├── object.hpp │ │ ├── object_id.hpp │ │ ├── object_schema.hpp │ │ ├── property.hpp │ │ ├── query.hpp │ │ ├── realm.hpp │ │ ├── results.hpp │ │ ├── schema.hpp │ │ ├── set.hpp │ │ ├── status.hpp │ │ ├── sync_error.hpp │ │ ├── sync_manager.hpp │ │ ├── sync_session.hpp │ │ ├── table.hpp │ │ ├── thread_safe_reference.hpp │ │ ├── timestamp.hpp │ │ ├── utils.hpp │ │ └── uuid.hpp │ ├── networking │ │ ├── shims.hpp │ │ └── utils.hpp │ ├── scheduler │ │ └── realm_core_scheduler.hpp │ └── type_info.hpp │ ├── link.hpp │ ├── logger.hpp │ ├── macros.hpp │ ├── managed_binary.hpp │ ├── managed_decimal.hpp │ ├── managed_dictionary.hpp │ ├── managed_list.hpp │ ├── managed_mixed.hpp │ ├── managed_numeric.hpp │ ├── managed_objectid.hpp │ ├── managed_primary_key.hpp │ ├── managed_set.hpp │ ├── managed_string.hpp │ ├── managed_timestamp.hpp │ ├── managed_uuid.hpp │ ├── networking │ ├── http.hpp │ └── websocket.hpp │ ├── notifications.hpp │ ├── observation.hpp │ ├── rbool.hpp │ ├── results.hpp │ ├── scheduler.hpp │ ├── schedulers │ └── default_scheduler.hpp │ ├── schema.hpp │ ├── sdk.hpp │ ├── thread_safe_reference.hpp │ └── types.hpp ├── logo.png ├── ports ├── portfile.cmake ├── usage └── vcpkg.json ├── src ├── CMakeLists.txt ├── cpprealm │ ├── analytics.cpp │ ├── app.cpp │ ├── bson.cpp │ ├── client_reset.cpp │ ├── db.cpp │ ├── flex_sync.cpp │ ├── internal │ │ ├── bridge │ │ │ ├── async_open_task.cpp │ │ │ ├── binary.cpp │ │ │ ├── bridge_types.hpp.in │ │ │ ├── col_key.cpp │ │ │ ├── decimal128.cpp │ │ │ ├── dictionary.cpp │ │ │ ├── generator │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── bridge_type_info_generator.cpp.in │ │ │ │ └── bridge_type_info_parser.cmake │ │ │ ├── list.cpp │ │ │ ├── lnklst.cpp │ │ │ ├── mixed.cpp │ │ │ ├── obj.cpp │ │ │ ├── obj_key.cpp │ │ │ ├── object.cpp │ │ │ ├── object_id.cpp │ │ │ ├── object_schema.cpp │ │ │ ├── property.cpp │ │ │ ├── query.cpp │ │ │ ├── realm.cpp │ │ │ ├── results.cpp │ │ │ ├── schema.cpp │ │ │ ├── set.cpp │ │ │ ├── status.cpp │ │ │ ├── sync_error.cpp │ │ │ ├── sync_manager.cpp │ │ │ ├── sync_session.cpp │ │ │ ├── table.cpp │ │ │ ├── thread_safe_reference.cpp │ │ │ ├── timestamp.cpp │ │ │ └── uuid.cpp │ │ ├── networking │ │ │ ├── network_transport.cpp │ │ │ ├── shims.cpp │ │ │ └── utils.cpp │ │ ├── scheduler │ │ │ └── realm_core_scheduler.cpp │ │ └── version_numbers.hpp.in │ ├── logger.cpp │ ├── managed_binary.cpp │ ├── managed_decimal.cpp │ ├── managed_numeric.cpp │ ├── managed_objectid.cpp │ ├── managed_primary_key.cpp │ ├── managed_string.cpp │ ├── managed_timestamp.cpp │ ├── managed_uuid.cpp │ ├── networking │ │ ├── http.cpp │ │ └── websocket.cpp │ ├── schedulers │ │ └── default_scheduler.cpp │ ├── sdk.cpp │ ├── types.cpp │ └── util │ │ └── config.h.in └── libcurl │ └── module.modulemap ├── tests ├── CMakeLists.txt ├── admin_utils.cpp ├── admin_utils.hpp ├── aosp │ ├── Android.bp │ ├── README.md │ └── main.cpp ├── conanfile.py ├── config_overrides.json ├── db │ ├── binary_tests.cpp │ ├── bson_tests.cpp │ ├── date_tests.cpp │ ├── decimal_tests.cpp │ ├── embedded_object_tests.cpp │ ├── frozen_tests.cpp │ ├── list_tests.cpp │ ├── map_tests.cpp │ ├── mixed_tests.cpp │ ├── numeric_tests.cpp │ ├── object_id_tests.cpp │ ├── object_tests.cpp │ ├── optional_tests.cpp │ ├── performance_tests.cpp │ ├── query_tests.cpp │ ├── realm_tests.cpp │ ├── results_tests.cpp │ ├── scheduler_tests.cpp │ ├── set_tests.cpp │ ├── string_tests.cpp │ ├── test_objects.hpp │ └── uuid_tests.cpp ├── dependencies.list ├── external │ └── generated │ │ ├── Dummy.m │ │ └── catch2 │ │ └── catch_user_config.hpp ├── main.cpp ├── main.hpp ├── setup_baas.rb ├── sync │ ├── app_tests.cpp │ ├── asymmetric_object_tests.cpp │ ├── client_reset_tests.cpp │ ├── flexible_sync_tests.cpp │ ├── networking_tests.cpp │ └── test_objects.hpp ├── utils │ └── networking │ │ ├── proxy_server.cpp │ │ └── proxy_server.hpp └── vcpkg.json └── tools ├── cmake ├── Config.cmake.in └── GetVersion.cmake └── generate-version-numbers-for-soong.sh /.clang-format: -------------------------------------------------------------------------------- 1 | # Generated from CLion C/C++ Code Style settings 2 | BasedOnStyle: LLVM 3 | AccessModifierOffset: -4 4 | AlignAfterOpenBracket: Align 5 | AlignConsecutiveAssignments: None 6 | AlignOperands: Align 7 | AllowAllArgumentsOnNextLine: false 8 | AllowAllConstructorInitializersOnNextLine: false 9 | AllowAllParametersOfDeclarationOnNextLine: false 10 | AllowShortBlocksOnASingleLine: Always 11 | AllowShortCaseLabelsOnASingleLine: false 12 | AllowShortFunctionsOnASingleLine: All 13 | AllowShortIfStatementsOnASingleLine: Always 14 | AllowShortLambdasOnASingleLine: All 15 | AllowShortLoopsOnASingleLine: true 16 | AlwaysBreakAfterReturnType: None 17 | AlwaysBreakTemplateDeclarations: Yes 18 | BreakBeforeBraces: Custom 19 | BraceWrapping: 20 | AfterCaseLabel: false 21 | AfterClass: false 22 | AfterControlStatement: Never 23 | AfterEnum: false 24 | AfterFunction: false 25 | AfterNamespace: false 26 | AfterUnion: false 27 | BeforeCatch: false 28 | BeforeElse: false 29 | IndentBraces: false 30 | SplitEmptyFunction: false 31 | SplitEmptyRecord: true 32 | BreakBeforeBinaryOperators: None 33 | BreakBeforeTernaryOperators: true 34 | BreakConstructorInitializers: BeforeColon 35 | BreakInheritanceList: BeforeColon 36 | ColumnLimit: 0 37 | CompactNamespaces: false 38 | ContinuationIndentWidth: 8 39 | IndentCaseLabels: true 40 | IndentPPDirectives: None 41 | IndentWidth: 4 42 | KeepEmptyLinesAtTheStartOfBlocks: true 43 | MaxEmptyLinesToKeep: 2 44 | NamespaceIndentation: All 45 | ObjCSpaceAfterProperty: false 46 | ObjCSpaceBeforeProtocolList: true 47 | PointerAlignment: Right 48 | ReflowComments: false 49 | SpaceAfterCStyleCast: true 50 | SpaceAfterLogicalNot: false 51 | SpaceAfterTemplateKeyword: false 52 | SpaceBeforeAssignmentOperators: true 53 | SpaceBeforeCpp11BracedList: false 54 | SpaceBeforeCtorInitializerColon: true 55 | SpaceBeforeInheritanceColon: true 56 | SpaceBeforeParens: ControlStatements 57 | SpaceBeforeRangeBasedForLoopColon: false 58 | SpaceInEmptyParentheses: false 59 | SpacesBeforeTrailingComments: 0 60 | SpacesInAngles: false 61 | SpacesInCStyleCastParentheses: false 62 | SpacesInContainerLiterals: false 63 | SpacesInParentheses: false 64 | SpacesInSquareBrackets: false 65 | TabWidth: 4 66 | UseTab: Never 67 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: File a bug report 3 | labels: [T-Bug] 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | Thanks for taking the time to fill out this bug report! 9 | - type: textarea 10 | id: what-happened 11 | attributes: 12 | label: What happened? 13 | description: Tell us, what did you expect to happen? 14 | placeholder: Tell us what you see! 15 | value: "A bug happened!" 16 | validations: 17 | required: true 18 | - type: textarea 19 | id: repro-steps 20 | attributes: 21 | label: Repro steps 22 | description: If you can reproduce the issue, please provide detailed repro steps here or provide a link to a repro project. 23 | placeholder: 1. X, 2. Y, 3. Crash! 24 | validations: 25 | required: true 26 | - type: input 27 | id: version 28 | attributes: 29 | label: Version 30 | description: What version of the C++ SDK are you using? 31 | placeholder: e.g. 0.6.1-preview 32 | validations: 33 | required: true 34 | - type: input 35 | id: install-method 36 | attributes: 37 | label: Installation method 38 | description: How are you installing the C++ SDK? 39 | placeholder: e.g. CMake 3.15 40 | validations: 41 | required: true 42 | - type: dropdown 43 | id: services 44 | attributes: 45 | label: What Atlas Services are you using? 46 | options: 47 | - -- select -- 48 | - Local Database only 49 | - Atlas Device Sync 50 | - 'Atlas App Services: Functions or GraphQL or DataAPI etc' 51 | - Both Atlas Device Sync and Atlas App Services 52 | validations: 53 | required: true 54 | - type: input 55 | id: compiler 56 | attributes: 57 | label: Compiler 58 | description: What compiler are you using? 59 | placeholder: e.g. Clang 16.0.6 60 | validations: 61 | required: true 62 | - type: input 63 | id: client-platforms 64 | attributes: 65 | label: OS and version 66 | description: What OS (name and version) are you seeing the issue on? 67 | placeholder: e.g. Ubuntu 18.04 68 | validations: 69 | required: true 70 | - type: textarea 71 | id: code-snippets 72 | attributes: 73 | label: Code snippets 74 | description: Please provide a code sample or test case that highlights the issue. If relevant, include your model definitions. 75 | placeholder: Your code here 76 | - type: textarea 77 | id: stacktrace 78 | attributes: 79 | label: Stacktrace of the exception/crash you're getting 80 | description: If you're getting an exception or a crash, please paste the stacktrace here. 81 | render: shell 82 | - type: textarea 83 | id: logs 84 | attributes: 85 | label: Relevant log output 86 | description: Please copy and paste any relevant log output. 87 | render: shell 88 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: General Questions and Inquiries 4 | url: https://www.mongodb.com/community/forums/tags/c/atlas-app-services-realm/realm/58/cxx 5 | about: Please ask general design/architecture questions in the community forums. 6 | - name: MongoDB Atlas Device Sync Production Issues 7 | url: https://support.mongodb.com/ 8 | about: Please report urgent production issues to the support portal directly. 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature.yml: -------------------------------------------------------------------------------- 1 | # NOTE: This is a common file that is overwritten by realm/ci-actions sync service 2 | # and should only be modified in that repository. 3 | 4 | name: Feature Request 5 | description: Request a new feature or enhancement 6 | labels: [T-Enhancement] 7 | body: 8 | - type: markdown 9 | attributes: 10 | value: | 11 | Thanks for taking the time to suggest improvements to Realm! 12 | - type: textarea 13 | id: problem 14 | attributes: 15 | label: Problem 16 | description: A clear and concise description of the problem you are trying to solve. 17 | validations: 18 | required: true 19 | - type: textarea 20 | id: solution 21 | attributes: 22 | label: Solution 23 | description: Describe the solution you envision, including API and usage example if possible. 24 | validations: 25 | required: false 26 | - type: textarea 27 | id: alternative-solution 28 | attributes: 29 | label: Alternatives 30 | description: Describe the alternative solutions or features you have considered 31 | validations: 32 | required: false 33 | - type: dropdown 34 | id: importance 35 | attributes: 36 | label: How important is this improvement for you? 37 | options: 38 | - -- select -- 39 | - Dealbreaker 40 | - Would be a major improvement 41 | - I would like to have it but have a workaround 42 | - Fairly niche but nice to have anyway 43 | validations: 44 | required: true 45 | - type: dropdown 46 | id: sync 47 | attributes: 48 | label: Feature would mainly be used with 49 | options: 50 | - -- select -- 51 | - Local Database only 52 | - Atlas Device Sync 53 | - 'Atlas App Services: Auth or Functions etc' 54 | validations: 55 | required: true 56 | -------------------------------------------------------------------------------- /.github/actions/publish-doxygen/action.yml: -------------------------------------------------------------------------------- 1 | name: "Publish Doxygen Docs" 2 | description: "Generate and push the Doxygen docs to the S3 bucket." 3 | inputs: 4 | version: 5 | description: "The version string to paste into the docs." 6 | required: true 7 | destination: 8 | description: "The destination directory on the S3 bucket." 9 | required: true 10 | AWS_S3_BUCKET: 11 | description: "The AWS S3 bucket name." 12 | required: true 13 | AWS_ACCESS_KEY_ID: 14 | description: "The AWS public key." 15 | required: true 16 | AWS_SECRET_ACCESS_KEY: 17 | description: "The AWS private key." 18 | required: true 19 | runs: 20 | using: "composite" 21 | steps: 22 | - name: Build docs 23 | uses: mattnotmitt/doxygen-action@1.9.4 24 | env: 25 | DOXYGEN_PROJECT_NUMBER: ${{ inputs.version }} 26 | - name: Fix doxygen titles for SEO 27 | shell: bash 28 | run: bash docs/fix-doxygen-titles.sh 29 | - name: Upload docs 30 | uses: jakejarvis/s3-sync-action@master 31 | with: 32 | args: --acl public-read --delete 33 | env: 34 | AWS_S3_BUCKET: ${{ inputs.AWS_S3_BUCKET }} 35 | AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }} 36 | AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }} 37 | SOURCE_DIR: docs/modified-doxygen-output 38 | DEST_DIR: docs/realm-sdks/cpp/${{ inputs.destination }} 39 | -------------------------------------------------------------------------------- /.github/advanced-issue-labeler.yml: -------------------------------------------------------------------------------- 1 | # NOTE: This is a common file that is overwritten by realm/ci-actions sync service 2 | # and should only be modified in that repository. 3 | 4 | # syntax - https://github.com/redhat-plumbers-in-action/advanced-issue-labeler#policy 5 | # Below keys map from the option used in issue form dropdowns to issue labels 6 | # Limitation: 7 | # Currently it's not possible to use strings containing ,␣ in the dropdown menus in the issue forms. 8 | 9 | --- 10 | 11 | policy: 12 | - template: [bug.yml, feature.yml] 13 | section: 14 | - id: [frequency] 15 | label: 16 | - name: 'Frequency:Once' 17 | keys: ['Once'] 18 | - name: 'Frequency:Sometimes' 19 | keys: ['Sometimes'] 20 | - name: 'Frequency:Always' 21 | keys: ['Always'] 22 | 23 | - id: [repro] 24 | label: 25 | - name: 'Repro:Always' 26 | keys: ['Always'] 27 | - name: 'Repro:Sometimes' 28 | keys: ['Sometimes'] 29 | - name: 'Repro:No' 30 | keys: ['No'] 31 | 32 | - id: [sync, flavour, services] 33 | block-list: [] 34 | label: 35 | - name: 'SDK-Use:Local' 36 | keys: ['Local Database only'] 37 | - name: 'SDK-Use:Sync' 38 | keys: ['Atlas Device Sync'] 39 | - name: 'SDK-Use:Services' 40 | keys: ['Atlas App Services: Function or GraphQL or DataAPI etc'] 41 | - name: ['SDK-Use:All'] 42 | keys: ['Both Atlas Device Sync and Atlas App Services'] 43 | 44 | - id: [encryption] 45 | block-list: [] 46 | label: 47 | - name: 'Encryption:On' 48 | keys: ['Yes'] 49 | - name: 'Encryption:Off' 50 | keys: ['No'] 51 | 52 | - id: [app-type] 53 | block-list: [] 54 | label: 55 | - name: 'App-type:Unity' 56 | keys: ['Unity'] 57 | - name: 'App-type:Xamarin' 58 | keys: ['Xamarin'] 59 | - name: 'App-type:WPF' 60 | keys: ['WPF'] 61 | - name: 'App-type:Console' 62 | keys: ['Console or Server'] 63 | - name: 'App-type:Other' 64 | keys: ['Other'] 65 | 66 | - id: [importance] 67 | block-list: [] 68 | label: 69 | - name: 'Importance:Dealbraker' 70 | keys: ['Dealbreaker'] 71 | - name: 'Importance:Major' 72 | keys: ['Would be a major improvement'] 73 | - name: 'Importance:Workaround' 74 | keys: ['I would like to have it but have a workaround'] 75 | - name: 'Importance:Nice' 76 | keys: ['Fairly niche but nice to have anyway'] 77 | -------------------------------------------------------------------------------- /.github/auto_assign.yml: -------------------------------------------------------------------------------- 1 | addAssignees: author 2 | addReviewers: false 3 | runOnDraft: true 4 | -------------------------------------------------------------------------------- /.github/workflows/Issue-Needs-Attention.yml: -------------------------------------------------------------------------------- 1 | # NOTE: This is a common file that is overwritten by realm/ci-actions sync service 2 | # and should only be modified in that repository. 3 | 4 | name: Issue Needs Attention 5 | # This workflow is triggered on issue comments. 6 | on: 7 | issue_comment: 8 | types: created 9 | 10 | jobs: 11 | applyNeedsAttentionLabel: 12 | uses: realm/ci-actions/.github/workflows/issue-needs-attention.yml@main 13 | -------------------------------------------------------------------------------- /.github/workflows/auto-assign.yml: -------------------------------------------------------------------------------- 1 | # NOTE: This is a common file that is overwritten by realm/ci-actions sync service 2 | # and should only be modified in that repository. 3 | 4 | name: 'Auto Assign' 5 | on: 6 | pull_request: 7 | types: [opened] 8 | 9 | jobs: 10 | add-assignee: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: kentaro-m/auto-assign-action@248761c4feb3917c1b0444e33fad1a50093b9847 14 | -------------------------------------------------------------------------------- /.github/workflows/check-changelog.yml: -------------------------------------------------------------------------------- 1 | # NOTE: This is a common file that is overwritten by realm/ci-actions sync service 2 | # and should only be modified in that repository. 3 | 4 | name: "Check Changelog" 5 | on: 6 | pull_request: 7 | types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] 8 | 9 | jobs: 10 | changelog: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v4 15 | with: 16 | submodules: false 17 | - name: Enforce Changelog 18 | uses: dangoslen/changelog-enforcer@c0b9fd225180a405c5f21f7a74b99e2eccc3e951 19 | with: 20 | skipLabels: no-changelog 21 | missingUpdateErrorMessage: Please add an entry in CHANGELOG.md or apply the 'no-changelog' label to skip this check. 22 | -------------------------------------------------------------------------------- /.github/workflows/check-pr-title.yml: -------------------------------------------------------------------------------- 1 | # NOTE: This is a common file that is overwritten by realm/ci-actions sync service 2 | # and should only be modified in that repository. 3 | 4 | name: "Check PR Title" 5 | on: 6 | pull_request: 7 | types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled, converted_to_draft, edited] 8 | 9 | jobs: 10 | check-pr-title: 11 | name: Check PR Title 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v4 15 | with: 16 | submodules: false 17 | - name: Enforce PR title 18 | uses: realm/ci-actions/title-checker@main 19 | with: 20 | regex: R[A-Z]{2,6}-[0-9]{1,6} 21 | error-hint: Invalid PR title. Make sure it's prefixed with the JIRA ticket the PR addresses or add the no-jira-ticket label. 22 | ignore-labels: 'no-jira-ticket' -------------------------------------------------------------------------------- /.github/workflows/conan.yml: -------------------------------------------------------------------------------- 1 | name: Test Conan integration 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | 9 | jobs: 10 | build: 11 | runs-on: ${{ matrix.os }} 12 | strategy: 13 | matrix: 14 | os: [ubuntu-latest, windows-latest, macos-latest] 15 | build_type: [Debug, Release] 16 | linkage_is_dynamic: ["True", "False"] 17 | 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v2 21 | with: 22 | submodules: 'recursive' 23 | 24 | - name: Select Python 3.10 25 | if: matrix.os == 'macos-latest' 26 | # otherwise turtlebrowser/get-conan@v1.1 fails on macos-12 27 | uses: actions/setup-python@v4 28 | with: 29 | python-version: '3.10' 30 | 31 | - name: Install Conan 32 | id: conan 33 | uses: turtlebrowser/get-conan@main 34 | 35 | - name: Conan version 36 | run: echo "${{ steps.conan.outputs.version }}" 37 | 38 | - name: Conan profile detect 39 | working-directory: . 40 | run: | 41 | conan profile detect 42 | 43 | - name: Update Conan profile 44 | if: matrix.os == 'windows-latest' 45 | run: | 46 | $profilePath = "$env:USERPROFILE\.conan2\profiles\default" 47 | $content = Get-Content -Path $profilePath 48 | $content = $content -replace 'compiler.cppstd=14', 'compiler.cppstd=17' 49 | $content | Set-Content -Path $profilePath 50 | 51 | - name: Conan create 52 | working-directory: . 53 | run: | 54 | conan create . -tf="tests" -s build_type=${{ matrix.build_type }} -o shared=${{ matrix.linkage_is_dynamic }} --build=missing 55 | 56 | - name: Open a tmate debug session 57 | if: ${{ failure() }} 58 | uses: mxschmitt/action-tmate@v3 59 | with: 60 | timeout-minutes: 15 -------------------------------------------------------------------------------- /.github/workflows/issue-labeler.yml: -------------------------------------------------------------------------------- 1 | # NOTE: This is a common file that is overwritten by realm/ci-actions sync service 2 | # and should only be modified in that repository. 3 | 4 | # See configuration in .github/advanced-issue-labeler.yml 5 | 6 | name: Issue labeler (policy) 7 | on: 8 | issues: 9 | types: [ opened ] 10 | 11 | jobs: 12 | label-issues-policy: 13 | runs-on: ubuntu-latest 14 | permissions: 15 | issues: write 16 | 17 | strategy: 18 | matrix: 19 | template: [ bug.yml, feature.yml ] 20 | 21 | steps: 22 | - uses: actions/checkout@v4 23 | 24 | - name: Parse issue form 25 | uses: stefanbuck/github-issue-parser@c1a559d78bfb8dd05216dab9ffd2b91082ff5324 # v3.0.1 26 | id: issue-parser 27 | with: 28 | template-path: .github/ISSUE_TEMPLATE/${{ matrix.template }} 29 | 30 | - name: Set labels based on policy 31 | uses: redhat-plumbers-in-action/advanced-issue-labeler@6ee6fddfd744ee26b977e6a0436916f256896971 # v2.0.3 32 | with: 33 | issue-form: ${{ steps.issue-parser.outputs.jsonString }} 34 | template: ${{ matrix.template }} 35 | token: ${{ secrets.GITHUB_TOKEN }} 36 | -------------------------------------------------------------------------------- /.github/workflows/lock-threads.yml: -------------------------------------------------------------------------------- 1 | name: 'Lock Threads' 2 | 3 | on: 4 | schedule: 5 | - cron: '0 * * * *' 6 | workflow_dispatch: 7 | 8 | permissions: 9 | issues: write 10 | pull-requests: write 11 | discussions: write 12 | 13 | concurrency: 14 | group: lock-threads 15 | 16 | jobs: 17 | action: 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: dessant/lock-threads@v5 21 | with: 22 | issue-inactive-days: 30 23 | pr-inactive-days: 30 24 | log-output: true 25 | -------------------------------------------------------------------------------- /.github/workflows/no-response.yml: -------------------------------------------------------------------------------- 1 | # NOTE: This is a common file that is overwritten by realm/ci-actions sync service 2 | # and should only be modified in that repository. 3 | 4 | name: No Response 5 | 6 | # Both `issue_comment` and `scheduled` event types are required for this Action 7 | # to work properly. 8 | on: 9 | issue_comment: 10 | types: [created] 11 | schedule: 12 | # Schedule at 00:00 every day 13 | - cron: '0 0 * * *' 14 | 15 | jobs: 16 | noResponse: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: lee-dohm/no-response@v0.5.0 20 | with: 21 | token: ${{ github.token }} 22 | responseRequiredLabel: More-information-needed 23 | -------------------------------------------------------------------------------- /.github/workflows/publish-doxygen-on-release.yml: -------------------------------------------------------------------------------- 1 | name: Publish Doxygen Docs on Release 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | publish: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v3 12 | - uses: ./.github/actions/publish-doxygen 13 | with: 14 | version: Version ${{github.ref_name}} 15 | destination: ${{github.ref_name}} 16 | AWS_S3_BUCKET: ${{ secrets.DOCS_AWS_S3_BUCKET }} 17 | AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_AWS_ACCESS_KEY_ID }} 18 | AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY }} 19 | - uses: ./.github/actions/publish-doxygen 20 | with: 21 | version: Version ${{github.ref_name}} 22 | destination: latest 23 | AWS_S3_BUCKET: ${{ secrets.DOCS_AWS_S3_BUCKET }} 24 | AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_AWS_ACCESS_KEY_ID }} 25 | AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY }} 26 | -------------------------------------------------------------------------------- /.github/workflows/swiftpm.yml: -------------------------------------------------------------------------------- 1 | name: SwiftPM Build 2 | 3 | env: 4 | REALM_CI: true 5 | REALM_DISABLE_ANALYTICS: true 6 | 7 | on: 8 | push: 9 | branches: 10 | - main 11 | pull_request: 12 | 13 | jobs: 14 | build: 15 | runs-on: macos-13 16 | name: ${{ matrix.platform }} ${{ matrix.configuration }}, Xcode ${{ matrix.xcode }} 17 | strategy: 18 | fail-fast: false 19 | max-parallel: 6 20 | matrix: 21 | platform: 22 | - macOS 23 | - macOS,variant=Mac Catalyst 24 | - iOS 25 | - iOS Simulator 26 | - tvOS 27 | - tvOS Simulator 28 | xcode: 29 | - '15.0' 30 | configuration: 31 | - Debug 32 | - Release 33 | exclude: 34 | - configuration: ${{ github.event_name == 'pull_request' && 'Debug' || 'none' }} 35 | steps: 36 | - name: Checkout 37 | uses: actions/checkout@v2 38 | with: 39 | # git-restore-mtime-bare uses the ref log to find the correct timestamp 40 | # for each file. This requires a full git history. The default value (1) 41 | # creates a shallow checkout. 42 | fetch-depth: 0 43 | submodules: 'recursive' 44 | # Restore timestamps so that DerivedData caching can work across runs 45 | - name: Restore timestamps 46 | uses: chetan/git-restore-mtime-action@v1 47 | 48 | - name: Setup Xcode 49 | uses: maxim-lobanov/setup-xcode@v1 50 | with: 51 | xcode-version: ${{ matrix.xcode }} 52 | 53 | - uses: ammaraskar/gcc-problem-matcher@master 54 | 55 | - name: Compute cache key 56 | id: platform-escaped 57 | shell: pwsh 58 | run: echo "::set-output name=value::$([uri]::EscapeDataString('${{ matrix.platform }}'))" 59 | 60 | - name: Cache Derived Data 61 | uses: actions/cache@v2 62 | with: 63 | path: .build/derivedData 64 | key: swiftpm-derivedData-${{ steps.platform-escaped.outputs.value }}-${{ matrix.configuration }}-xcode-${{ matrix.xcode }}-derivedData-cache-${{ github.sha }} 65 | restore-keys: | 66 | swiftpm-derivedData-${{ steps.platform-escaped.outputs.value }}-${{ matrix.configuration }}-xcode-${{ matrix.xcode }}-derivedData-cache- 67 | 68 | # https://stackoverflow.com/questions/53753511/is-it-possible-to-copy-an-xcode-derived-data-cache 69 | - name: Avoid inode changes for DerivedData 70 | run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES 71 | 72 | - name: Build 73 | run: | 74 | scheme=realm-tests 75 | xcodebuild -scheme $scheme -destination "generic/platform=${{ matrix.platform }}" -configuration ${{ matrix.configuration }} -derivedDataPath .build/derivedData 76 | 77 | - name: Open a tmate debug session 78 | if: ${{ failure() && runner.debug }} 79 | uses: mxschmitt/action-tmate@v3 80 | with: 81 | timeout-minutes: 15 82 | -------------------------------------------------------------------------------- /.github/workflows/wipe-clusters.yml: -------------------------------------------------------------------------------- 1 | name: Wipe all clusters and apps 2 | 3 | on: 4 | workflow_dispatch: 5 | jobs: 6 | main: 7 | runs-on: ubuntu-latest 8 | name: Wipe all clusters and apps 9 | steps: 10 | - uses: realm/ci-actions/mdb-realm/deleteAllClusters@28a12a22e135d56db2b678fbe6479c0e1b52f169 11 | with: 12 | realmUrl: ${{ secrets.APPSERVICES_QA_BASE_URL }} 13 | atlasUrl: ${{ secrets.ATLAS_QA_BASE_URL }} 14 | projectId: ${{ secrets.ATLAS_QA_PROJECT_ID }} 15 | apiKey: ${{ secrets.ATLAS_QA_API_KEY }} 16 | privateApiKey: ${{ secrets.ATLAS_QA_PRIVATE_API_KEY }} 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.build 3 | /Packages 4 | /*.xcodeproj 5 | /.swiftpm 6 | xcuserdata/ 7 | DerivedData/ 8 | Package.resolved 9 | # Qt demo apps 10 | examples/*.pro.user 11 | docs/html 12 | docs/latex 13 | .idea/ 14 | realm-core/src/realm/parser/generated/ -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "realm-core"] 2 | path = realm-core 3 | url = https://github.com/realm/realm-core.git 4 | [submodule "Catch2"] 5 | path = Catch2 6 | url = https://github.com/catchorg/Catch2/ 7 | -------------------------------------------------------------------------------- /Android.bp: -------------------------------------------------------------------------------- 1 | package { 2 | default_applicable_licenses: ["external_realm_cpp_license"], 3 | } 4 | 5 | license { 6 | name: "external_realm_cpp_license", 7 | visibility: [":__subpackages__"], 8 | license_kinds: [ 9 | "SPDX-license-identifier-Apache-2.0" 10 | ], 11 | license_text: [ 12 | "LICENSE", 13 | ], 14 | } 15 | 16 | genrule { 17 | name: "gen_realmcxx_version_numbers", 18 | srcs: [ 19 | "dependencies.list", 20 | "src/cpprealm/internal/version_numbers.hpp.in", 21 | ], 22 | out: ["cpprealm/version_numbers.hpp"], 23 | tool_files: ["tools/generate-version-numbers-for-soong.sh"], 24 | cmd: "$(location) $(in) > $(out)", 25 | } 26 | 27 | 28 | cc_defaults { 29 | name: "realm_cpp_defaults", 30 | cflags: [ 31 | "-DREALM_AOSP_VENDOR=1" 32 | ], 33 | cppflags: [ 34 | "-Wno-delete-non-abstract-non-virtual-dtor", 35 | "-Wno-mismatched-tags", 36 | "-Wno-unused-parameter", 37 | "-Wno-reorder-ctor", 38 | "-Wno-unused-function", 39 | "-Wno-unused-local-typedef", 40 | "-Wno-unused-variable" 41 | ], 42 | generated_headers: ["gen_realmcxx_version_numbers"] 43 | } 44 | 45 | cc_library_static { 46 | name: "realm-cpp", 47 | defaults: ["realm_consumer_defaults", "realm_defaults", "realm_cpp_defaults"], 48 | srcs: ["src/cpprealm/**/*.cpp"], 49 | export_include_dirs: ["include"], 50 | export_generated_headers: ["gen_realmcxx_version_numbers"], 51 | static_libs: ["realm"], 52 | include_build_directory: false, 53 | vendor: true 54 | } -------------------------------------------------------------------------------- /cmake/ccache.cmake: -------------------------------------------------------------------------------- 1 | find_program(CCACHE_PROGRAM ccache) 2 | if(CCACHE_PROGRAM) 3 | message(STATUS "Found Ccache: ${CCACHE_PROGRAM}") 4 | if(CMAKE_GENERATOR STREQUAL "Xcode") 5 | # Set up wrapper scripts 6 | configure_file("${CMAKE_CURRENT_LIST_DIR}/launch-c.in" "${CMAKE_BINARY_DIR}/launch-c" @ONLY) 7 | configure_file("${CMAKE_CURRENT_LIST_DIR}/launch-cxx.in" "${CMAKE_BINARY_DIR}/launch-cxx" @ONLY) 8 | execute_process(COMMAND chmod a+rx 9 | "${CMAKE_BINARY_DIR}/launch-c" 10 | "${CMAKE_BINARY_DIR}/launch-cxx" 11 | ) 12 | 13 | # Set Xcode project attributes to route compilation and linking 14 | # through our scripts 15 | set(CMAKE_XCODE_ATTRIBUTE_CC "${CMAKE_BINARY_DIR}/launch-c") 16 | set(CMAKE_XCODE_ATTRIBUTE_CXX "${CMAKE_BINARY_DIR}/launch-cxx") 17 | set(CMAKE_XCODE_ATTRIBUTE_LD "${CMAKE_BINARY_DIR}/launch-c") 18 | set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${CMAKE_BINARY_DIR}/launch-cxx") 19 | else() 20 | # Support Unix Makefiles and Ninja 21 | set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") 22 | set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") 23 | endif() 24 | else() 25 | message(WARNING "ccache was not found") 26 | endif() 27 | -------------------------------------------------------------------------------- /cmake/cmake-build-xcode.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eo pipefail 4 | 5 | XCODEBUILD_ARGS=() 6 | for arg in "$@" 7 | do 8 | if [ "$arg" = "-target" ]; then 9 | arg="-scheme" 10 | fi 11 | XCODEBUILD_ARGS+=("$arg") 12 | done 13 | 14 | xcodebuild "${XCODEBUILD_ARGS[@]}" 15 | -------------------------------------------------------------------------------- /cmake/launch-c.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export CCACHE_CPP2=true 4 | exec "@CCACHE_PROGRAM@" "@CMAKE_C_COMPILER@" "$@" 5 | -------------------------------------------------------------------------------- /cmake/launch-cxx.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export CCACHE_CPP2=true 4 | exec "@CCACHE_PROGRAM@" "@CMAKE_CXX_COMPILER@" "$@" 5 | -------------------------------------------------------------------------------- /conanfile.py: -------------------------------------------------------------------------------- 1 | from conan import ConanFile 2 | from conan.tools.build import check_min_cppstd, can_run 3 | from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps 4 | from conan.tools.scm import Git 5 | 6 | class cpprealmRecipe(ConanFile): 7 | name = "cpprealm" 8 | version = "2.2.0" 9 | 10 | # Optional metadata 11 | license = "Apache-2.0" 12 | url = "https://github.com/realm/realm-cpp" 13 | description = "Realm is a mobile database that runs directly inside phones, tablets or wearables." 14 | 15 | # Binary configuration 16 | settings = "os", "compiler", "build_type", "arch" 17 | options = {"shared": [True, False]} 18 | default_options = {"shared": False} 19 | 20 | def is_darwin(self): 21 | return self.settings.os == "Macos" or self.settings.os == "iOS" or self.settings.os == "watchOS" 22 | 23 | def validate(self): 24 | check_min_cppstd(self, "17") 25 | 26 | def requirements(self): 27 | self.requires(self.tested_reference_str) 28 | if not self.is_darwin() and not self.settings.os == "Emscripten": 29 | self.requires("zlib/1.3") 30 | if not self.is_darwin(): 31 | self.requires("openssl/3.2.0") 32 | self.requires("libuv/1.48.0") 33 | def source(self): 34 | git = Git(self) 35 | git.clone(url="https://github.com/realm/realm-cpp", target=".") 36 | git.folder = "." 37 | git.checkout(commit="5ec1bda338dfd0c91ce1eea2ccb2c0adf7d86690") 38 | git.run("submodule update --init --recursive") 39 | 40 | def layout(self): 41 | cmake_layout(self) 42 | 43 | def generate(self): 44 | deps = CMakeDeps(self) 45 | deps.generate() 46 | tc = CMakeToolchain(self) 47 | tc.variables["USES_CONAN"] = "ON" 48 | tc.variables["REALM_CPP_NO_TESTS"] = "ON" 49 | tc.variables["REALM_CORE_SUBMODULE_BUILD"] = "ON" 50 | tc.variables["REALM_USE_SYSTEM_OPENSSL"] = "ON" 51 | if self.settings.os == "Windows": 52 | self.cpp_info.cxxflags = ["/Zc:preprocessor /bigobj"] 53 | tc.generate() 54 | 55 | def build(self): 56 | cmake = CMake(self) 57 | cmake.configure() 58 | cmake.build() 59 | 60 | def package(self): 61 | cmake = CMake(self) 62 | cmake.install() 63 | 64 | def package_info(self): 65 | if self.settings.build_type == "Debug": 66 | self.cpp_info.libs = ["cpprealm-dbg", "realm-object-store-dbg", "realm-parser-dbg", "realm-sync-dbg", "realm-dbg"] 67 | else: 68 | self.cpp_info.libs = ["cpprealm", "realm-object-store", "realm-parser", "realm-sync", "realm"] 69 | if self.is_darwin(): 70 | self.cpp_info.frameworks = ["Foundation", "Security", "Compression", "z"] 71 | if self.settings.os == "Windows": 72 | self.cpp_info.system_libs = ["Version"] -------------------------------------------------------------------------------- /contributing/release-process.md: -------------------------------------------------------------------------------- 1 | # Realm C++ SDK Release Process: 2 | 3 | ### What to check on GitHub Actions: 4 | There are four main workflows: 5 | - CMake build 6 | - SPM 7 | - Vcpkg 8 | - Conan 9 | 10 | #### CMake build: 11 | This is where the majority of testing is done, tests run on macos, Windows and Ubuntu. On Ubuntu a variety of compilers are tested. Debug and Release configurations are tested on each platform. 12 | DB tests, Sync tests and Client reset tests run separately as part of the workflow. 13 | #### SPM: 14 | Only DB tests are performed. 15 | #### Vcpkg: 16 | The Vcpkg tests are to ensure that nothing in our CMakeLists has changed to break the Vcpkg portfile. It will install the cpprealm Vcpkg and link it against the DB tests to ensure everything integrates fine. 17 | #### Conan: 18 | Similar to Vcpkg, the purpose of these tests is to ensure the Conanfile is setup correctly and it links correctly against the DB tests. 19 | 20 | ### AOSP: 21 | Before each release check that everything builds fine on AOSP. It’s recommended to install AOSP on a Ubuntu workstation VM. 22 | Clone the repo (can take a few hours) 23 | https://source.android.com/docs/setup/download 24 | Build android (also takes hours) 25 | https://source.android.com/docs/setup/build/building 26 | - `source build/envsetup.sh` 27 | - `lunch aosp_cf_x86_64_phone-trunk_staging-eng` 28 | - `m` 29 | Once that is done, create a ‘vendor’ folder 30 | All 3rd party libs should be cloned inside of `vendor` 31 | Cd into your project folder and run `mma` 32 | 33 | ### Vcpkg: 34 | Whenever Core has a new release we should take it upon ourselves to update the portfile on the vcpkg repo. The main steps are: 35 | Fork Vcpkg 36 | Create a branch for the Core update 37 | Update the versions in the portfile, example [here](https://github.com/microsoft/vcpkg/pull/39888). 38 | 39 | Once the Core update has performed, the same process should be taken for the C++ SDK. On Vcpkg the SDK is called cpprealm 40 | 41 | ### Conanfile: 42 | We haven’t submitted to the Conan index yet, but users can consume the conanfile locally. 43 | 44 | # Releasing from main: 45 | - Ensure changelog is correct 46 | - Ensure Core submodule is updated in both [Package.swift](https://github.com/realm/realm-cpp/blob/5ec1bda338dfd0c91ce1eea2ccb2c0adf7d86690/Package.swift#L5) and git submodules 47 | - Ensure Conanfile.py is [pointing to the latest upstream](https://github.com/realm/realm-cpp/blob/main/conanfile.py#L39) and the [version is correct](https://github.com/realm/realm-cpp/blob/main/conanfile.py#L8). 48 | - Ensure [version in local vcpkg portfile](https://github.com/realm/realm-cpp/blob/5ec1bda338dfd0c91ce1eea2ccb2c0adf7d86690/ports/vcpkg.json#L3) is correct 49 | - Ensure the version in [dependencies.list](https://github.com/realm/realm-cpp/blob/5ec1bda338dfd0c91ce1eea2ccb2c0adf7d86690/dependencies.list#L1) is correct. 50 | - Create a tag prefixed with v and publish the release. 51 | - Copy the link for the release to appx-releases. 52 | -------------------------------------------------------------------------------- /dependencies.list: -------------------------------------------------------------------------------- 1 | VERSION=2.2.0 -------------------------------------------------------------------------------- /docs/fix-doxygen-titles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | 3 | # Output this to a temp directory because we can't write to the html directory 4 | # Assume doxygen was run first 5 | pushd "`dirname "$0"`" 6 | cp -R html modified-doxygen-output 7 | 8 | find ./modified-doxygen-output -name "*.html" | while read ln 9 | do 10 | # Make the output SEO friendly by converting the "div" title to the proper "h1" 11 | sed -i -e 's|
\([^<]*\)
|

\1

|' "$ln" 12 | done 13 | find ./modified-doxygen-output -iname "*.html-e" -exec rm '{}' \; 14 | 15 | popd 16 | -------------------------------------------------------------------------------- /examples/Android/README.md: -------------------------------------------------------------------------------- 1 | ## Building an Android App with Realm C++ SDK 2 | - Add `` to your AndroidManifest.xml 3 | - Add the subdirectory of the Realm C++ SDK to your native library's CMakeLists.txt e.g: 4 | ``` 5 | set(CMAKE_CXX_STANDARD 17) 6 | add_subdirectory("realm-cpp") 7 | ... 8 | target_link_libraries( # Specifies the target library. 9 | myapplication 10 | # make sure to link the Realm C++ SDK. 11 | cpprealm) 12 | ``` 13 | - Ensure that the git submodules are initialized inside of the realm-cpp folder before building. 14 | - When instantiating the Realm or the Realm App you must pass the `filesDir.path` to the `path` parameter in the respective constructors. 15 | - See the MainActivity.kt & native-lib.cpp files in the Android example app for reference. 16 | -------------------------------------------------------------------------------- /examples/Android/RealmExample/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | -------------------------------------------------------------------------------- /examples/Android/RealmExample/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /examples/Android/RealmExample/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/Android/RealmExample/.idea/deploymentTargetDropDown.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/Android/RealmExample/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | -------------------------------------------------------------------------------- /examples/Android/RealmExample/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | -------------------------------------------------------------------------------- /examples/Android/RealmExample/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/Android/RealmExample/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /examples/Android/RealmExample/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | id 'org.jetbrains.kotlin.android' 4 | } 5 | 6 | android { 7 | namespace 'com.mongodb.realmexample' 8 | compileSdk 32 9 | 10 | defaultConfig { 11 | applicationId "com.mongodb.realmexample" 12 | minSdk 26 13 | targetSdk 32 14 | versionCode 1 15 | versionName "1.0" 16 | 17 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 18 | externalNativeBuild { 19 | cmake { 20 | cppFlags '-std=c++17' 21 | targets "realmexample" 22 | } 23 | } 24 | } 25 | 26 | buildTypes { 27 | release { 28 | minifyEnabled false 29 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 30 | } 31 | } 32 | compileOptions { 33 | sourceCompatibility JavaVersion.VERSION_1_8 34 | targetCompatibility JavaVersion.VERSION_1_8 35 | } 36 | kotlinOptions { 37 | jvmTarget = '1.8' 38 | } 39 | externalNativeBuild { 40 | cmake { 41 | path file('src/main/cpp/CMakeLists.txt') 42 | version '3.18.1' 43 | } 44 | } 45 | buildFeatures { 46 | viewBinding true 47 | } 48 | } 49 | 50 | dependencies { 51 | 52 | implementation 'androidx.core:core-ktx:1.7.0' 53 | implementation 'androidx.appcompat:appcompat:1.5.1' 54 | implementation 'com.google.android.material:material:1.7.0' 55 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' 56 | testImplementation 'junit:junit:4.13.2' 57 | androidTestImplementation 'androidx.test.ext:junit:1.1.4' 58 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' 59 | } -------------------------------------------------------------------------------- /examples/Android/RealmExample/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /examples/Android/RealmExample/app/src/androidTest/java/com/mongodb/realmexample/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.mongodb.realmexample 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.mongodb.realmexample", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /examples/Android/RealmExample/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /examples/Android/RealmExample/app/src/main/cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # For more information about using CMake with Android Studio, read the 2 | # documentation: https://d.android.com/studio/projects/add-native-code.html 3 | 4 | # Sets the minimum version of CMake required to build the native library. 5 | 6 | cmake_minimum_required(VERSION 3.18.1) 7 | set(CMAKE_CXX_STANDARD 17) 8 | 9 | # Declares and names the project. 10 | 11 | project("realmexample") 12 | 13 | # Creates and names a library, sets it as either STATIC 14 | # or SHARED, and provides the relative paths to its source code. 15 | # You can define multiple libraries, and CMake builds them for you. 16 | # Gradle automatically packages shared libraries with your APK. 17 | 18 | add_subdirectory("../../../../../../../" "realmcpp") 19 | 20 | add_library( # Sets the name of the library. 21 | realmexample 22 | 23 | # Sets the library as a shared library. 24 | SHARED 25 | 26 | # Provides a relative path to your source file(s). 27 | native-lib.cpp) 28 | 29 | # Searches for a specified prebuilt library and stores the path as a 30 | # variable. Because CMake includes system libraries in the search path by 31 | # default, you only need to specify the name of the public NDK library 32 | # you want to add. CMake verifies that the library exists before 33 | # completing its build. 34 | 35 | find_library( # Sets the name of the path variable. 36 | log-lib 37 | 38 | # Specifies the name of the NDK library that 39 | # you want CMake to locate. 40 | log) 41 | 42 | # Specifies libraries CMake should link to your target library. You 43 | # can link multiple libraries, such as libraries you define in this 44 | # build script, prebuilt third-party libraries, or system libraries. 45 | 46 | target_link_libraries( # Specifies the target library. 47 | realmexample 48 | 49 | # Links the target library to the log library 50 | # included in the NDK. 51 | ${log-lib} 52 | # link the Realm C++ SDK 53 | cpprealm) -------------------------------------------------------------------------------- /examples/Android/RealmExample/app/src/main/java/com/mongodb/realmexample/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.mongodb.realmexample 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 5 | import android.view.MotionEvent 6 | import android.view.View 7 | import android.widget.TextView 8 | import com.mongodb.realmexample.databinding.ActivityMainBinding 9 | 10 | class MainActivity : AppCompatActivity() { 11 | 12 | private lateinit var binding: ActivityMainBinding 13 | 14 | override fun onCreate(savedInstanceState: Bundle?) { 15 | super.onCreate(savedInstanceState) 16 | 17 | binding = ActivityMainBinding.inflate(layoutInflater) 18 | setContentView(binding.root) 19 | 20 | // Pass the folder path of the app so we 21 | // can create a folder to store the Realm files. 22 | setupRealm(this.filesDir.path) 23 | 24 | binding.incrementButton.setOnClickListener { 25 | incrementCounter() 26 | } 27 | 28 | binding.decrementButton.setOnClickListener { 29 | decrementCounter() 30 | } 31 | } 32 | 33 | fun counterNotificationRecieved(changed_property: String) { 34 | binding.sampleText.text = changed_property 35 | } 36 | 37 | external fun setupRealm(path: String) 38 | // Movement methods 39 | external fun incrementCounter() 40 | external fun decrementCounter() 41 | 42 | companion object { 43 | // Used to load the 'realmexample' library on application startup. 44 | init { 45 | System.loadLibrary("realmexample") 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /examples/Android/RealmExample/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /examples/Android/RealmExample/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 19 | 20 |