Skip to content

Commit a53c4b6

Browse files
nhachicharorbech
andauthored
Re-writing accessors transformer using the new AGP API (#7694)
Co-authored-by: Claus Rørbech <claus.rorbech@mongodb.com>
1 parent 66533b3 commit a53c4b6

88 files changed

Lines changed: 1158 additions & 1103 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ contact_links:
33
- name: General Questions and Inquiries
44
url: https://www.mongodb.com/community/forums/tags/c/realm-sdks/58/java
55
about: Please ask general design/architecture questions in the community forums.
6-
- name: MongoDB Realm (Sync) Production Issues
6+
- name: MongoDB Atlas Device Sync Production Issues
77
url: https://support.mongodb.com/
88
about: Please report urgent production issues to the support portal directly.

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
## 10.12.0 (YYYY-MM-DD)
1+
## 10.12.0-transformer-api (YYYY-MM-DD)
2+
3+
### Breaking Changes
4+
* Only works with Android Gradle Plugin 7.4 or newer. (Issue [#7714](https://github.com/realm/realm-java/issues/7714))
25

36
### Enhancements
47
* [RealmApp] Introduced `SyncSession.RecoverOrDiscardUnsyncedChangesStrategy`, an alternative automatic client reset strategy that tries to automatically recover any unsynced data from the client, and discards any unsynced data if not possible. This is now the default client reset policy if not explicitly set in the `SyncConfiguration`.
58
* [RealmApp] Introduced `SyncSession.RecoverUnsyncedChangesStrategy`, an alternative automatic client reset strategy that tries to automatically recover any unsynced data from the client and will revert to manual client reset if not possible.
69

710
### Fixed
8-
* None
11+
* Now queries can point to fields with query language-reserved words like 'desc', 'sort', 'distinct', etc. Issue [#7705](https://github.com/realm/realm-java/issues/7705)
912

1013
### Compatibility
1114
* File format: Generates Realms with format v22. Unsynced Realms will be upgraded from Realm Java 2.0 and later. Synced Realms can only be read and upgraded if created with Realm Java v10.0.0-BETA.1.
1215
* APIs are backwards compatible with all previous release of realm-java in the 10.6.y series.
1316
* Realm Studio 11.0.0-alpha.0 or above is required to open Realms created by this version.
1417

18+
### Internal
19+
* Update to Realm Core 12.6.0, commit: 5da7744b4056ad185c025bccf0924f17f73f7a91.
20+
1521

1622
## 10.11.1 (2022-07-14)
1723

Jenkinsfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ try {
125125
[$class: 'AmazonWebServicesCredentialsBinding', credentialsId: 'realm-kotlin-baas-aws-credentials', accessKeyVariable: 'BAAS_AWS_ACCESS_KEY_ID', secretKeyVariable: 'BAAS_AWS_SECRET_ACCESS_KEY']
126126
]) {
127127
def tempDir = runCommand('mktemp -d -t app_config.XXXXXXXXXX')
128-
sh "tools/sync_test_server/app_config_generator.sh ${tempDir} tools/sync_test_server/app_template partition testapp1 testapp2"
129-
sh "tools/sync_test_server/app_config_generator.sh ${tempDir} tools/sync_test_server/app_template flex testapp3"
128+
sh "tools/sync_test_server/app_config_generator.sh ${tempDir} tools/sync_test_server/app_template partition auto testapp1"
129+
sh "tools/sync_test_server/app_config_generator.sh ${tempDir} tools/sync_test_server/app_template partition email testapp2"
130+
sh "tools/sync_test_server/app_config_generator.sh ${tempDir} tools/sync_test_server/app_template flex function testapp3"
130131
sh "docker network create ${dockerNetworkId}"
131132
mongoDbRealmContainer = mdbRealmImage.run("--network ${dockerNetworkId} -v$tempDir:/apps -e AWS_ACCESS_KEY_ID='$BAAS_AWS_ACCESS_KEY_ID' -e AWS_SECRET_ACCESS_KEY='$BAAS_AWS_SECRET_ACCESS_KEY'")
132133
mongoDbRealmCommandServerContainer = commandServerEnv.run("--network container:${mongoDbRealmContainer.id} -v$tempDir:/apps")
@@ -162,7 +163,7 @@ try {
162163
sh """yes '\n' | avdmanager create avd -n CIEmulator -k '${emulatorImage}' --force"""
163164
sh "adb start-server" // https://stackoverflow.com/questions/56198290/problems-with-adb-exe
164165
// Need to go to ANDROID_HOME due to https://askubuntu.com/questions/1005944/emulator-avd-does-not-launch-the-virtual-device
165-
sh "cd \$ANDROID_HOME/tools && emulator -avd CIEmulator -no-boot-anim -no-window -wipe-data -noaudio -partition-size 4098 &"
166+
sh "cd \$ANDROID_HOME/tools && emulator -avd CIEmulator -no-boot-anim -no-window -wipe-data -noaudio -partition-size 4098 -memory 2048 &"
166167
try {
167168
runBuild(buildFlags, instrumentationTestTarget)
168169
} finally {

LICENSE

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
TABLE OF CONTENTS
2-
3-
1. Apache License version 2.0
4-
2. Export Compliance
5-
6-
1. -------------------------------------------------------------------------------
7-
81
Apache License
92
Version 2.0, January 2004
103
http://www.apache.org/licenses/
@@ -180,25 +173,5 @@ TABLE OF CONTENTS
180173
incurred by, or claims asserted against, such Contributor by reason
181174
of your accepting any such warranty or additional liability.
182175

183-
2. -------------------------------------------------------------------------------
184-
185-
EXPORT COMPLIANCE
186-
187-
You understand that the Software may contain cryptographic functions that may be
188-
subject to export restrictions, and you represent and warrant that you are not
189-
(i) located in a jurisdiction that is subject to United States economic
190-
sanctions (“Prohibited Jurisdiction”), including Cuba, Iran, North Korea,
191-
Sudan, Syria or the Crimea region, (ii) a person listed on any U.S. government
192-
blacklist (to include the List of Specially Designated Nationals and Blocked
193-
Persons or the Consolidated Sanctions List administered by the U.S. Department
194-
of the Treasury’s Office of Foreign Assets Control, or the Denied Persons List
195-
or Entity List administered by the U.S. Department of Commerce)
196-
(“Sanctioned Person”), or (iii) controlled or 50% or more owned by a Sanctioned
197-
Person.
198-
199-
You agree to comply with all export, re-export and import restrictions and
200-
regulations of the U.S. Department of Commerce or other agency or authority of
201-
the United States or other applicable countries. You also agree not to transfer,
202-
or authorize the transfer of, directly or indirectly, of the Software to any
203-
Prohibited Jurisdiction, or otherwise in violation of any such restrictions or
204-
regulations.
176+
END OF TERMS AND CONDITIONS
177+

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,6 @@ Realm Java is published under the Apache 2.0 license.
288288
Realm Core is also published under the Apache 2.0 license and is available
289289
[here](https://github.com/realm/realm-core).
290290
291-
**This product is not being made available to any person located in Cuba, Iran,
292-
North Korea, Sudan, Syria or the Crimea region, or to any other person that is
293-
not eligible to receive the product under U.S. law.**
294-
295291
## Feedback
296292
297293
**_If you use Realm and are happy with it, all we ask is that you, please consider sending out a tweet mentioning [@realm](http://twitter.com/realm) to share your thoughts!_**

dependencies.list

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Realm Core release used by Realm Java
22
# https://github.com/realm/realm-core/releases
3-
REALM_CORE=12.3.0
3+
REALM_CORE=12.6.0
44

55
# Version of MongoDB Realm used by integration tests
66
# See https://github.com/realm/ci/packages/147854 for available versions
@@ -15,10 +15,10 @@ REALM_BAAS_GIT_HASH=ba172f8dd37c3102499ab7d728e7c0dcb9e52ae8
1515
REALM_BAAS_UI_GIT_HASH=1fc10a6e04f87247790662d825500c9e21dbfbc7
1616

1717
# Common Android settings across projects
18-
GRADLE_BUILD_TOOLS=7.1.0
18+
GRADLE_BUILD_TOOLS=7.4.0-alpha08
1919
ANDROID_BUILD_TOOLS=30.0.3
20-
KOTLIN=1.5.31
21-
KOTLIN_COROUTINES=1.5.2
20+
KOTLIN=1.6.21
21+
KOTLIN_COROUTINES=1.6.0
2222

2323
# Common classpath dependencies
2424
gradle=7.3.3

examples/architectureComponentsExample/src/main/java/io/realm/examples/arch/PersonListFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static class ViewHolder extends RecyclerView.ViewHolder {
114114
return;
115115
}
116116
AppCompatActivity activity = ContextUtils.findActivity(view.getContext());
117-
PersonFragment personFragment = PersonFragment.create(person.getName());
117+
PersonFragment personFragment = PersonFragment.create(person.name);
118118
activity.getSupportFragmentManager()
119119
.beginTransaction()
120120
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)

examples/architectureComponentsExample/src/main/java/io/realm/examples/arch/model/Person.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
public class Person extends RealmObject {
2323
@Index
24-
private String name;
24+
public String name;
2525

2626
private int age;
2727

examples/coroutinesExample/build.gradle

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ apply plugin: 'kotlin-kapt'
55
apply plugin: 'realm-android'
66

77
android {
8-
compileSdkVersion rootProject.sdkVersion
8+
// androidx.lifecycle dependencies requires Android APIs 31 or later
9+
compileSdkVersion 31
910
buildToolsVersion rootProject.buildTools
1011

1112
defaultConfig {
@@ -57,18 +58,18 @@ dependencies {
5758

5859
implementation "androidx.fragment:fragment-ktx:1.2.5"
5960

60-
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0"
61-
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0"
62-
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.2.0"
63-
implementation "androidx.lifecycle:lifecycle-common-java8:2.2.0"
61+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0"
62+
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.0"
63+
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.0"
64+
implementation "androidx.lifecycle:lifecycle-common-java8:2.4.0"
6465

6566
implementation "androidx.legacy:legacy-support-v4:1.0.0"
6667

6768
implementation "androidx.multidex:multidex:2.0.1"
6869

6970
implementation "androidx.recyclerview:recyclerview:1.1.0"
7071

71-
implementation "com.dropbox.mobile.store:store4:4.0.0"
72+
implementation "com.dropbox.mobile.store:store4:4.0.5"
7273

7374
implementation "com.google.android.material:material:1.2.1"
7475

examples/encryptionExample/src/main/java/io/realm/examples/encryption/EncryptionExampleActivity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ protected void onCreate(Bundle savedInstanceState) {
5252

5353
RealmConfiguration realmConfiguration = new RealmConfiguration.Builder()
5454
.encryptionKey(key)
55+
.allowQueriesOnUiThread(true)
56+
.allowWritesOnUiThread(true)
5557
.build();
5658

5759
// Start with a clean slate every time

0 commit comments

Comments
 (0)