Skip to content

Commit

Permalink
Merge branch 'release/1.6.10' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarty committed Jan 10, 2024
2 parents 5fe907c + 408e57f commit a50ef5f
Show file tree
Hide file tree
Showing 359 changed files with 12,950 additions and 23,905 deletions.
4 changes: 3 additions & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Please also refer to the Changelog of Element Android: https://github.com/vector-im/element-android/blob/main/CHANGES.md

Changes in Matrix-SDK v1.6.10 (2024-01-10)
=========================================

Imported from Element 1.6.10. (https://github.com/vector-im/element-android/releases/tag/v1.6.10)

Changes in Matrix-SDK v1.5.30 (2023-04-11)
=========================================

Expand Down
7 changes: 0 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ allprojects {
groups.mavenCentral.group.each { includeGroup it }
}
}
//noinspection JcenterRepositoryObsolete
jcenter {
content {
groups.jcenter.regex.each { includeGroupByRegex it }
groups.jcenter.group.each { includeGroup it }
}
}
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
Expand Down
27 changes: 14 additions & 13 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ def gradle = "7.4.2"
def kotlin = "1.8.10"
def kotlinCoroutines = "1.6.4"
def dagger = "2.45"
def firebaseBom = "31.4.0"
def appDistribution = "16.0.0-beta06"
def firebaseBom = "32.0.0"
def appDistribution = "16.0.0-beta08"
def retrofit = "2.9.0"
def markwon = "4.6.2"
def moshi = "1.14.0"
def lifecycle = "2.5.1"
def flowBinding = "1.2.0"
def flipper = "0.188.0"
def flipper = "0.190.0"
def epoxy = "5.0.0"
def mavericks = "3.0.2"
def mavericks = "3.0.7"
def glide = "4.15.1"
def bigImageViewer = "1.8.1"
def jjwt = "0.11.5"
def vanniktechEmoji = "0.16.0"
def sentry = "6.17.0"
def sentry = "6.18.1"
// Use 1.6.0 alpha to fix issue with test
def fragment = "1.6.0-alpha08"
def fragment = "1.6.0-beta01"
// Testing
def mockk = "1.12.3" // We need to use 1.12.3 to have mocking in androidTest until a new version is released: https://github.com/mockk/mockk/issues/819
def espresso = "3.5.1"
Expand All @@ -47,17 +47,17 @@ ext.libs = [
'coroutinesTest' : "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinCoroutines"
],
androidx : [
'activity' : "androidx.activity:activity-ktx:1.7.0",
'activity' : "androidx.activity:activity-ktx:1.7.2",
'appCompat' : "androidx.appcompat:appcompat:1.6.1",
'biometric' : "androidx.biometric:biometric:1.1.0",
'core' : "androidx.core:core-ktx:1.9.0",
'core' : "androidx.core:core-ktx:1.10.1",
'recyclerview' : "androidx.recyclerview:recyclerview:1.3.0",
'exifinterface' : "androidx.exifinterface:exifinterface:1.3.6",
'fragmentKtx' : "androidx.fragment:fragment-ktx:$fragment",
'fragmentTesting' : "androidx.fragment:fragment-testing:$fragment",
'fragmentTestingManifest' : "androidx.fragment:fragment-testing-manifest:$fragment",
'constraintLayout' : "androidx.constraintlayout:constraintlayout:2.1.4",
'work' : "androidx.work:work-runtime-ktx:2.8.0",
'work' : "androidx.work:work-runtime-ktx:2.8.1",
'autoFill' : "androidx.autofill:autofill:1.1.0",
'preferenceKtx' : "androidx.preference:preference-ktx:1.2.0",
'junit' : "androidx.test.ext:junit:1.1.5",
Expand All @@ -80,13 +80,13 @@ ext.libs = [
'transition' : "androidx.transition:transition:1.4.1",
],
google : [
'material' : "com.google.android.material:material:1.8.0",
'material' : "com.google.android.material:material:1.9.0",
'firebaseBom' : "com.google.firebase:firebase-bom:$firebaseBom",
'messaging' : "com.google.firebase:firebase-messaging",
'appdistributionApi' : "com.google.firebase:firebase-appdistribution-api-ktx:$appDistribution",
'appdistribution' : "com.google.firebase:firebase-appdistribution:$appDistribution",
// Phone number https://github.com/google/libphonenumber
'phonenumber' : "com.googlecode.libphonenumber:libphonenumber:8.13.8"
'phonenumber' : "com.googlecode.libphonenumber:libphonenumber:8.13.11"
],
dagger : [
'dagger' : "com.google.dagger:dagger:$dagger",
Expand All @@ -101,7 +101,7 @@ ext.libs = [
],
element : [
'opusencoder' : "io.element.android:opusencoder:1.1.0",
'wysiwyg' : "io.element.android:wysiwyg:1.2.2"
'wysiwyg' : "io.element.android:wysiwyg:2.24.0"
],
squareup : [
'moshi' : "com.squareup.moshi:moshi:$moshi",
Expand Down Expand Up @@ -169,9 +169,10 @@ ext.libs = [
'sentryAndroid' : "io.sentry:sentry-android:$sentry"
],
tests : [
'kluent' : "org.amshove.kluent:kluent-android:1.72",
'kluent' : "org.amshove.kluent:kluent-android:1.73",
'timberJunitRule' : "net.lachlanmckee:timber-junit-rule:1.0.1",
'junit' : "junit:junit:4.13.2",
'robolectric' : "org.robolectric:robolectric:4.9",
]
]

Expand Down
34 changes: 16 additions & 18 deletions dependencies_groups.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
ext.groups = [
jitpack : [
jitpack : [
regex: [
],
group: [
'com.github.Armen101',
'com.github.chrisbanes',
'com.github.element-hq',
'com.github.hyuwah',
'com.github.jetradarmobile',
'com.github.MatrixFrog',
'com.github.tapadoo',
'com.github.UnifiedPush',
'com.github.vector-im',
'com.github.yalantis',
'com.github.Zhuinden',
]
],
jitsi : [
jitsi : [
regex: [
],
group: [
Expand All @@ -24,7 +24,7 @@ ext.groups = [
'org.webkit',
]
],
google : [
google : [
regex: [
'androidx\\..*',
'com\\.android\\.tools\\..*',
Expand All @@ -44,6 +44,13 @@ ext.groups = [
group: [
]
],
mavenSnapshots: [
regex: [
],
group: [
'org.matrix.rustcomponents'
]
],
mavenCentral: [
regex: [
],
Expand Down Expand Up @@ -108,6 +115,7 @@ ext.groups = [
'com.linkedin.dexmaker',
'com.mapbox.mapboxsdk',
'com.nulab-inc',
'com.otaliastudios',
'com.otaliastudios.opengl',
'com.parse.bolts',
'com.pinterest',
Expand Down Expand Up @@ -182,6 +190,7 @@ ext.groups = [
'org.codehaus.groovy',
'org.codehaus.mojo',
'org.codehaus.woodstox',
'org.conscrypt',
'org.eclipse.ee4j',
'org.ec4j.core',
'org.freemarker',
Expand All @@ -196,6 +205,7 @@ ext.groups = [
'org.jetbrains.kotlin',
'org.jetbrains.kotlinx',
'org.jetbrains.trove4j',
'org.jitsi',
'org.json',
'org.jsoup',
'org.junit',
Expand All @@ -204,6 +214,7 @@ ext.groups = [
'org.jvnet.staxex',
'org.maplibre.gl',
'org.matrix.android',
'org.matrix.rustcomponents',
'org.mockito',
'org.mongodb',
'org.objenesis',
Expand All @@ -212,6 +223,7 @@ ext.groups = [
'org.ow2.asm',
'org.ow2.asm',
'org.reactivestreams',
'org.robolectric',
'org.slf4j',
'org.sonatype.oss',
'org.testng',
Expand All @@ -223,18 +235,4 @@ ext.groups = [
'xml-apis',
]
],
jcenter : [
regex: [
],
group: [
'com.amulyakhare',
'com.otaliastudios',
'com.yqritc',
// https://github.com/cmelchior/realmfieldnameshelper/issues/42
'dk.ilios',
'im.dlg',
'me.dm7.barcodescanner',
'me.gujun.android',
]
]
]
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ vector.httpLogLevel=NONE
# Ref: https://github.com/vanniktech/gradle-maven-publish-plugin
GROUP=org.matrix.android
POM_ARTIFACT_ID=matrix-android-sdk2
VERSION_NAME=1.5.30
VERSION_NAME=1.6.10

POM_PACKAGING=aar

Expand Down
23 changes: 23 additions & 0 deletions library/external/realmfieldnameshelper/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apply plugin: 'kotlin'
apply plugin: 'java'

sourceCompatibility = versions.sourceCompat
targetCompatibility = versions.sourceCompat

dependencies {
implementation 'com.squareup:javapoet:1.13.0'
}

task javadocJar(type: Jar, dependsOn: 'javadoc') {
from javadoc.destinationDir
classifier = 'javadoc'
}
task sourcesJar(type: Jar, dependsOn: 'classes') {
from sourceSets.main.allSource
classifier = 'sources'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package dk.ilios.realmfieldnames

import java.util.TreeMap

/**
* Class responsible for keeping track of the metadata for each Realm model class.
*/
class ClassData(val packageName: String?, val simpleClassName: String, val libraryClass: Boolean = false) {

val fields = TreeMap<String, String?>() // <fieldName, linkedType or null>

fun addField(field: String, linkedType: String?) {
fields.put(field, linkedType)
}

val qualifiedClassName: String
get() {
if (packageName != null && !packageName.isEmpty()) {
return packageName + "." + simpleClassName
} else {
return simpleClassName
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package dk.ilios.realmfieldnames

import java.util.Locale

/**
* Class for encapsulating the rules for converting between the field name in the Realm model class
* and the matching name in the "&lt;class&gt;Fields" class.
*/
class FieldNameFormatter {

@JvmOverloads
fun format(fieldName: String?, locale: Locale = Locale.US): String {
if (fieldName == null || fieldName == "") {
return ""
}

// Normalize word separator chars
val normalizedFieldName: String = fieldName.replace('-', '_')

// Iterate field name using the following rules
// lowerCase m followed by upperCase anything is considered hungarian notation
// lowercase char followed by uppercase char is considered camel case
// Two uppercase chars following each other is considered non-standard camelcase
// _ and - are treated as word separators
val result = StringBuilder(normalizedFieldName.length)

if (normalizedFieldName.codePointCount(0, normalizedFieldName.length) == 1) {
result.append(normalizedFieldName)
} else {
var previousCodepoint: Int?
var currentCodepoint: Int? = null
val length = normalizedFieldName.length
var offset = 0
while (offset < length) {
previousCodepoint = currentCodepoint
currentCodepoint = normalizedFieldName.codePointAt(offset)

if (previousCodepoint != null) {
if (Character.isUpperCase(currentCodepoint) &&
!Character.isUpperCase(previousCodepoint) &&
previousCodepoint === 'm'.code as Int? &&
result.length == 1
) {
// Hungarian notation starting with: mX
result.delete(0, 1)
result.appendCodePoint(currentCodepoint)
} else if (Character.isUpperCase(currentCodepoint) && Character.isUpperCase(previousCodepoint)) {
// InvalidCamelCase: XXYx (should have been xxYx)
if (offset + Character.charCount(currentCodepoint) < normalizedFieldName.length) {
val nextCodePoint = normalizedFieldName.codePointAt(offset + Character.charCount(currentCodepoint))
if (Character.isLowerCase(nextCodePoint)) {
result.append("_")
}
}
result.appendCodePoint(currentCodepoint)
} else if (currentCodepoint === '-'.code as Int? || currentCodepoint === '_'.code as Int?) {
// Word-separator: x-x or x_x
result.append("_")
} else if (Character.isUpperCase(currentCodepoint) && !Character.isUpperCase(previousCodepoint) && Character.isLetterOrDigit(
previousCodepoint
)) {
// camelCase: xX
result.append("_")
result.appendCodePoint(currentCodepoint)
} else {
// Unknown type
result.appendCodePoint(currentCodepoint)
}
} else {
// Only triggered for first code point
result.appendCodePoint(currentCodepoint)
}
offset += Character.charCount(currentCodepoint)
}
}

return result.toString().uppercase(locale)
}
}
Loading

0 comments on commit a50ef5f

Please sign in to comment.