Create :backend:api module
This commit is contained in:
parent
41737f946c
commit
3e544af1cd
16 changed files with 60 additions and 22 deletions
30
backend/api/build.gradle
Normal file
30
backend/api/build.gradle
Normal file
|
@ -0,0 +1,30 @@
|
|||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'org.jetbrains.kotlin.android'
|
||||
|
||||
apply from: "${rootProject.projectDir}/gradle/plugins/checkstyle-android.gradle"
|
||||
apply from: "${rootProject.projectDir}/gradle/plugins/findbugs-android.gradle"
|
||||
|
||||
dependencies {
|
||||
api project(":mail:common")
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}"
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion buildConfig.compileSdk
|
||||
buildToolsVersion buildConfig.buildTools
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion buildConfig.minSdk
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
lintConfig file("$rootProject.projectDir/config/lint/lint.xml")
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_7
|
||||
targetCompatibility JavaVersion.VERSION_1_7
|
||||
}
|
||||
}
|
2
backend/api/src/main/AndroidManifest.xml
Normal file
2
backend/api/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="com.fsck.k9.backend.api" />
|
|
@ -1,8 +1,7 @@
|
|||
package com.fsck.k9.controller
|
||||
package com.fsck.k9.backend.api
|
||||
|
||||
import com.fsck.k9.mail.Flag
|
||||
import com.fsck.k9.mail.Message
|
||||
import com.fsck.k9.mailstore.MessageRemovalListener
|
||||
|
||||
//FIXME: add documentation
|
||||
interface BackendFolder {
|
|
@ -1,4 +1,4 @@
|
|||
package com.fsck.k9.controller
|
||||
package com.fsck.k9.backend.api
|
||||
|
||||
interface BackendStorage {
|
||||
fun getFolder(folderServerId: String): BackendFolder
|
|
@ -1,4 +1,4 @@
|
|||
package com.fsck.k9.mailstore;
|
||||
package com.fsck.k9.backend.api;
|
||||
|
||||
import com.fsck.k9.mail.Message;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.fsck.k9.controller;
|
||||
package com.fsck.k9.backend.api;
|
||||
|
||||
|
||||
import com.fsck.k9.mail.Folder;
|
|
@ -1,4 +1,4 @@
|
|||
package com.fsck.k9.controller
|
||||
package com.fsck.k9.backend.api
|
||||
|
||||
interface SyncListener {
|
||||
fun syncStarted(folderServerId: String, folderName: String)
|
|
@ -25,6 +25,7 @@ dependencies {
|
|||
implementation project(":mail:protocols:pop3")
|
||||
implementation project(":mail:protocols:webdav")
|
||||
implementation project(":mail:protocols:smtp")
|
||||
implementation project(":backend:api")
|
||||
|
||||
implementation project(':plugins:HoloColorPicker')
|
||||
implementation project(':plugins:openpgp-api-lib:openpgp-api')
|
||||
|
|
|
@ -47,6 +47,10 @@ import com.fsck.k9.R;
|
|||
import com.fsck.k9.activity.ActivityListener;
|
||||
import com.fsck.k9.activity.MessageReference;
|
||||
import com.fsck.k9.activity.setup.AccountSetupCheckSettings.CheckDirection;
|
||||
import com.fsck.k9.backend.api.BackendStorage;
|
||||
import com.fsck.k9.backend.api.MessageRemovalListener;
|
||||
import com.fsck.k9.backend.api.RemoteMessageStore;
|
||||
import com.fsck.k9.backend.api.SyncListener;
|
||||
import com.fsck.k9.cache.EmailProviderCache;
|
||||
import com.fsck.k9.controller.MessagingControllerCommands.PendingAppend;
|
||||
import com.fsck.k9.controller.MessagingControllerCommands.PendingCommand;
|
||||
|
@ -88,7 +92,6 @@ import com.fsck.k9.mailstore.LocalFolder;
|
|||
import com.fsck.k9.mailstore.LocalFolder.MoreMessages;
|
||||
import com.fsck.k9.mailstore.LocalMessage;
|
||||
import com.fsck.k9.mailstore.LocalStore;
|
||||
import com.fsck.k9.mailstore.MessageRemovalListener;
|
||||
import com.fsck.k9.mailstore.UnavailableStorageException;
|
||||
import com.fsck.k9.notification.NotificationController;
|
||||
import com.fsck.k9.search.LocalSearch;
|
||||
|
|
|
@ -2,9 +2,9 @@ package com.fsck.k9.controller.imap;
|
|||
|
||||
|
||||
import com.fsck.k9.Account;
|
||||
import com.fsck.k9.controller.BackendStorage;
|
||||
import com.fsck.k9.controller.RemoteMessageStore;
|
||||
import com.fsck.k9.controller.SyncListener;
|
||||
import com.fsck.k9.backend.api.BackendStorage;
|
||||
import com.fsck.k9.backend.api.RemoteMessageStore;
|
||||
import com.fsck.k9.backend.api.SyncListener;
|
||||
import com.fsck.k9.mail.Folder;
|
||||
import com.fsck.k9.mail.store.imap.ImapStore;
|
||||
|
||||
|
|
|
@ -15,11 +15,12 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||
import com.fsck.k9.Account;
|
||||
import com.fsck.k9.Account.Expunge;
|
||||
import com.fsck.k9.K9;
|
||||
import com.fsck.k9.controller.BackendFolder;
|
||||
import com.fsck.k9.controller.BackendFolder.MoreMessages;
|
||||
import com.fsck.k9.controller.BackendStorage;
|
||||
import com.fsck.k9.backend.api.BackendFolder;
|
||||
import com.fsck.k9.backend.api.BackendFolder.MoreMessages;
|
||||
import com.fsck.k9.backend.api.BackendStorage;
|
||||
import com.fsck.k9.backend.api.MessageRemovalListener;
|
||||
import com.fsck.k9.backend.api.SyncListener;
|
||||
import com.fsck.k9.controller.MessagingController;
|
||||
import com.fsck.k9.controller.SyncListener;
|
||||
import com.fsck.k9.controller.UidReverseComparator;
|
||||
import com.fsck.k9.mail.AuthenticationFailedException;
|
||||
import com.fsck.k9.mail.BodyFactory;
|
||||
|
@ -33,7 +34,6 @@ import com.fsck.k9.mail.MessagingException;
|
|||
import com.fsck.k9.mail.Part;
|
||||
import com.fsck.k9.mail.internet.MessageExtractor;
|
||||
import com.fsck.k9.mail.store.imap.ImapStore;
|
||||
import com.fsck.k9.mailstore.MessageRemovalListener;
|
||||
import timber.log.Timber;
|
||||
|
||||
import static com.fsck.k9.helper.ExceptionHelper.getRootCauseMessage;
|
||||
|
|
|
@ -3,8 +3,9 @@ package com.fsck.k9.mailstore
|
|||
import android.content.ContentValues
|
||||
import android.database.Cursor
|
||||
import androidx.core.database.getStringOrNull
|
||||
import com.fsck.k9.controller.BackendFolder
|
||||
import com.fsck.k9.controller.BackendFolder.MoreMessages
|
||||
import com.fsck.k9.backend.api.BackendFolder
|
||||
import com.fsck.k9.backend.api.BackendFolder.MoreMessages
|
||||
import com.fsck.k9.backend.api.MessageRemovalListener
|
||||
import com.fsck.k9.mail.Flag
|
||||
import com.fsck.k9.mail.Message
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.fsck.k9.mailstore
|
||||
|
||||
import com.fsck.k9.controller.BackendFolder
|
||||
import com.fsck.k9.controller.BackendStorage
|
||||
import com.fsck.k9.backend.api.BackendFolder
|
||||
import com.fsck.k9.backend.api.BackendStorage
|
||||
|
||||
class K9BackendStorage(private val localStore: LocalStore) : BackendStorage {
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ import com.fsck.k9.Account;
|
|||
import com.fsck.k9.K9;
|
||||
import com.fsck.k9.activity.MessageReference;
|
||||
import com.fsck.k9.activity.Search;
|
||||
import com.fsck.k9.backend.api.MessageRemovalListener;
|
||||
import com.fsck.k9.helper.FileHelper;
|
||||
import com.fsck.k9.helper.Utility;
|
||||
import com.fsck.k9.mail.Address;
|
||||
|
|
|
@ -12,11 +12,11 @@ import android.content.Context;
|
|||
import com.fsck.k9.Account;
|
||||
import com.fsck.k9.AccountStats;
|
||||
import com.fsck.k9.RobolectricTest;
|
||||
import com.fsck.k9.controller.BackendFolder;
|
||||
import com.fsck.k9.controller.BackendStorage;
|
||||
import com.fsck.k9.backend.api.BackendFolder;
|
||||
import com.fsck.k9.backend.api.BackendStorage;
|
||||
import com.fsck.k9.controller.MessagingController;
|
||||
import com.fsck.k9.controller.MessagingListener;
|
||||
import com.fsck.k9.controller.SyncListener;
|
||||
import com.fsck.k9.backend.api.SyncListener;
|
||||
import com.fsck.k9.mail.FetchProfile;
|
||||
import com.fsck.k9.mail.Folder;
|
||||
import com.fsck.k9.mail.Message;
|
||||
|
|
|
@ -5,5 +5,6 @@ include ':mail:protocols:imap'
|
|||
include ':mail:protocols:pop3'
|
||||
include ':mail:protocols:webdav'
|
||||
include ':mail:protocols:smtp'
|
||||
include ':backend:api'
|
||||
include ':plugins:HoloColorPicker'
|
||||
include ':plugins:openpgp-api-lib:openpgp-api'
|
||||
|
|
Loading…
Reference in a new issue