-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/github-actions
- Loading branch information
Showing
99 changed files
with
4,140 additions
and
822 deletions.
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash -e | ||
|
||
# Prevents pushing any code to the server that does not comply with klint or detekt | ||
# It ignores any unchecked files. | ||
|
||
# Ignore any unchecked file | ||
echo "Stashing changes before doing checks" | ||
git stash push -q -u --keep-index | ||
|
||
# Pop the stash once the scripts finishes, fails or gets cancelled | ||
function pop_stash() { | ||
echo "Checks completed, popping stash" | ||
git stash pop -q | ||
} | ||
|
||
trap "exit" INT TERM ERR | ||
trap pop_stash EXIT | ||
|
||
# Do the actual check ups | ||
./gradlew ktlintCheck detekt |
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
# Version of MongoDB Realm used by integration tests | ||
# See https://github.com/realm/ci/packages/147854 for available versions | ||
MONGODB_REALM_SERVER=2022-05-21 | ||
|
||
# `BAAS` and `BAAS-UI` projects commit hashes matching MONGODB_REALM_SERVER image version | ||
# note that the MONGODB_REALM_SERVER image is a nightly build, find the matching commits | ||
# for that date within the following repositories: | ||
# https://github.com/10gen/baas/ | ||
# https://github.com/10gen/baas-ui/ | ||
REALM_BAAS_GIT_HASH=87e4edf99a6510aa8468450e87af69dcfc74abe7 | ||
REALM_BAAS_UI_GIT_HASH=57c5b89882d5492bc0f4971c376e25ba50b65b5f |
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
44 changes: 44 additions & 0 deletions
44
packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/UUIDWrapper.kt
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,44 @@ | ||
/* | ||
* Copyright 2022 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 io.realm.kotlin.internal.interop | ||
|
||
/** | ||
* Wrapper around Core UUID values. | ||
* See https://github.com/realm/realm-core/blob/master/src/realm/uuid.hpp for more information | ||
*/ | ||
interface UUIDWrapper { | ||
val bytes: ByteArray | ||
} | ||
|
||
// Implementation that should only be used within the cinterop module. | ||
internal data class UUIDWrapperImpl(override val bytes: ByteArray) : UUIDWrapper { | ||
override fun equals(other: Any?): Boolean { | ||
if (this === other) return true | ||
if (other == null || this::class != other::class) return false | ||
|
||
other as UUIDWrapperImpl | ||
|
||
if (!bytes.contentEquals(other.bytes)) return false | ||
|
||
return true | ||
} | ||
|
||
override fun hashCode(): Int { | ||
return bytes.contentHashCode() | ||
} | ||
} | ||
|
||
const val UUID_BYTES_SIZE = 16 |
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.