-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consume monorepo core binaries #7241
Merged
Merged
Changes from 12 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
6513052
RJAVA-564: Use monorepo (#7146)
fealebenpae d80a23e
Update license. Remove Realm Component license. (#7194)
bmunkholm fad5fdc
Merge branch 'master' into support-new-datatypes
64fd2b1
Added temporarily missing dictionary and mixed type functions to java…
87f2439
Merge master in
clementetb 40c4051
Add support for consuming realm-core binaries
clementetb d10ecc7
Force building from sources on base
clementetb 554d677
Rename LTO switch property
clementetb 2f79643
Update Jenkins file to consume binaries when testing, and build core …
clementetb cd63a17
Allow to cache binary resources
clementetb 8e0e3ca
Use system env variable for defining the core download dir
clementetb 87664eb
Update readme
clementetb 3e9147f
Update realm/realm-library/src/main/cpp/CMakeLists.txt
clementetb 34005b5
Update realm/realm-library/src/main/cpp/CMakeLists.txt
clementetb 6f35059
Update realm/realm-library/src/main/cpp/CMakeLists.txt
clementetb 10ff4c0
Add SHA validation for core artifacts
clementetb 4899174
Bump realm core commit
clementetb a11cf82
Update changelog
clementetb ef91bb6
Fix rename of REALM_SYNC
clementetb 39fa223
Remove fingerprint check
clementetb 271592c
Bump realm-core commit to master 10.3.2
clementetb 1a7f797
Ignore failing tests
clementetb 1dd23de
Ignore further failing tests
clementetb e9c7ea2
Profile JNI library sizes.
clementetb 9e034aa
Update changelog
clementetb 905ca19
Bump master and enable tests affected by RCORE-435
clementetb 894c820
Fix object store not copying data
clementetb 0f41646
Remove ignore comments
clementetb 427d88f
PR changes and bump core to v10.3.3
clementetb c3b99c7
Update CHANGELOG.md
clementetb 0800bd0
Update CHANGELOG.md
clementetb cb4a3c2
Point to realm core in dependencies comments
clementetb 6d6e05e
Update changelog with some more fixes
clementetb 31c45fb
Merge branch 'master' into ct/consume-monorepo-binaries
clementetb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "realm/realm-library/src/main/cpp/object-store"] | ||
path = realm/realm-library/src/main/cpp/object-store | ||
url = https://github.com/realm/realm-object-store.git | ||
[submodule "realm/realm-library/src/main/cpp/realm-core"] | ||
path = realm/realm-library/src/main/cpp/realm-core | ||
url = https://github.com/realm/realm-core.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -66,34 +66,24 @@ In case you don't want to use the precompiled version, you can build Realm yours | |||||
### Prerequisites | ||||||
|
||||||
* Download the [**JDK 8**](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) from Oracle and install it. | ||||||
* The latest stable version of Android Studio. Currently [3.6.2](https://developer.android.com/studio/). | ||||||
* Download & install the Android SDK **Build-Tools 28.0.3**, **Android Pie (API 28)** (for example through Android Studio’s **Android SDK Manager**). | ||||||
* Install CMake from SDK manager in Android Studio ("SDK Tools" -> "CMake"). | ||||||
* Install the NDK (currently r21) from the SDK Manager in Android Studio or using the [website](https://developer.android.com/ndk/downloads). If downloaded | ||||||
You may unzip the file wherever you choose. For macOS, a suggested location is `~/Library`. The download will unzip as the directory `android-ndk-r21`. | ||||||
* The latest stable version of Android Studio. Currently [4.1.1](https://developer.android.com/studio/). | ||||||
* Download & install the Android SDK **Build-Tools 29.0.3**, **Android Pie (API 29)** (for example through Android Studio’s **Android SDK Manager**). | ||||||
* Install CMake version 3.18.2 and build Ninja. | ||||||
* Install the NDK (Side-by-side) **21.0.6113669** from the SDK Manager in Android Studio. Remember to check `☑ Show package details` in the manager to display all available versions. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this download automatically when we specify the |
||||||
|
||||||
* If you will be building with Android Studio, you will need to tell it to use the correct NDK. If you installed it using the SDK Manager, it will automatically be detected. Otherwise, you need to define the variable `ndk.dir` in `realm/local.properties` and assign it the full pathname of the directory that you unzipped above. Note that there is a `local.properites` in the root directory that is *not* the one that needs to be edited. | ||||||
* Add the Android home environment variable to your profile: | ||||||
|
||||||
``` | ||||||
ndk.dir=/Users/<username>/Library/android-sdk/ndk/21.0.6113669 | ||||||
|
||||||
``` | ||||||
|
||||||
* Add two environment variables to your profile (presuming you installed the NDK using the SDK Manager): | ||||||
|
||||||
``` | ||||||
export ANDROID_HOME=~/Library/android-sdk | ||||||
export ANDROID_NDK_HOME=~/Library/android-sdk/ndk/21.0.6113669 | ||||||
export ANDROID_HOME=~/Library/Android/sdk | ||||||
``` | ||||||
|
||||||
* If you are launching Android Studio from the macOS Finder, you should also run the following two commands: | ||||||
* If you are launching Android Studio from the macOS Finder, you should also run the following command: | ||||||
|
||||||
``` | ||||||
launchctl setenv ANDROID_HOME "$ANDROID_HOME" | ||||||
launchctl setenv ANDROID_NDK_HOME "$ANDROID_NDK_HOME" | ||||||
``` | ||||||
|
||||||
* If you'd like to specify the location in which to store the archives of Realm Core, define the `REALM_CORE_DOWNLOAD_DIR` environment variable. It enables you to keep Core's archive when executing `git clean -xfd`. | ||||||
* If you'd like to specify the location in which to store the archives of Realm Core, define the `REALM_CORE_DOWNLOAD_DIR` environment variable. It enables caching core release artifacts. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
``` | ||||||
export REALM_CORE_DOWNLOAD_DIR=~/.realmCore | ||||||
|
@@ -109,7 +99,7 @@ It would be a good idea to add all of the symbol definitions (and their accompan | |||||
|
||||||
* If you develop Realm Java with Android Studio, we recommend you to exclude some directories from indexing target by executing following steps on Android Studio. It really speeds up indexing phase after the build. | ||||||
|
||||||
- Under `/realm/realm-library/`, select `build`, `.externalNativeBuild` and `distribution` folders in `Project` view. | ||||||
- Under `/realm/realm-library/`, select `build`, `.cxx` and `distribution` folders in `Project` view. | ||||||
- Press `Command + Shift + A` to open `Find action` dialog. If you are not using default keymap nor using macOS, you can find your shortcut key in `Keymap` preference by searching `Find action`. | ||||||
- Search `Excluded` (not `Exclude`) action and select it. Selected folder icons should become orange (in default theme). | ||||||
- Restart Android Studio. | ||||||
|
@@ -147,22 +137,28 @@ The full build may take an hour or more, to complete. | |||||
|
||||||
### Building from source | ||||||
|
||||||
It is possible to build Realm Java against a local checked out version of Realm Core. This is done by providing the following parameter when building: `-PcoreSourcePath=<path>`. | ||||||
It is possible to build Realm Java with the submodule version of Realm Core. This is done by providing the following parameter when building: `-PbuildCore=true`. | ||||||
|
||||||
E.g in the case where the `realm-java` and `realm-core` repos are checked out next to each other you can build from source using: | ||||||
``` | ||||||
./gradlew assembleBase -PbuildCore=true | ||||||
``` | ||||||
|
||||||
You can turn off interprocedural optimizations with the following parameter: `-PenableLTO=false`. | ||||||
|
||||||
``` | ||||||
git clone https://github.com/realm/realm-java.git | ||||||
git clone https://github.com/realm/realm-core.git | ||||||
cd realm-java/realm | ||||||
./gradlew assembleBase -PcoreSourcePath=../../realm-core | ||||||
./gradlew assembleBase -PenableLTO=false` | ||||||
``` | ||||||
|
||||||
Note: If the `realm-core` project has already been compiled for non-Android builds and CMake files have been generated, this might conflict with `realm-java` trying to build it. Cleanup the `realm-core` project by calling `git clean -xfd` inside it (beware that all unsaved changes will be lost). | ||||||
Note: Building the `Base` variant would always build realm-core. | ||||||
|
||||||
Note: Interprocedural optimizations are enabled by default. | ||||||
|
||||||
Note: Building from source with Realm Sync is not enabled yet. Only building the `Base` variant is supported. | ||||||
Note: If you want to build from source inside Android Studio, you need to update the Gradle parameters by going into the Realm projects settings `Settings > Build, Execution, Deployment > Compiler > Command-line options` and add `-PbuildCore=true` or `-PenableLTO=false` to it. Alternatively you can add it into your `gradle.properties`: | ||||||
|
||||||
Note: If you want to build from source inside Android Studio, you need to update the Gradle parameters by going into the Realm projects settings `Settings > Build, Execution, Deployment > Compiler > Command-line options` and add `-PcoreSourcePath=<path>` to it. | ||||||
``` | ||||||
buildCore=true | ||||||
enableLTO=false | ||||||
``` | ||||||
|
||||||
Note: If building on OSX you might like to prevent Gatekeeper to block all NDK executables by disabling it: `sudo spctl --master-disable`. Remember to enable it afterwards: `sudo spctl --master-enable` | ||||||
|
||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For traceability/reproducability etc. I would assume that it safest to do release from the prebuilts. Is it safe to to the release from locally build cores? Or don't we get the benefits of optimizations unless we build it?