Add replacement suspend functions in Source interface

This commit is contained in:
arkon 2023-09-02 22:18:11 -04:00
parent 7c0b891286
commit 30a6effc50
6 changed files with 42 additions and 9 deletions

View File

@ -1,4 +1,4 @@
jdk:
- openjdk11
- openjdk17
install:
- ./gradlew build :library:publishToMavenLocal

View File

@ -7,7 +7,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong

View File

@ -17,6 +17,15 @@ android {
minifyEnabled false
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
}
dependencies {

View File

@ -22,24 +22,48 @@ interface Source {
val name: String
/**
* Returns an observable with the updated details for a manga.
* Get the updated details for a manga.
*
* @since extensions-lib 1.4
* @param manga the manga to update.
* @return the updated manga.
*/
fun fetchMangaDetails(manga: SManga): Observable<SManga>
suspend fun getMangaDetails(manga: SManga): SManga = throw Exception("Stub!")
/**
* Returns an observable with all the available chapters for a manga.
* Get all the available chapters for a manga.
*
* @since extensions-lib 1.4
* @param manga the manga to update.
* @return the chapters for the manga.
*/
fun fetchChapterList(manga: SManga): Observable<List<SChapter>>
suspend fun getChapterList(manga: SManga): List<SChapter> = throw Exception("Stub!")
/**
* Returns an observable with the list of pages a chapter has.
* Get the list of pages a chapter has. Pages should be returned
* in the expected order; the index is ignored.
*
* @since extensions-lib 1.4
* @param chapter the chapter.
* @return the pages for the chapter.
*/
fun fetchPageList(chapter: SChapter): Observable<List<Page>>
suspend fun getPageList(chapter: SChapter): List<Page> = throw Exception("Stub!")
@Deprecated(
"Use the non-RxJava API instead",
ReplaceWith("getMangaDetails"),
)
fun fetchMangaDetails(manga: SManga): Observable<SManga> = throw Exception("Stub!")
@Deprecated(
"Use the non-RxJava API instead",
ReplaceWith("getChapterList"),
)
fun fetchChapterList(manga: SManga): Observable<List<SChapter>> = throw Exception("Stub!")
@Deprecated(
"Use the non-RxJava API instead",
ReplaceWith("getPageList"),
)
fun fetchPageList(chapter: SChapter): Observable<List<Page>> = throw Exception("Stub!")
}

View File

@ -1 +0,0 @@
include ':library'

1
settings.gradle.kts Normal file
View File

@ -0,0 +1 @@
include(":library")