diff --git a/build.gradle b/build.gradle index 467fe8b32..ab3d03d22 100644 --- a/build.gradle +++ b/build.gradle @@ -8,9 +8,14 @@ buildscript { maven { url "https://repo1.maven.org/maven2" } + jcenter { + content { + includeVersion 'org.jetbrains.trove4j', 'trove4j', '20160824' + } + } } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.5.1' classpath 'androidx.navigation:navigation-safe-args-gradle-plugin:2.1.0' } } @@ -339,6 +344,7 @@ android { lintOptions { abortOnError true baseline file("lint-baseline.xml") + disable "LintError" } testOptions { @@ -443,3 +449,7 @@ task qa { description 'Quality Assurance. Run before pushing.' dependsOn ':testPlayReleaseUnitTest', ':lintPlayRelease', ':assemblePlayDebug' } + +wrapper { + distributionType = Wrapper.DistributionType.ALL +} \ No newline at end of file diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 889ee1d68..736a1a9c7 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -5,5 +5,5 @@ repositories { } dependencies { - compile 'com.android.tools.build:apksig:3.3.2' + implementation 'com.android.tools.build:apksig:3.5.1' } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 87b738cbd..5c2d1cf01 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1b2b07cfb..5088094a6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ +# Note: Check https://gradle.org/release-checksums/ before updating wrapper or distribution distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip +distributionSha256Sum=027fdd265d277bae65a0d349b6b8da02135b0b8e14ba891e26281fa877fe37a2 +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index af6708ff2..83f2acfdc 100755 --- a/gradlew +++ b/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# 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 +# +# https://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. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m"' +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -109,8 +125,8 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` diff --git a/gradlew.bat b/gradlew.bat index 0f8d5937c..24467a141 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/test/unitTest/java/org/thoughtcrime/securesms/util/DelimiterUtilTest.java b/test/unitTest/java/org/thoughtcrime/securesms/util/DelimiterUtilTest.java index 8d7a25e88..54a6722f8 100644 --- a/test/unitTest/java/org/thoughtcrime/securesms/util/DelimiterUtilTest.java +++ b/test/unitTest/java/org/thoughtcrime/securesms/util/DelimiterUtilTest.java @@ -1,15 +1,31 @@ package org.thoughtcrime.securesms.util; +import android.text.TextUtils; + import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.mockito.stubbing.Answer; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; import static junit.framework.Assert.assertEquals; +@RunWith(PowerMockRunner.class) +@PrepareForTest(TextUtils.class) public class DelimiterUtilTest { @Before - public void setup() {} + public void setup() { + PowerMockito.mockStatic(TextUtils.class); + PowerMockito.when(TextUtils.isEmpty(Mockito.anyString())).thenAnswer((Answer) invocation -> { + if (invocation.getArguments()[0] == null) return true; + return ((String) invocation.getArguments()[0]).isEmpty(); + }); + } @Test public void testEscape() {