Change CI config so that it finds more breakages

Previously we did not run lint and did not try to compile the
AndroidTest instrumentation tests.
This commit is contained in:
Torsten Grote
2019-10-17 11:18:12 -03:00
parent 98eb78c7bc
commit 1be078d181
7 changed files with 46 additions and 31 deletions

View File

@@ -17,7 +17,7 @@ test:
script: script:
- ./gradlew --no-daemon -Djava.security.egd=file:/dev/urandom animalSnifferMain animalSnifferTest - ./gradlew --no-daemon -Djava.security.egd=file:/dev/urandom animalSnifferMain animalSnifferTest
- ./gradlew --no-daemon -Djava.security.egd=file:/dev/urandom test - ./gradlew --no-daemon -Djava.security.egd=file:/dev/urandom check compileOfficialDebugAndroidTestSources compileScreenshotDebugAndroidTestSources
after_script: after_script:
# these file change every time but should not be cached # these file change every time but should not be cached

View File

@@ -22,6 +22,14 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
} }
lintOptions {
// FIXME
warning "LintError"
warning "InvalidPackage"
warning "MissingPermission"
warning "InlinedApi", "ObsoleteSdkInt", "Override", "NewApi", "UnusedAttribute"
}
} }
configurations { configurations {

View File

@@ -82,6 +82,8 @@ android {
warning 'MissingTranslation' warning 'MissingTranslation'
warning 'ImpliedQuantity' warning 'ImpliedQuantity'
warning 'ExtraTranslation' warning 'ExtraTranslation'
// FIXME
warning 'InvalidPackage'
} }
} }

View File

