-
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
RealmConfiguration + new constructors #929
Merged
Merged
Changes from 34 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
5b29976
Added RealmConfiguration + Builder. Refactored Realm to use this inst…
cmelchior 632e487
Removing test code
cmelchior a39ca18
Streamline new constructors and deprecate old constructors + other ut…
cmelchior 3c70bab
Merge branch 'master' into cm-configuration-builder
cmelchior fdbe368
Added test cases for RealmConfiguration + minor refactoring.
cmelchior 083fd7f
Merge branch 'master' into cm-configuration-builder
cmelchior 6393086
Fixed unit tests. Renamed version to SchemaVersion
cmelchior 1fa0ddb
Cleanup unit tests. Removed automatic version upgrade with no schema …
cmelchior 1a4ec73
Merge branch 'master' into cm-configuration-builder
cmelchior 7463741
Cleaned up naming. Removed deleteRealmBeforeOpening, should be replac…
cmelchior 07dee9f
Removed option of deleting Realm on start
cmelchior ee52efa
Merge branch 'master' into cm-configuration-builder
cmelchior 84170e2
RealmModule is now public
cmelchior 589565d
Adding addModule and setModules. Removed schema from Realm and added …
cmelchior 76db508
Added unit tests for addModule and setModules.
cmelchior 8f451dd
Renamed deleteRealmBeforeOpening to resetRealmBeforeOpening.
cmelchior 83294a3
Cleanup
cmelchior 8590785
Removed deprecation of Realm.getInstance(context)
cmelchior 73bd53c
Fixed unit tests.
cmelchior 1195443
Cleanup
cmelchior 2393dc0
Merge branch 'master' into cm-configuration-builder
cmelchior 5f852e7
Language cleanup.
cmelchior e4c3dcb
Updated changelog.
cmelchior 06b31f1
Fixed bug when specifying individual classes. Added unit tests.
cmelchior 7f53426
Better log message
cmelchior dba2699
Comment about error scenario
cmelchior 9d65088
Added APT unit tests for all variants of RealmModules.
cmelchior 72e6c90
Now looks after the mediator class in the correct package.
cmelchior 35d7fc5
Improved error message for objects not part of the schema.
cmelchior 93475d5
Language cleanup.
cmelchior e4e3c7d
Proper var args.
cmelchior 7e667fc
Merge branch 'master' into cm-configuration-builder
cmelchior 9828737
Merge branch 'master' into cm-configuration-builder
cmelchior b454011
Cleanup test + language. Encryption key length is now a constant.
cmelchior 8e1dd5b
Readdded AllTypesRealmProxy unit test.
cmelchior 153a79e
Merge branch 'master' into cm-configuration-builder
cmelchior da2637b
Removed addModule and exposed Realm.getDefaultModule().
cmelchior 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
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
2 changes: 1 addition & 1 deletion
2
realm-annotations-processor/src/test/resources/io/realm/RealmDefaultModule.java
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,7 +1,7 @@ | ||
package io.realm; | ||
|
||
|
||
@io.realm.annotations.internal.RealmModule(allClasses = true) | ||
@io.realm.annotations.RealmModule(allClasses = true) | ||
class DefaultRealmModule { | ||
|
||
} |
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
29 changes: 29 additions & 0 deletions
29
realm-annotations-processor/src/test/resources/some/test/AppModuleAllClasses.java
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright 2015 Realm Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package some.test; | ||
|
||
import java.util.Date; | ||
|
||
import io.realm.RealmList; | ||
import io.realm.RealmObject; | ||
import io.realm.annotations.PrimaryKey; | ||
import io.realm.annotations.RealmModule; | ||
|
||
@RealmModule(allClasses = true) | ||
public class AppModuleAllClasses { | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
realm-annotations-processor/src/test/resources/some/test/AppModuleCustomClasses.java
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright 2015 Realm Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package some.test; | ||
|
||
import java.util.Date; | ||
|
||
import io.realm.RealmList; | ||
import io.realm.RealmObject; | ||
import io.realm.annotations.PrimaryKey; | ||
import io.realm.annotations.RealmModule; | ||
|
||
@RealmModule(classes = { AllTypes.class }) | ||
public class AppModuleCustomClasses { | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
...m-annotations-processor/src/test/resources/some/test/InvalidAppModuleMixedParameters.java
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright 2015 Realm Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package some.test; | ||
|
||
import java.util.Date; | ||
|
||
import io.realm.RealmList; | ||
import io.realm.RealmObject; | ||
import io.realm.annotations.PrimaryKey; | ||
import io.realm.annotations.RealmModule; | ||
|
||
// Setting both allClasses and classes is not allowed at the same time | ||
@RealmModule(allClasses = true, classes = { AllTypes.class }) | ||
public class InvalidAllTypesModuleMixedParameters { | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
realm-annotations-processor/src/test/resources/some/test/InvalidAppModuleWrongType.java
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright 2015 Realm Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package some.test; | ||
|
||
import java.util.Date; | ||
|
||
import io.realm.RealmList; | ||
import io.realm.RealmObject; | ||
import io.realm.annotations.PrimaryKey; | ||
import io.realm.annotations.RealmModule; | ||
|
||
// Object is not a RealmObject which the Annotation Processor should be able to detect. | ||
@RealmModule(classes = { Object.class, AllTypes.class }) | ||
public class InvalidAllTypesModuleWrongType { | ||
|
||
} |
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.
we should still check that we produce the expected model class proxy! This is a problem introduced in the Modules PR