@@ -213,7 +213,7 @@ public abstract class KeyAgreementActivity extends BriarActivity implements
if (bt.getScanMode() == SCAN_MODE_CONNECTABLE_DISCOVERABLE) if (bt.getScanMode() == SCAN_MODE_CONNECTABLE_DISCOVERABLE)
setBluetoothState(BluetoothState.DISCOVERABLE); setBluetoothState(BluetoothState.DISCOVERABLE);
} }
} } else super.onActivityResult(request, result, data);
} }
private void showQrCodeFragment() { private void showQrCodeFragment() {

View File

@@ -3,25 +3,11 @@ package org.briarproject.briar.android.util;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.KeyguardManager; import android.app.KeyguardManager;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.Observer;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnClickListener;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.PowerManager; import android.os.PowerManager;
import androidx.annotation.AttrRes;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.UiThread;
import com.google.android.material.textfield.TextInputLayout;
import androidx.fragment.app.FragmentManager;
import androidx.core.content.ContextCompat;
import androidx.core.hardware.fingerprint.FingerprintManagerCompat;
import androidx.appcompat.app.AlertDialog;
import android.text.Html; import android.text.Html;
import android.text.Spannable; import android.text.Spannable;
import android.text.SpannableString; import android.text.SpannableString;
@@ -39,6 +25,8 @@ import android.view.View;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.TextView; import android.widget.TextView;
import com.google.android.material.textfield.TextInputLayout;
import org.acra.ACRA; import org.acra.ACRA;
import org.briarproject.bramble.api.contact.Contact; import org.briarproject.bramble.api.contact.Contact;
import org.briarproject.bramble.api.contact.ContactId; import org.briarproject.bramble.api.contact.ContactId;
@@ -50,6 +38,20 @@ import org.briarproject.briar.R;
import org.briarproject.briar.android.view.ArticleMovementMethod; import org.briarproject.briar.android.view.ArticleMovementMethod;
import org.briarproject.briar.android.widget.LinkDialogFragment; import org.briarproject.briar.android.widget.LinkDialogFragment;
import androidx.annotation.AttrRes;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.UiThread;
import androidx.appcompat.app.AlertDialog;
import androidx.core.content.ContextCompat;
import androidx.core.hardware.fingerprint.FingerprintManagerCompat;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.Observer;
import static android.content.Context.KEYGUARD_SERVICE; import static android.content.Context.KEYGUARD_SERVICE;
import static android.content.Context.POWER_SERVICE; import static android.content.Context.POWER_SERVICE;
import static android.content.Intent.CATEGORY_DEFAULT; import static android.content.Intent.CATEGORY_DEFAULT;
@@ -57,13 +59,6 @@ import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.os.Build.MANUFACTURER; import static android.os.Build.MANUFACTURER;
import static android.os.Build.VERSION.SDK_INT; import static android.os.Build.VERSION.SDK_INT;
import static android.provider.Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS; import static android.provider.Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS;
import static androidx.core.content.ContextCompat.getSystemService;
import static androidx.core.view.ViewCompat.LAYOUT_DIRECTION_RTL;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES;
import static androidx.appcompat.app.AppCompatDelegate.setDefaultNightMode;
import static android.text.format.DateUtils.DAY_IN_MILLIS; import static android.text.format.DateUtils.DAY_IN_MILLIS;
import static android.text.format.DateUtils.FORMAT_ABBREV_ALL; import static android.text.format.DateUtils.FORMAT_ABBREV_ALL;
import static android.text.format.DateUtils.FORMAT_ABBREV_MONTH; import static android.text.format.DateUtils.FORMAT_ABBREV_MONTH;
@@ -79,6 +74,13 @@ import static android.view.KeyEvent.ACTION_DOWN;
import static android.view.KeyEvent.KEYCODE_ENTER; import static android.view.KeyEvent.KEYCODE_ENTER;
import static android.view.inputmethod.EditorInfo.IME_NULL; import static android.view.inputmethod.EditorInfo.IME_NULL;
import static android.view.inputmethod.InputMethodManager.SHOW_IMPLICIT; import static android.view.inputmethod.InputMethodManager.SHOW_IMPLICIT;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_TIME;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES;
import static androidx.appcompat.app.AppCompatDelegate.setDefaultNightMode;
import static androidx.core.content.ContextCompat.getSystemService;
import static androidx.core.view.ViewCompat.LAYOUT_DIRECTION_RTL;
import static java.util.Objects.requireNonNull; import static java.util.Objects.requireNonNull;
import static org.briarproject.briar.BuildConfig.APPLICATION_ID; import static org.briarproject.briar.BuildConfig.APPLICATION_ID;
import static org.briarproject.briar.android.TestingConstants.EXPIRY_DATE; import static org.briarproject.briar.android.TestingConstants.EXPIRY_DATE;
@@ -296,7 +298,8 @@ public class UiUtils {
setDefaultNightMode(MODE_NIGHT_YES); setDefaultNightMode(MODE_NIGHT_YES);
} else if (theme } else if (theme
.equals(ctx.getString(R.string.pref_theme_auto_value))) { .equals(ctx.getString(R.string.pref_theme_auto_value))) {
setDefaultNightMode(MODE_NIGHT_AUTO); // TODO remove AUTO-setting as it is deprecated
setDefaultNightMode(MODE_NIGHT_AUTO_TIME);
} else if (theme } else if (theme
.equals(ctx.getString(R.string.pref_theme_system_value))) { .equals(ctx.getString(R.string.pref_theme_system_value))) {
setDefaultNightMode(MODE_NIGHT_FOLLOW_SYSTEM); setDefaultNightMode(MODE_NIGHT_FOLLOW_SYSTEM);

View File

@@ -280,7 +280,7 @@
<string name="forum_invitation_response_declined_received">%s이(가) 포럼 초대장을 거절했습니다.</string> <string name="forum_invitation_response_declined_received">%s이(가) 포럼 초대장을 거절했습니다.</string>
<string name="sharing_status">공유 상태</string> <string name="sharing_status">공유 상태</string>
<string name="sharing_status_forum">포럼의 어느 구성원이든 연락처와 공유할 수 있습니다. 다음 연락처와 포럼을 공유하고 있습니다. 볼 수 없는 구성원이 더 있을 수 있습니다.</string> <string name="sharing_status_forum">포럼의 어느 구성원이든 연락처와 공유할 수 있습니다. 다음 연락처와 포럼을 공유하고 있습니다. 볼 수 없는 구성원이 더 있을 수 있습니다.</string>
<string name="shared_with">와(과) 공유하고 있습니다.(%1$d명 온라인)</string> <string name="shared_with">와(과) 공유하고 있습니다.(%1$d %2$d명 온라인)</string>
<plurals name="forums_shared"> <plurals name="forums_shared">
<item quantity="other">연락처와 공유한 %d개의 포럼</item> <item quantity="other">연락처와 공유한 %d개의 포럼</item>
</plurals> </plurals>

View File

@@ -1,17 +1,19 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.briarproject.briar" xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"> package="org.briarproject.briar">
<!-- The following permissions are only needed for taking automatic screenshots (fastlane) --> <!-- The following permissions are only needed for taking automatic screenshots (fastlane) -->
<!-- Allows unlocking your device and activating its screen so UI tests can succeed --> <!-- Allows unlocking your device and activating its screen so UI tests can succeed -->
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/> <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Allows for storing and retrieving screenshots --> <!-- Allows for storing and retrieving screenshots -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<!-- Allows changing locales --> <!-- Allows changing locales -->
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" /> <uses-permission
android:name="android.permission.CHANGE_CONFIGURATION"
tools:ignore="ProtectedPermissions" />
</manifest> </manifest>