From f385ea1def4e0e75a1483b5552d4bc542ccb9cb2 Mon Sep 17 00:00:00 2001 From: Steven Zeck <8315038+stevenzeck@users.noreply.github.com> Date: Mon, 20 Dec 2021 00:06:03 -0600 Subject: [PATCH 01/12] First go around of migrating from Groovy to Kotlin --- build.gradle | 72 --------------- build.gradle.kts | 77 ++++++++++++++++ readium/lcp/build.gradle | 85 ------------------ readium/lcp/build.gradle.kts | 88 ++++++++++++++++++ readium/navigator/build.gradle | 106 ---------------------- readium/navigator/build.gradle.kts | 107 ++++++++++++++++++++++ readium/opds/build.gradle | 67 -------------- readium/opds/build.gradle.kts | 68 ++++++++++++++ readium/shared/build.gradle | 84 ----------------- readium/shared/build.gradle.kts | 85 ++++++++++++++++++ readium/streamer/build.gradle | 89 ------------------ readium/streamer/build.gradle.kts | 90 +++++++++++++++++++ settings.gradle | 17 ---- settings.gradle.kts | 23 +++++ test-app/build.gradle | 135 ---------------------------- test-app/build.gradle.kts | 139 +++++++++++++++++++++++++++++ 16 files changed, 677 insertions(+), 655 deletions(-) delete mode 100644 build.gradle create mode 100644 build.gradle.kts delete mode 100644 readium/lcp/build.gradle create mode 100644 readium/lcp/build.gradle.kts delete mode 100644 readium/navigator/build.gradle create mode 100644 readium/navigator/build.gradle.kts delete mode 100644 readium/opds/build.gradle create mode 100644 readium/opds/build.gradle.kts delete mode 100644 readium/shared/build.gradle create mode 100644 readium/shared/build.gradle.kts delete mode 100644 readium/streamer/build.gradle create mode 100644 readium/streamer/build.gradle.kts delete mode 100644 settings.gradle create mode 100644 settings.gradle.kts delete mode 100644 test-app/build.gradle create mode 100644 test-app/build.gradle.kts diff --git a/build.gradle b/build.gradle deleted file mode 100644 index e79bea2c43..0000000000 --- a/build.gradle +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2021 Readium Foundation. All rights reserved. - * Use of this source code is governed by the BSD-style license - * available in the top-level LICENSE file of the project. - */ - -buildscript { - ext.kotlin_version = '1.6.10' - ext.dokka_version = '1.5.30' - - repositories { - google() - jcenter() - mavenLocal() - mavenCentral() - maven { url 'https://jitpack.io' } - maven { url "https://s3.amazonaws.com/repo.commonsware.com" } - } - dependencies { - classpath 'com.android.tools.build:gradle:7.0.4' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version" - } -} - -apply plugin: 'org.jetbrains.dokka' - -allprojects { - repositories { - google() - jcenter() - mavenLocal() - mavenCentral() - maven { url 'https://jitpack.io' } - maven { url "https://s3.amazonaws.com/repo.commonsware.com" } - } -} - -subprojects { project -> - if (project.name == 'test-app' || project.name == 'readium') return - apply plugin: 'org.jetbrains.dokka' - tasks.named("dokkaGfmPartial") { - dokkaSourceSets { - configureEach { - reportUndocumented.set(false) - skipEmptyPackages.set(false) - skipDeprecated.set(true) - } - } - } - - task javadocsJar(type: Jar) { - archiveClassifier.set("javadoc") - } - - task sourcesJar(type: Jar) { - archiveClassifier.set("sources") - from "src/main/java", "src/main/resources" - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} - -task cleanDocs(type: Delete) { - delete "${project.rootDir}/docs/readium", "${project.rootDir}/docs/index.md" -} - -tasks.dokkaGfmMultiModule.configure { - outputDirectory = new File("${project.rootDir}/docs") -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000000..af495495d4 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,77 @@ +/* + * Copyright 2021 Readium Foundation. All rights reserved. + * Use of this source code is governed by the BSD-style license + * available in the top-level LICENSE file of the project. + */ + +import org.jetbrains.dokka.gradle.DokkaTaskPartial + +buildscript { + extra.set("kotlin_version", "1.6.10") + val kotlin_version = "1.6.10" + val dokka_version = "1.6.0" + + repositories { + google() + jcenter() + mavenLocal() + mavenCentral() + maven(url = "https://jitpack.io") + maven(url = "https://s3.amazonaws.com/repo.commonsware.com") + } + dependencies { + classpath("com.android.tools.build:gradle:7.0.4") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") + classpath("org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version") + } +} + +//plugins { +// id("org.jetbrains.dokka") version ("1.5.30") +//} +apply(plugin="org.jetbrains.dokka") + +allprojects { + repositories { + google() + jcenter() + mavenLocal() + mavenCentral() + maven(url = "https://jitpack.io") + maven(url = "https://s3.amazonaws.com/repo.commonsware.com") + } +} + +subprojects { + tasks.register("javadocsJar") { + archiveClassifier.set("javadoc") + } + + tasks.register("sourcesJar") { + archiveClassifier.set("sources") + from("src/main/java", "src/main/resources") + } +} + +tasks.register("clean", Delete::class).configure { + delete(rootProject.buildDir) +} + +tasks.register("cleanDocs", Delete::class).configure { + delete("${project.rootDir}/docs/readium", "${project.rootDir}/docs/index.md") +} + +tasks.withType().configureEach { + outputDirectory.set(file("${project.rootDir}/docs")) + dokkaSourceSets { + configureEach { + reportUndocumented.set(false) + skipEmptyPackages.set(false) + skipDeprecated.set(true) + } + } +} +// +//tasks.named("dokkaGfmMultimodule").configure { +// outputDirectory.set(file("${project.rootDir}/docs")) +//} diff --git a/readium/lcp/build.gradle b/readium/lcp/build.gradle deleted file mode 100644 index a3efadd69e..0000000000 --- a/readium/lcp/build.gradle +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2018 Readium Foundation. All rights reserved. - * Use of this source code is governed by the BSD-style license - * available in the top-level LICENSE file of the project. - */ - -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-parcelize' - id 'kotlin-kapt' - id 'maven-publish' -} - -android { - - compileSdkVersion 31 - defaultConfig { - minSdkVersion 21 - targetSdkVersion 31 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - compileOptions { - sourceCompatibility 1.8 - targetCompatibility 1.8 - } - kotlinOptions { - jvmTarget = "1.8" - freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" - allWarningsAsErrors = true - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt') - } - } -} - -afterEvaluate { - publishing { - publications { - release(MavenPublication) { - from components.release - - groupId = 'com.github.readium' - artifactId = 'readium-lcp' - - artifact sourcesJar - artifact javadocsJar - } - } - } -} - -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2" - - api project(':readium:shared') - - implementation 'androidx.constraintlayout:constraintlayout:2.1.2' - implementation 'androidx.core:core-ktx:1.7.0' - implementation 'com.google.android.material:material:1.4.0' - implementation 'com.jakewharton.timber:timber:5.0.1' - implementation("com.mcxiaoke.koi:async:0.5.5") { - exclude module: 'support-v4' - } - implementation("com.mcxiaoke.koi:core:0.5.5") { - exclude module: 'support-v4' - } - implementation 'joda-time:joda-time:2.10.13' - implementation "org.zeroturnaround:zt-zip:1.14" - implementation 'androidx.browser:browser:1.4.0' - - final room_version = '2.4.0' - implementation "androidx.room:room-runtime:$room_version" - implementation "androidx.room:room-ktx:$room_version" - kapt "androidx.room:room-compiler:$room_version" - - // Tests - testImplementation "junit:junit:4.13.2" - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' -} diff --git a/readium/lcp/build.gradle.kts b/readium/lcp/build.gradle.kts new file mode 100644 index 0000000000..3cde7d1616 --- /dev/null +++ b/readium/lcp/build.gradle.kts @@ -0,0 +1,88 @@ +/* + * Copyright 2018 Readium Foundation. All rights reserved. + * Use of this source code is governed by the BSD-style license + * available in the top-level LICENSE file of the project. + */ + +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-parcelize") + id("kotlin-kapt") + id("maven-publish") + id("org.jetbrains.dokka") +} + +android { + + compileSdk = 31 + defaultConfig { + minSdk = 21 + targetSdk = 31 + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" + allWarningsAsErrors = true + } + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt")) + } + } +} + +//afterEvaluate { +// publishing { +// publications { +// +// release(MavenPublication) { +// from components.release +// +// groupId = "com.github.readium" +// artifactId = "readium-lcp" +// +// artifact sourcesJar +// artifact javadocsJar +// } +// } +// } +//} + +dependencies { + implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) + + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2") + + api(platform(project(":readium:shared"))) + + implementation("androidx.constraintlayout:constraintlayout:2.1.2") + implementation("androidx.core:core-ktx:1.7.0") + implementation("com.google.android.material:material:1.4.0") + implementation("com.jakewharton.timber:timber:5.0.1") + implementation("com.mcxiaoke.koi:async:0.5.5") { + exclude(module = "support-v4") + } + implementation("com.mcxiaoke.koi:core:0.5.5") { + exclude(module = "support-v4") + } + implementation("joda-time:joda-time:2.10.13") + implementation("org.zeroturnaround:zt-zip:1.14") + implementation("androidx.browser:browser:1.4.0") + + val room_version = "2.4.0" + implementation("androidx.room:room-runtime:$room_version") + implementation("androidx.room:room-ktx:$room_version") + kapt("androidx.room:room-compiler:$room_version") + + // Tests + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.3") + androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0") +} diff --git a/readium/navigator/build.gradle b/readium/navigator/build.gradle deleted file mode 100644 index 9c7bc0ae49..0000000000 --- a/readium/navigator/build.gradle +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2018 Readium Foundation. All rights reserved. - * Use of this source code is governed by the BSD-style license - * available in the top-level LICENSE file of the project. - */ - -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-parcelize' - id 'maven-publish' -} - -android { - // FIXME: This doesn't pass the lint because some resources don't start with r2_ yet. We need to rename all resources for the next major version. -// resourcePrefix "r2_" - - compileSdkVersion 31 - - defaultConfig { - minSdkVersion 21 - targetSdkVersion 31 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt') - } - } - buildFeatures { - viewBinding true - } -} - -afterEvaluate { - publishing { - publications { - release(MavenPublication) { - from components.release - - groupId = 'com.github.readium' - artifactId = 'readium-navigator' - - artifact sourcesJar - artifact javadocsJar - } - } - } -} - -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - - api project(':readium:shared') - - implementation 'androidx.activity:activity-ktx:1.4.0' - implementation 'androidx.appcompat:appcompat:1.4.0' - implementation "androidx.browser:browser:1.4.0" - implementation 'androidx.constraintlayout:constraintlayout:2.1.2' - implementation 'androidx.core:core-ktx:1.7.0' - implementation 'androidx.fragment:fragment-ktx:1.4.0' - implementation "androidx.legacy:legacy-support-core-ui:1.0.0" - implementation "androidx.legacy:legacy-support-v4:1.0.0" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.0" - implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.0" - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0" - implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.4.0" - implementation "androidx.recyclerview:recyclerview:1.2.1" - implementation "androidx.media:media:1.4.3" - implementation "androidx.viewpager2:viewpager2:1.0.0" - implementation "androidx.webkit:webkit:1.4.0" - // Needed to avoid a crash with API 31, see https://stackoverflow.com/a/69152986/1474476 - implementation 'androidx.work:work-runtime-ktx:2.7.1' - implementation "com.duolingo.open:rtl-viewpager:1.0.3" - api "com.github.barteksc:android-pdf-viewer:2.8.2" - // ChrisBane/PhotoView ( for the Zoom handling ) - implementation "com.github.chrisbanes:PhotoView:2.3.0" - // ExoPlayer is used by the Audio Navigator. - api 'com.google.android.exoplayer:exoplayer-core:2.16.1' - api 'com.google.android.exoplayer:exoplayer-ui:2.16.1' - api 'com.google.android.exoplayer:extension-mediasession:2.16.1' - api 'com.google.android.exoplayer:extension-workmanager:2.16.1' - implementation 'com.google.android.material:material:1.4.0' - implementation 'com.jakewharton.timber:timber:5.0.1' - implementation "com.shopgun.android:utils:1.0.9" - implementation 'joda-time:joda-time:2.10.13' - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2" - // AM NOTE: needs to stay this version for now (June 24,2020) - //noinspection GradleDependency - implementation 'org.jsoup:jsoup:1.14.3' - - // Tests - testImplementation "junit:junit:4.13.2" - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' -} diff --git a/readium/navigator/build.gradle.kts b/readium/navigator/build.gradle.kts new file mode 100644 index 0000000000..c027097207 --- /dev/null +++ b/readium/navigator/build.gradle.kts @@ -0,0 +1,107 @@ +/* + * Copyright 2018 Readium Foundation. All rights reserved. + * Use of this source code is governed by the BSD-style license + * available in the top-level LICENSE file of the project. + */ + +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-parcelize") + id("maven-publish") + id("org.jetbrains.dokka") +} + +android { + // FIXME: This doesn"t pass the lint because some resources don"t start with r2_ yet. We need to rename all resources for the next major version. +// resourcePrefix "r2_" + + compileSdk = 31 + + defaultConfig { + minSdk = 21 + targetSdk = 31 + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" + } + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt")) + } + } + buildFeatures { + viewBinding = true + } +} + +//afterEvaluate { +// publishing { +// publications { +// release(MavenPublication) { +// from components.release +// +// groupId = "com.github.readium" +// artifactId = "readium-navigator" +// +// artifact sourcesJar +// artifact javadocsJar +// } +// } +// } +//} + +dependencies { + implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) + + api(platform(project(":readium:shared"))) + + implementation("androidx.activity:activity-ktx:1.4.0") + implementation("androidx.appcompat:appcompat:1.4.0") + implementation("androidx.browser:browser:1.4.0") + implementation("androidx.constraintlayout:constraintlayout:2.1.2") + implementation("androidx.core:core-ktx:1.7.0") + implementation("androidx.fragment:fragment-ktx:1.4.0") + implementation("androidx.legacy:legacy-support-core-ui:1.0.0") + implementation("androidx.legacy:legacy-support-v4:1.0.0") + implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.4.0") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.0") + implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0") + implementation("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.4.0") + implementation("androidx.recyclerview:recyclerview:1.2.1") + implementation("androidx.media:media:1.4.3") + implementation("androidx.viewpager2:viewpager2:1.0.0") + implementation("androidx.webkit:webkit:1.4.0") + // Needed to avoid a crash with API 31, see https://stackoverflow.com/a/69152986/1474476 + implementation("androidx.work:work-runtime-ktx:2.7.1") + implementation("com.duolingo.open:rtl-viewpager:1.0.3") + api("com.github.barteksc:android-pdf-viewer:2.8.2") + // ChrisBane/PhotoView ( for the Zoom handling ) + implementation("com.github.chrisbanes:PhotoView:2.3.0") + // ExoPlayer is used by the Audio Navigator. + api("com.google.android.exoplayer:exoplayer-core:2.16.1") + api("com.google.android.exoplayer:exoplayer-ui:2.16.1") + api("com.google.android.exoplayer:extension-mediasession:2.16.1") + api("com.google.android.exoplayer:extension-workmanager:2.16.1") + implementation("com.google.android.material:material:1.4.0") + implementation("com.jakewharton.timber:timber:5.0.1") + implementation("com.shopgun.android:utils:1.0.9") + implementation("joda-time:joda-time:2.10.13") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2") + // AM NOTE: needs to stay this version for now (June 24,2020) + //noinspection GradleDependency + implementation("org.jsoup:jsoup:1.14.3") + + // Tests + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.3") + androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0") +} diff --git a/readium/opds/build.gradle b/readium/opds/build.gradle deleted file mode 100644 index 068efaacc2..0000000000 --- a/readium/opds/build.gradle +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2018 Readium Foundation. All rights reserved. - * Use of this source code is governed by the BSD-style license - * available in the top-level LICENSE file of the project. - */ - -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-parcelize' - id 'maven-publish' -} - -android { - compileSdkVersion 31 - defaultConfig { - minSdkVersion 21 - targetSdkVersion 31 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - compileOptions { - sourceCompatibility 1.8 - targetCompatibility 1.8 - } - testOptions { - unitTests.includeAndroidResources = true - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt') - } - } -} - -afterEvaluate { - publishing { - publications { - release(MavenPublication) { - from components.release - groupId = 'com.github.readium' - artifactId = 'readium-opds' - - artifact sourcesJar - artifact javadocsJar - } - } - } -} - -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - - api project(':readium:shared') - - implementation 'androidx.appcompat:appcompat:1.4.0' - implementation 'com.jakewharton.timber:timber:5.0.1' - implementation "joda-time:joda-time:2.10.13" - implementation "nl.komponents.kovenant:kovenant:3.3.0" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2" - - // Tests - testImplementation 'junit:junit:4.13.2' - testImplementation 'org.robolectric:robolectric:4.7.3' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' -} diff --git a/readium/opds/build.gradle.kts b/readium/opds/build.gradle.kts new file mode 100644 index 0000000000..736fcc9bae --- /dev/null +++ b/readium/opds/build.gradle.kts @@ -0,0 +1,68 @@ +/* + * Copyright 2018 Readium Foundation. All rights reserved. + * Use of this source code is governed by the BSD-style license + * available in the top-level LICENSE file of the project. + */ + +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-parcelize") + id("maven-publish") + id("org.jetbrains.dokka") +} + +android { + compileSdk = 31 + defaultConfig { + minSdk = 21 + targetSdk = 31 + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + testOptions { + unitTests.isIncludeAndroidResources = true + } + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt")) + } + } +} + +//afterEvaluate { +// publishing { +// publications { +// release(MavenPublication) { +// from components.release +// groupId = "com.github.readium" +// artifactId = "readium-opds" +// +// artifact sourcesJar +// artifact javadocsJar +// } +// } +// } +//} + +dependencies { + implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) + + api(platform(project(":readium:shared"))) + + implementation("androidx.appcompat:appcompat:1.4.0") + implementation("com.jakewharton.timber:timber:5.0.1") + implementation("joda-time:joda-time:2.10.13") + implementation("nl.komponents.kovenant:kovenant:3.3.0") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2") + + // Tests + testImplementation("junit:junit:4.13.2") + testImplementation("org.robolectric:robolectric:4.7.3") + androidTestImplementation("androidx.test.ext:junit:1.1.3") + androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0") +} diff --git a/readium/shared/build.gradle b/readium/shared/build.gradle deleted file mode 100644 index ce1820b694..0000000000 --- a/readium/shared/build.gradle +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2018 Readium Foundation. All rights reserved. - * Use of this source code is governed by the BSD-style license - * available in the top-level LICENSE file of the project. - */ - -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-parcelize' - id 'maven-publish' -} - -android { - compileSdkVersion 31 - defaultConfig { - minSdkVersion 21 - targetSdkVersion 31 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - compileOptions { - sourceCompatibility 1.8 - targetCompatibility 1.8 - } - kotlinOptions { - freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" - allWarningsAsErrors = true - } - testOptions { - unitTests.includeAndroidResources = true - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt') - } - } -} - -afterEvaluate { - publishing { - publications { - release(MavenPublication) { - from components.release - - groupId = 'com.github.readium' - artifactId = 'readium-shared' - - artifact sourcesJar - artifact javadocsJar - } - } - } -} - -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - - implementation 'androidx.appcompat:appcompat:1.4.0' - implementation 'androidx.browser:browser:1.4.0' - implementation 'com.github.kittinunf.fuel:fuel-android:2.3.1' - implementation 'com.github.kittinunf.fuel:fuel:2.3.1' - implementation 'com.jakewharton.timber:timber:5.0.1' - implementation "joda-time:joda-time:2.10.13" - implementation "nl.komponents.kovenant:kovenant-android:3.3.0" - implementation "nl.komponents.kovenant:kovenant-combine:3.3.0" - implementation "nl.komponents.kovenant:kovenant-core:3.3.0" - implementation "nl.komponents.kovenant:kovenant-functional:3.3.0" - implementation "nl.komponents.kovenant:kovenant-jvm:3.3.0" - implementation "nl.komponents.kovenant:kovenant:3.3.0" - implementation 'org.jetbrains.kotlin:kotlin-reflect:1.6.10' - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2" - implementation "org.jsoup:jsoup:1.14.3" - - // Tests - testImplementation "junit:junit:4.13.2" - testImplementation 'org.assertj:assertj-core:3.21.0' - testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" - testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.2" - testImplementation 'org.robolectric:robolectric:4.7.3' - - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' -} diff --git a/readium/shared/build.gradle.kts b/readium/shared/build.gradle.kts new file mode 100644 index 0000000000..9df8ce1415 --- /dev/null +++ b/readium/shared/build.gradle.kts @@ -0,0 +1,85 @@ +/* + * Copyright 2018 Readium Foundation. All rights reserved. + * Use of this source code is governed by the BSD-style license + * available in the top-level LICENSE file of the project. + */ + +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-parcelize") + id("maven-publish") + id("org.jetbrains.dokka") +} + +android { + compileSdk = 31 + defaultConfig { + minSdk = 21 + targetSdk = 31 + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" + allWarningsAsErrors = true + } + testOptions { + unitTests.isIncludeAndroidResources = true + } + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt")) + } + } +} + +//afterEvaluate { +// publishing { +// publications { +// release(MavenPublication) { +// from components.release +// +// groupId = "com.github.readium" +// artifactId = "readium-shared" +// +// artifact sourcesJar +// artifact javadocsJar +// } +// } +// } +//} + +dependencies { + implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) + + implementation("androidx.appcompat:appcompat:1.4.0") + implementation("androidx.browser:browser:1.4.0") + implementation("com.github.kittinunf.fuel:fuel-android:2.3.1") + implementation("com.github.kittinunf.fuel:fuel:2.3.1") + implementation("com.jakewharton.timber:timber:5.0.1") + implementation("joda-time:joda-time:2.10.13") + implementation("nl.komponents.kovenant:kovenant-android:3.3.0") + implementation("nl.komponents.kovenant:kovenant-combine:3.3.0") + implementation("nl.komponents.kovenant:kovenant-core:3.3.0") + implementation("nl.komponents.kovenant:kovenant-functional:3.3.0") + implementation("nl.komponents.kovenant:kovenant-jvm:3.3.0") + implementation("nl.komponents.kovenant:kovenant:3.3.0") + implementation("org.jetbrains.kotlin:kotlin-reflect:1.6.10") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2") + implementation("org.jsoup:jsoup:1.14.3") + + // Tests + testImplementation("junit:junit:4.13.2") + testImplementation("org.assertj:assertj-core:3.21.0") + testImplementation("org.jetbrains.kotlin:kotlin-test-junit:1.6.10") + testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.2") + testImplementation("org.robolectric:robolectric:4.7.3") + + androidTestImplementation("androidx.test.ext:junit:1.1.3") + androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0") +} diff --git a/readium/streamer/build.gradle b/readium/streamer/build.gradle deleted file mode 100644 index e14624c751..0000000000 --- a/readium/streamer/build.gradle +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2018 Readium Foundation. All rights reserved. - * Use of this source code is governed by the BSD-style license - * available in the top-level LICENSE file of the project. - */ - -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-parcelize' - id 'maven-publish' -} - -android { - compileSdkVersion 31 - defaultConfig { - minSdkVersion 21 - targetSdkVersion 31 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - compileOptions { - sourceCompatibility 1.8 - targetCompatibility 1.8 - } - testOptions { - unitTests.includeAndroidResources = true - } - kotlinOptions { - freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" - allWarningsAsErrors = true - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt') - } - } -} - -afterEvaluate { - publishing { - publications { - release(MavenPublication) { - from components.release - - groupId = 'com.github.readium' - artifactId = 'readium-streamer' - - artifact sourcesJar - artifact javadocsJar - } - } - } -} - -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - - api project(':readium:shared') - - implementation 'androidx.appcompat:appcompat:1.4.0' - implementation 'com.github.barteksc:pdfium-android:1.9.0' - implementation 'com.jakewharton.timber:timber:5.0.1' - //noinspection GradleDependency - implementation ("com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT") { - exclude group: 'org.parboiled' - } - //noinspection GradleDependency - implementation ("com.github.edrlab.nanohttpd:nanohttpd-nanolets:master-SNAPSHOT") { - exclude group: 'org.parboiled' - } - //AM NOTE: conflicting support libraries, excluding these - implementation("com.mcxiaoke.koi:core:0.5.5") { - exclude module: 'support-v4' - } - // useful extensions (only ~100k) - implementation("com.mcxiaoke.koi:async:0.5.5") { - exclude module: 'support-v4' - } - implementation "joda-time:joda-time:2.10.13" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2" - - // Tests - testImplementation 'junit:junit:4.13.2' - testImplementation 'org.assertj:assertj-core:3.21.0' - testImplementation 'org.robolectric:robolectric:4.7.3' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' -} diff --git a/readium/streamer/build.gradle.kts b/readium/streamer/build.gradle.kts new file mode 100644 index 0000000000..f36f2f5c28 --- /dev/null +++ b/readium/streamer/build.gradle.kts @@ -0,0 +1,90 @@ +/* + * Copyright 2018 Readium Foundation. All rights reserved. + * Use of this source code is governed by the BSD-style license + * available in the top-level LICENSE file of the project. + */ + +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-parcelize") + id("maven-publish") + id("org.jetbrains.dokka") +} + +android { + compileSdk = 31 + defaultConfig { + minSdk = 21 + targetSdk = 31 + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + testOptions { + unitTests.isIncludeAndroidResources = true + } + kotlinOptions { + freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" + allWarningsAsErrors = true + } + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt")) + } + } +} + +//afterEvaluate { +// publishing { +// publications { +// release(MavenPublication) { +// from components.release +// +// groupId = "com.github.readium" +// artifactId = "readium-streamer" +// +// artifact sourcesJar +// artifact javadocsJar +// } +// } +// } +//} + +dependencies { + implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) + + api(platform(project(":readium:shared"))) + + implementation("androidx.appcompat:appcompat:1.4.0") + implementation("com.github.barteksc:pdfium-android:1.9.0") + implementation("com.jakewharton.timber:timber:5.0.1") + //noinspection GradleDependency + implementation("com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT") { + exclude(group = "org.parboiled") + } + //noinspection GradleDependency + implementation("com.github.edrlab.nanohttpd:nanohttpd-nanolets:master-SNAPSHOT") { + exclude(group = "org.parboiled") + } + //AM NOTE: conflicting support libraries, excluding these + implementation("com.mcxiaoke.koi:core:0.5.5") { + exclude(module = "support-v4") + } + // useful extensions (only ~100k) + implementation("com.mcxiaoke.koi:async:0.5.5") { + exclude(module = "support-v4") + } + implementation("joda-time:joda-time:2.10.13") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2") + + // Tests + testImplementation("junit:junit:4.13.2") + testImplementation("org.assertj:assertj-core:3.21.0") + testImplementation("org.robolectric:robolectric:4.7.3") + androidTestImplementation("androidx.test.ext:junit:1.1.3") + androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0") +} diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 3fca9262a6..0000000000 --- a/settings.gradle +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2021 Readium Foundation. All rights reserved. - * Use of this source code is governed by the BSD-style license - * available in the top-level LICENSE file of the project. - */ - -rootProject.name = "Readium" - -include ':readium:shared' -include ':readium:streamer' -include ':readium:navigator' -include ':readium:opds' -include ':readium:lcp' - -if (!System.env.JITPACK) { - include 'test-app' -} diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000000..1f872ef198 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,23 @@ +/* + * Copyright 2021 Readium Foundation. All rights reserved. + * Use of this source code is governed by the BSD-style license + * available in the top-level LICENSE file of the project. + */ + +pluginManagement { + repositories { + gradlePluginPortal() + } +} + +rootProject.name = "Readium" + +include(":readium:shared") +include(":readium:streamer") +include(":readium:navigator") +include(":readium:opds") +include(":readium:lcp") + +if (System.getenv("JITPACK") == null) { + include("test-app") +} diff --git a/test-app/build.gradle b/test-app/build.gradle deleted file mode 100644 index 12cbe12b4d..0000000000 --- a/test-app/build.gradle +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright 2021 Readium Foundation. All rights reserved. - * Use of this source code is governed by the BSD-style license - * available in the top-level LICENSE file of the project. - */ - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-parcelize' - -int major = 2 -int minor = 2 -int patch = 1 -int build = 29 -String type = "" - -def version = "$major.$minor.$patch" -boolean appendBuild = build != 0 -if (appendBuild || !type.empty) { - version += "-$type" - if (appendBuild) { - version += build - } -} - -project.ext.versionName = version -project.ext.versionCode = 1_000_000 * major + 10_000 * minor + 100 * patch + build - - -android { - - compileSdkVersion 31 - defaultConfig { - minSdkVersion 21 - targetSdkVersion 31 - - applicationId "org.readium.r2reader" - - versionCode project.ext.versionCode - versionName project.ext.versionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" - } - buildFeatures { - viewBinding true - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt') - } - } - packagingOptions { - exclude 'META-INF/*' - } - - sourceSets { - main { - java.srcDirs = ['src/main/java'] - res.srcDirs = ['src/main/res'] - assets.srcDirs = ['src/main/assets'] - } - } -} - -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - implementation 'androidx.legacy:legacy-support-v4:1.0.0' - - implementation project(':readium:shared') - implementation project(':readium:streamer') - implementation project(':readium:navigator') - implementation project(':readium:opds') - implementation project(':readium:lcp') - - implementation 'androidx.core:core-ktx:1.7.0' - implementation "androidx.activity:activity-ktx:1.4.0" - implementation "androidx.appcompat:appcompat:1.4.0" - implementation "androidx.browser:browser:1.4.0" - implementation "androidx.cardview:cardview:1.0.0" - implementation "androidx.constraintlayout:constraintlayout:2.1.2" - implementation "androidx.fragment:fragment-ktx:1.4.0" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.0" - implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.0" - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0" - implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5' - implementation 'androidx.navigation:navigation-ui-ktx:2.3.5' - implementation "androidx.paging:paging-runtime-ktx:3.1.0" - implementation "androidx.recyclerview:recyclerview:1.2.1" - implementation "androidx.viewpager2:viewpager2:1.0.0" - implementation "androidx.webkit:webkit:1.4.0" - //noinspection GradleDependency - implementation ("com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT") { - exclude group: 'org.parboiled' - } - //noinspection GradleDependency - implementation ("com.github.edrlab.nanohttpd:nanohttpd-nanolets:master-SNAPSHOT") { - exclude group: 'org.parboiled' - } - implementation "com.google.android.material:material:1.4.0" - implementation 'com.jakewharton.timber:timber:5.0.1' - // AM NOTE: needs to stay this version for now (June 24,2020) - //noinspection GradleDependency - implementation 'com.squareup.picasso:picasso:2.71828' - implementation "joda-time:joda-time:2.10.13" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2" - // AM NOTE: needs to stay this version for now (June 24,2020) - //noinspection GradleDependency - implementation 'org.jsoup:jsoup:1.14.3' - - // Room database - final room_version = '2.4.0' - implementation "androidx.room:room-runtime:$room_version" - implementation "androidx.room:room-ktx:$room_version" - kapt "androidx.room:room-compiler:$room_version" - - implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' - //noinspection LifecycleAnnotationProcessorWithJava8 - kapt "androidx.lifecycle:lifecycle-compiler:2.4.0" - - // Tests - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' -} diff --git a/test-app/build.gradle.kts b/test-app/build.gradle.kts new file mode 100644 index 0000000000..4f22b83c82 --- /dev/null +++ b/test-app/build.gradle.kts @@ -0,0 +1,139 @@ +/* + * Copyright 2021 Readium Foundation. All rights reserved. + * Use of this source code is governed by the BSD-style license + * available in the top-level LICENSE file of the project. + */ + +plugins { + id("com.android.application") + id("kotlin-android") + id("kotlin-parcelize") + id("kotlin-kapt") +} + +val major: Int = 2 +val minor: Int= 2 +val patch: Int = 1 +val build: Int = 29 +val type: String = "" + +var version: String = "$major.$minor.$patch" +val appendBuild = build != 0 +if (appendBuild || type.isNotEmpty()) { + version += "-$type" + if (appendBuild) { + version += build + } +} + +project.ext.set("versionName", version) +project.ext.set("versionCode", 1_000_000 * major + 10_000 * minor + 100 * patch + build) + +android { + + compileSdk = 31 + defaultConfig { + minSdk = 21 + targetSdk = 31 + + applicationId = "org.readium.r2reader" + + versionCode = project.ext.get("versionCode") as Int + versionName = project.ext.get("versionName") as String + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + ndk.abiFilters.add("armeabi-v7a") + ndk.abiFilters.add("arm64-v8a") + ndk.abiFilters.add("x86") + ndk.abiFilters.add("x86_64") + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" + } + buildFeatures { + viewBinding = true + } + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt")) + } + } + packagingOptions { + resources.excludes.add("META-INF/*") + } + + sourceSets { + getByName("main") { + java.srcDirs("src/main/java") + res.srcDirs("src/main/res") + assets.srcDirs("src/main/assets") + } + } +} + +dependencies { + implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10") + implementation("androidx.legacy:legacy-support-v4:1.0.0") + + implementation(project(":readium:shared")) + implementation(project(":readium:streamer")) + implementation(project(":readium:navigator")) + implementation(project(":readium:opds")) + implementation(project(":readium:lcp")) + + implementation("androidx.core:core-ktx:1.7.0") + implementation("androidx.activity:activity-ktx:1.4.0") + implementation("androidx.appcompat:appcompat:1.4.0") + implementation("androidx.browser:browser:1.4.0") + implementation("androidx.cardview:cardview:1.0.0") + implementation("androidx.constraintlayout:constraintlayout:2.1.2") + implementation("androidx.fragment:fragment-ktx:1.4.0") + implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.4.0") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.0") + implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0") + implementation("androidx.navigation:navigation-fragment-ktx:2.3.5") + implementation("androidx.navigation:navigation-ui-ktx:2.3.5") + implementation("androidx.paging:paging-runtime-ktx:3.1.0") + implementation("androidx.recyclerview:recyclerview:1.2.1") + implementation("androidx.viewpager2:viewpager2:1.0.0") + implementation("androidx.webkit:webkit:1.4.0") + //noinspection GradleDependency + implementation("com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT") { + exclude(group = "org.parboiled") + } + //noinspection GradleDependency + implementation("com.github.edrlab.nanohttpd:nanohttpd-nanolets:master-SNAPSHOT") { + exclude(group = "org.parboiled") + } + implementation("com.google.android.material:material:1.4.0") + implementation("com.jakewharton.timber:timber:5.0.1") + // AM NOTE: needs to stay this version for now (June 24,2020) + //noinspection GradleDependency + implementation("com.squareup.picasso:picasso:2.71828") + implementation("joda-time:joda-time:2.10.13") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2") + // AM NOTE: needs to stay this version for now (June 24,2020) + //noinspection GradleDependency + implementation("org.jsoup:jsoup:1.14.3") + + // Room database + val room_version = "2.4.0" + implementation("androidx.room:room-runtime:$room_version") + implementation("androidx.room:room-ktx:$room_version") + kapt ("androidx.room:room-compiler:$room_version") + + implementation("androidx.lifecycle:lifecycle-extensions:2.2.0") + //noinspection LifecycleAnnotationProcessorWithJava8 + kapt ("androidx.lifecycle:lifecycle-compiler:2.4.0") + + // Tests + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.3") + androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0") +} From 06e726b466710ac18a8053cd1c90de1b287b3a1c Mon Sep 17 00:00:00 2001 From: Steven Zeck <8315038+stevenzeck@users.noreply.github.com> Date: Mon, 20 Dec 2021 00:47:57 -0600 Subject: [PATCH 02/12] Fix dependency on Readium shared --- readium/lcp/build.gradle.kts | 2 +- readium/navigator/build.gradle.kts | 2 +- readium/opds/build.gradle.kts | 2 +- readium/streamer/build.gradle.kts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/readium/lcp/build.gradle.kts b/readium/lcp/build.gradle.kts index 3cde7d1616..6116537a01 100644 --- a/readium/lcp/build.gradle.kts +++ b/readium/lcp/build.gradle.kts @@ -60,7 +60,7 @@ dependencies { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2") - api(platform(project(":readium:shared"))) + api(project(":readium:shared")) implementation("androidx.constraintlayout:constraintlayout:2.1.2") implementation("androidx.core:core-ktx:1.7.0") diff --git a/readium/navigator/build.gradle.kts b/readium/navigator/build.gradle.kts index c027097207..d9016ca7c6 100644 --- a/readium/navigator/build.gradle.kts +++ b/readium/navigator/build.gradle.kts @@ -61,7 +61,7 @@ android { dependencies { implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) - api(platform(project(":readium:shared"))) + api(project(":readium:shared")) implementation("androidx.activity:activity-ktx:1.4.0") implementation("androidx.appcompat:appcompat:1.4.0") diff --git a/readium/opds/build.gradle.kts b/readium/opds/build.gradle.kts index 736fcc9bae..7c01b70c95 100644 --- a/readium/opds/build.gradle.kts +++ b/readium/opds/build.gradle.kts @@ -52,7 +52,7 @@ android { dependencies { implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) - api(platform(project(":readium:shared"))) + api(project(":readium:shared")) implementation("androidx.appcompat:appcompat:1.4.0") implementation("com.jakewharton.timber:timber:5.0.1") diff --git a/readium/streamer/build.gradle.kts b/readium/streamer/build.gradle.kts index f36f2f5c28..02c67884f9 100644 --- a/readium/streamer/build.gradle.kts +++ b/readium/streamer/build.gradle.kts @@ -57,7 +57,7 @@ android { dependencies { implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) - api(platform(project(":readium:shared"))) + api(project(":readium:shared")) implementation("androidx.appcompat:appcompat:1.4.0") implementation("com.github.barteksc:pdfium-android:1.9.0") From aa388c41d04b3192c8bef3f245e2d571f396b7b3 Mon Sep 17 00:00:00 2001 From: Steven Zeck <8315038+stevenzeck@users.noreply.github.com> Date: Mon, 20 Dec 2021 01:07:46 -0600 Subject: [PATCH 03/12] Fix Dokka tasks --- build.gradle.kts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index af495495d4..8694aa96d2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,6 @@ import org.jetbrains.dokka.gradle.DokkaTaskPartial buildscript { - extra.set("kotlin_version", "1.6.10") val kotlin_version = "1.6.10" val dokka_version = "1.6.0" @@ -26,10 +25,7 @@ buildscript { } } -//plugins { -// id("org.jetbrains.dokka") version ("1.5.30") -//} -apply(plugin="org.jetbrains.dokka") +apply(plugin = "org.jetbrains.dokka") allprojects { repositories { @@ -62,7 +58,6 @@ tasks.register("cleanDocs", Delete::class).configure { } tasks.withType().configureEach { - outputDirectory.set(file("${project.rootDir}/docs")) dokkaSourceSets { configureEach { reportUndocumented.set(false) @@ -71,7 +66,7 @@ tasks.withType().configureEach { } } } -// -//tasks.named("dokkaGfmMultimodule").configure { -// outputDirectory.set(file("${project.rootDir}/docs")) -//} + +tasks.named("dokkaGfmMultiModule").configure { + outputDirectory.set(file("${projectDir.path}/docs")) +} From a34a13d8ecb694eec6ce02a9896ed3b97f0de16b Mon Sep 17 00:00:00 2001 From: Steven Zeck <8315038+stevenzeck@users.noreply.github.com> Date: Mon, 20 Dec 2021 12:56:27 -0600 Subject: [PATCH 04/12] First go around using version catalog --- build.gradle.kts | 5 ++--- settings.gradle.kts | 23 +++++++++++++++++++++++ test-app/build.gradle.kts | 10 +++++----- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8694aa96d2..a27d53b731 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,6 @@ import org.jetbrains.dokka.gradle.DokkaTaskPartial buildscript { - val kotlin_version = "1.6.10" val dokka_version = "1.6.0" repositories { @@ -20,8 +19,8 @@ buildscript { } dependencies { classpath("com.android.tools.build:gradle:7.0.4") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") - classpath("org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version") + classpath(libs.kotlin.gradle) + classpath(libs.dokka.gradle) } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 1f872ef198..5da56811d3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,6 +4,8 @@ * available in the top-level LICENSE file of the project. */ +enableFeaturePreview("VERSION_CATALOGS") + pluginManagement { repositories { gradlePluginPortal() @@ -21,3 +23,24 @@ include(":readium:lcp") if (System.getenv("JITPACK") == null) { include("test-app") } + +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + // Kotlin + version("kotlin", "1.6.10") + alias("kotlin-gradle").to("org.jetbrains.kotlin", "kotlin-gradle-plugin").versionRef("kotlin") + + // Dokka + version("dokka", "1.5.30") + alias("dokka-gradle").to("org.jetbrains.dokka", "dokka-gradle-plugin").versionRef("dokka") + + // Room database + version("room", "2.4.0") + alias("room-runtime").to("androidx.room", "room-runtime").versionRef("room") + alias("room-ktx").to("androidx.room", "room-ktx").versionRef("room") + alias("room-compiler").to("androidx.room", "room-compiler").versionRef("room") + bundle("room", listOf("room-runtime", "room-compiler")) + } + } +} diff --git a/test-app/build.gradle.kts b/test-app/build.gradle.kts index 4f22b83c82..1b914b7a61 100644 --- a/test-app/build.gradle.kts +++ b/test-app/build.gradle.kts @@ -1,3 +1,5 @@ +import android.annotation.SuppressLint + /* * Copyright 2021 Readium Foundation. All rights reserved. * Use of this source code is governed by the BSD-style license @@ -123,13 +125,11 @@ dependencies { implementation("org.jsoup:jsoup:1.14.3") // Room database - val room_version = "2.4.0" - implementation("androidx.room:room-runtime:$room_version") - implementation("androidx.room:room-ktx:$room_version") - kapt ("androidx.room:room-compiler:$room_version") + implementation(libs.bundles.room) + kapt(libs.room.ktx) implementation("androidx.lifecycle:lifecycle-extensions:2.2.0") - //noinspection LifecycleAnnotationProcessorWithJava8 + @Suppress("LifecycleAnnotationProcessorWithJava8") kapt ("androidx.lifecycle:lifecycle-compiler:2.4.0") // Tests From d9c7a8f19ade00a7550162debf7a7657ed29e06d Mon Sep 17 00:00:00 2001 From: Steven Zeck <8315038+stevenzeck@users.noreply.github.com> Date: Mon, 20 Dec 2021 13:15:33 -0600 Subject: [PATCH 05/12] Use toml file instead of settings gradle file --- gradle/libs.versions.toml | 16 ++++++++++++++++ readium/lcp/build.gradle.kts | 7 +++---- settings.gradle.kts | 21 --------------------- 3 files changed, 19 insertions(+), 25 deletions(-) create mode 100644 gradle/libs.versions.toml diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000000..cb8e6fb10a --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,16 @@ +[versions] +kotlin = "1.6.10" +dokka = "1.5.30" +room = "2.4.0" + +[libraries] +kotlin-gradle = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" } +dokka-gradle = { group = "org.jetbrains.dokka", name = "dokka-gradle-plugin", version.ref = "dokka" } +room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" } +room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" } +room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" } + +[bundles] +room = ["room-runtime", "room-compiler"] + +[plugins] \ No newline at end of file diff --git a/readium/lcp/build.gradle.kts b/readium/lcp/build.gradle.kts index 6116537a01..d35d4ff811 100644 --- a/readium/lcp/build.gradle.kts +++ b/readium/lcp/build.gradle.kts @@ -76,10 +76,9 @@ dependencies { implementation("org.zeroturnaround:zt-zip:1.14") implementation("androidx.browser:browser:1.4.0") - val room_version = "2.4.0" - implementation("androidx.room:room-runtime:$room_version") - implementation("androidx.room:room-ktx:$room_version") - kapt("androidx.room:room-compiler:$room_version") + // Room database + implementation(libs.bundles.room) + kapt(libs.room.ktx) // Tests testImplementation("junit:junit:4.13.2") diff --git a/settings.gradle.kts b/settings.gradle.kts index 5da56811d3..306acf24d6 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -23,24 +23,3 @@ include(":readium:lcp") if (System.getenv("JITPACK") == null) { include("test-app") } - -dependencyResolutionManagement { - versionCatalogs { - create("libs") { - // Kotlin - version("kotlin", "1.6.10") - alias("kotlin-gradle").to("org.jetbrains.kotlin", "kotlin-gradle-plugin").versionRef("kotlin") - - // Dokka - version("dokka", "1.5.30") - alias("dokka-gradle").to("org.jetbrains.dokka", "dokka-gradle-plugin").versionRef("dokka") - - // Room database - version("room", "2.4.0") - alias("room-runtime").to("androidx.room", "room-runtime").versionRef("room") - alias("room-ktx").to("androidx.room", "room-ktx").versionRef("room") - alias("room-compiler").to("androidx.room", "room-compiler").versionRef("room") - bundle("room", listOf("room-runtime", "room-compiler")) - } - } -} From 0f019cb035e505518c581998d104449b626ad76d Mon Sep 17 00:00:00 2001 From: Steven Zeck <8315038+stevenzeck@users.noreply.github.com> Date: Mon, 20 Dec 2021 13:35:37 -0600 Subject: [PATCH 06/12] Revert using version catalog for now --- build.gradle.kts | 7 ++++--- gradle/{libs.versions.toml => libs.versions.toml2} | 2 ++ readium/lcp/build.gradle.kts | 6 ++++-- settings.gradle.kts | 2 +- test-app/build.gradle.kts | 6 ++++-- 5 files changed, 15 insertions(+), 8 deletions(-) rename gradle/{libs.versions.toml => libs.versions.toml2} (88%) diff --git a/build.gradle.kts b/build.gradle.kts index a27d53b731..34a012ef33 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,8 @@ import org.jetbrains.dokka.gradle.DokkaTaskPartial buildscript { - val dokka_version = "1.6.0" + val kotlin_version = "1.6.10" + val dokka_version = "1.5.30" repositories { google() @@ -19,8 +20,8 @@ buildscript { } dependencies { classpath("com.android.tools.build:gradle:7.0.4") - classpath(libs.kotlin.gradle) - classpath(libs.dokka.gradle) + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") + classpath("org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version") } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml2 similarity index 88% rename from gradle/libs.versions.toml rename to gradle/libs.versions.toml2 index cb8e6fb10a..33eb55280e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml2 @@ -1,3 +1,5 @@ +# Eventually want to use this for dependencies, but Android Studio is not ready + [versions] kotlin = "1.6.10" dokka = "1.5.30" diff --git a/readium/lcp/build.gradle.kts b/readium/lcp/build.gradle.kts index d35d4ff811..e8a065c70a 100644 --- a/readium/lcp/build.gradle.kts +++ b/readium/lcp/build.gradle.kts @@ -77,8 +77,10 @@ dependencies { implementation("androidx.browser:browser:1.4.0") // Room database - implementation(libs.bundles.room) - kapt(libs.room.ktx) + val room_version = "2.4.0" + implementation("androidx.room:room-runtime:$room_version") + implementation("androidx.room:room-ktx:$room_version") + kapt("androidx.room:room-compiler:$room_version") // Tests testImplementation("junit:junit:4.13.2") diff --git a/settings.gradle.kts b/settings.gradle.kts index 306acf24d6..f9286c7481 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,7 +4,7 @@ * available in the top-level LICENSE file of the project. */ -enableFeaturePreview("VERSION_CATALOGS") +//enableFeaturePreview("VERSION_CATALOGS") pluginManagement { repositories { diff --git a/test-app/build.gradle.kts b/test-app/build.gradle.kts index 1b914b7a61..5e0a7664c5 100644 --- a/test-app/build.gradle.kts +++ b/test-app/build.gradle.kts @@ -125,8 +125,10 @@ dependencies { implementation("org.jsoup:jsoup:1.14.3") // Room database - implementation(libs.bundles.room) - kapt(libs.room.ktx) + val room_version = "2.4.0" + implementation("androidx.room:room-runtime:$room_version") + implementation("androidx.room:room-ktx:$room_version") + kapt("androidx.room:room-compiler:$room_version") implementation("androidx.lifecycle:lifecycle-extensions:2.2.0") @Suppress("LifecycleAnnotationProcessorWithJava8") From a202b91e5b3a8ca2a51487ab2bdff1ed51ac2bd1 Mon Sep 17 00:00:00 2001 From: Steven Zeck <8315038+stevenzeck@users.noreply.github.com> Date: Mon, 20 Dec 2021 14:01:56 -0600 Subject: [PATCH 07/12] Attempt to add afterEvaluate back --- build.gradle.kts | 4 ++-- readium/lcp/build.gradle.kts | 29 +++++++++++++---------------- readium/navigator/build.gradle.kts | 28 +++++++++++++--------------- readium/opds/build.gradle.kts | 27 +++++++++++++-------------- readium/shared/build.gradle.kts | 28 +++++++++++++--------------- readium/streamer/build.gradle.kts | 28 +++++++++++++--------------- 6 files changed, 67 insertions(+), 77 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 34a012ef33..c52920fdcc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,8 +7,8 @@ import org.jetbrains.dokka.gradle.DokkaTaskPartial buildscript { - val kotlin_version = "1.6.10" - val dokka_version = "1.5.30" + val kotlin_version by extra("1.6.10") + val dokka_version by extra("1.5.30") repositories { google() diff --git a/readium/lcp/build.gradle.kts b/readium/lcp/build.gradle.kts index e8a065c70a..81669bda00 100644 --- a/readium/lcp/build.gradle.kts +++ b/readium/lcp/build.gradle.kts @@ -38,22 +38,19 @@ android { } } -//afterEvaluate { -// publishing { -// publications { -// -// release(MavenPublication) { -// from components.release -// -// groupId = "com.github.readium" -// artifactId = "readium-lcp" -// -// artifact sourcesJar -// artifact javadocsJar -// } -// } -// } -//} +afterEvaluate { + publishing { + publications { + create("release") { + from(components.getByName("release")) + groupId = "com.github.readium" + artifactId = "readium-lcp" + artifact("sourcesJar") + artifact("javadocsJar") + } + } + } +} dependencies { implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) diff --git a/readium/navigator/build.gradle.kts b/readium/navigator/build.gradle.kts index d9016ca7c6..400993d3f0 100644 --- a/readium/navigator/build.gradle.kts +++ b/readium/navigator/build.gradle.kts @@ -42,21 +42,19 @@ android { } } -//afterEvaluate { -// publishing { -// publications { -// release(MavenPublication) { -// from components.release -// -// groupId = "com.github.readium" -// artifactId = "readium-navigator" -// -// artifact sourcesJar -// artifact javadocsJar -// } -// } -// } -//} +afterEvaluate { + publishing { + publications { + create("release") { + from(components.getByName("release")) + groupId = "com.github.readium" + artifactId = "readium-navigator" + artifact("sourcesJar") + artifact("javadocsJar") + } + } + } +} dependencies { implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) diff --git a/readium/opds/build.gradle.kts b/readium/opds/build.gradle.kts index 7c01b70c95..51bcd22bb0 100644 --- a/readium/opds/build.gradle.kts +++ b/readium/opds/build.gradle.kts @@ -34,20 +34,19 @@ android { } } -//afterEvaluate { -// publishing { -// publications { -// release(MavenPublication) { -// from components.release -// groupId = "com.github.readium" -// artifactId = "readium-opds" -// -// artifact sourcesJar -// artifact javadocsJar -// } -// } -// } -//} +afterEvaluate { + publishing { + publications { + create("release") { + from(components.getByName("release")) + groupId = "com.github.readium" + artifactId = "readium-opds" + artifact("sourcesJar") + artifact("javadocsJar") + } + } + } +} dependencies { implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) diff --git a/readium/shared/build.gradle.kts b/readium/shared/build.gradle.kts index 9df8ce1415..f6a0b4e117 100644 --- a/readium/shared/build.gradle.kts +++ b/readium/shared/build.gradle.kts @@ -38,21 +38,19 @@ android { } } -//afterEvaluate { -// publishing { -// publications { -// release(MavenPublication) { -// from components.release -// -// groupId = "com.github.readium" -// artifactId = "readium-shared" -// -// artifact sourcesJar -// artifact javadocsJar -// } -// } -// } -//} +afterEvaluate { + publishing { + publications { + create("release") { + from(components.getByName("release")) + groupId = "com.github.readium" + artifactId = "readium-shared" + artifact("sourcesJar") + artifact("javadocsJar") + } + } + } +} dependencies { implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) diff --git a/readium/streamer/build.gradle.kts b/readium/streamer/build.gradle.kts index 02c67884f9..c492700030 100644 --- a/readium/streamer/build.gradle.kts +++ b/readium/streamer/build.gradle.kts @@ -38,21 +38,19 @@ android { } } -//afterEvaluate { -// publishing { -// publications { -// release(MavenPublication) { -// from components.release -// -// groupId = "com.github.readium" -// artifactId = "readium-streamer" -// -// artifact sourcesJar -// artifact javadocsJar -// } -// } -// } -//} +afterEvaluate { + publishing { + publications { + create("release") { + from(components.getByName("release")) + groupId = "com.github.readium" + artifactId = "readium-streamer" + artifact("sourcesJar") + artifact("javadocsJar") + } + } + } +} dependencies { implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) From 1fc575d9bda9a1af95cb3c85faf1c77b5390ea00 Mon Sep 17 00:00:00 2001 From: Steven Zeck <8315038+stevenzeck@users.noreply.github.com> Date: Mon, 20 Dec 2021 14:10:52 -0600 Subject: [PATCH 08/12] Resolve warnings --- build.gradle.kts | 8 ++++---- readium/lcp/build.gradle.kts | 10 +++++----- readium/navigator/build.gradle.kts | 2 +- readium/shared/build.gradle.kts | 2 +- readium/streamer/build.gradle.kts | 2 +- test-app/build.gradle.kts | 12 +++++------- 6 files changed, 17 insertions(+), 19 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index c52920fdcc..02eec38335 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,8 +7,8 @@ import org.jetbrains.dokka.gradle.DokkaTaskPartial buildscript { - val kotlin_version by extra("1.6.10") - val dokka_version by extra("1.5.30") + val kotlinVersion by extra("1.6.10") + val dokkaVersion by extra("1.5.30") repositories { google() @@ -20,8 +20,8 @@ buildscript { } dependencies { classpath("com.android.tools.build:gradle:7.0.4") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") - classpath("org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") + classpath("org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion") } } diff --git a/readium/lcp/build.gradle.kts b/readium/lcp/build.gradle.kts index 81669bda00..d73a5563b7 100644 --- a/readium/lcp/build.gradle.kts +++ b/readium/lcp/build.gradle.kts @@ -27,7 +27,7 @@ android { } kotlinOptions { jvmTarget = "1.8" - freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" + freeCompilerArgs = freeCompilerArgs + "-Xopt-in=kotlin.RequiresOptIn" allWarningsAsErrors = true } buildTypes { @@ -74,10 +74,10 @@ dependencies { implementation("androidx.browser:browser:1.4.0") // Room database - val room_version = "2.4.0" - implementation("androidx.room:room-runtime:$room_version") - implementation("androidx.room:room-ktx:$room_version") - kapt("androidx.room:room-compiler:$room_version") + val roomVersion = "2.4.0" + implementation("androidx.room:room-runtime:$roomVersion") + implementation("androidx.room:room-ktx:$roomVersion") + kapt("androidx.room:room-compiler:$roomVersion") // Tests testImplementation("junit:junit:4.13.2") diff --git a/readium/navigator/build.gradle.kts b/readium/navigator/build.gradle.kts index 400993d3f0..9e43b53b4f 100644 --- a/readium/navigator/build.gradle.kts +++ b/readium/navigator/build.gradle.kts @@ -29,7 +29,7 @@ android { } kotlinOptions { jvmTarget = "1.8" - freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" + freeCompilerArgs = freeCompilerArgs + "-Xopt-in=kotlin.RequiresOptIn" } buildTypes { getByName("release") { diff --git a/readium/shared/build.gradle.kts b/readium/shared/build.gradle.kts index f6a0b4e117..062b9ee692 100644 --- a/readium/shared/build.gradle.kts +++ b/readium/shared/build.gradle.kts @@ -24,7 +24,7 @@ android { targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { - freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" + freeCompilerArgs = freeCompilerArgs + "-Xopt-in=kotlin.RequiresOptIn" allWarningsAsErrors = true } testOptions { diff --git a/readium/streamer/build.gradle.kts b/readium/streamer/build.gradle.kts index c492700030..8ed0a9035e 100644 --- a/readium/streamer/build.gradle.kts +++ b/readium/streamer/build.gradle.kts @@ -27,7 +27,7 @@ android { unitTests.isIncludeAndroidResources = true } kotlinOptions { - freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" + freeCompilerArgs = freeCompilerArgs + "-Xopt-in=kotlin.RequiresOptIn" allWarningsAsErrors = true } buildTypes { diff --git a/test-app/build.gradle.kts b/test-app/build.gradle.kts index 5e0a7664c5..a28c9a2eda 100644 --- a/test-app/build.gradle.kts +++ b/test-app/build.gradle.kts @@ -1,5 +1,3 @@ -import android.annotation.SuppressLint - /* * Copyright 2021 Readium Foundation. All rights reserved. * Use of this source code is governed by the BSD-style license @@ -54,7 +52,7 @@ android { } kotlinOptions { jvmTarget = "1.8" - freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" + freeCompilerArgs = freeCompilerArgs + "-Xopt-in=kotlin.RequiresOptIn" } buildFeatures { viewBinding = true @@ -125,10 +123,10 @@ dependencies { implementation("org.jsoup:jsoup:1.14.3") // Room database - val room_version = "2.4.0" - implementation("androidx.room:room-runtime:$room_version") - implementation("androidx.room:room-ktx:$room_version") - kapt("androidx.room:room-compiler:$room_version") + val roomVersion = "2.4.0" + implementation("androidx.room:room-runtime:$roomVersion") + implementation("androidx.room:room-ktx:$roomVersion") + kapt("androidx.room:room-compiler:$roomVersion") implementation("androidx.lifecycle:lifecycle-extensions:2.2.0") @Suppress("LifecycleAnnotationProcessorWithJava8") From 637b00e5efc590bf1106a18765ccb2068d9d6e35 Mon Sep 17 00:00:00 2001 From: Steven Zeck <8315038+stevenzeck@users.noreply.github.com> Date: Mon, 20 Dec 2021 14:16:32 -0600 Subject: [PATCH 09/12] Revert pdfium version to 1.8.2 --- readium/streamer/build.gradle.kts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/readium/streamer/build.gradle.kts b/readium/streamer/build.gradle.kts index 8ed0a9035e..ca924ec657 100644 --- a/readium/streamer/build.gradle.kts +++ b/readium/streamer/build.gradle.kts @@ -1,3 +1,5 @@ +import android.annotation.SuppressLint + /* * Copyright 2018 Readium Foundation. All rights reserved. * Use of this source code is governed by the BSD-style license @@ -58,7 +60,8 @@ dependencies { api(project(":readium:shared")) implementation("androidx.appcompat:appcompat:1.4.0") - implementation("com.github.barteksc:pdfium-android:1.9.0") + @Suppress("GradleDependency") + implementation("com.github.barteksc:pdfium-android:1.8.2") implementation("com.jakewharton.timber:timber:5.0.1") //noinspection GradleDependency implementation("com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT") { From 571f241807a9e504d5c7daac47ca996c6145d30f Mon Sep 17 00:00:00 2001 From: Steven Zeck <8315038+stevenzeck@users.noreply.github.com> Date: Mon, 20 Dec 2021 15:15:05 -0600 Subject: [PATCH 10/12] Fix MavenPublication --- readium/lcp/build.gradle.kts | 4 ++-- readium/navigator/build.gradle.kts | 4 ++-- readium/opds/build.gradle.kts | 4 ++-- readium/shared/build.gradle.kts | 4 ++-- readium/streamer/build.gradle.kts | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/readium/lcp/build.gradle.kts b/readium/lcp/build.gradle.kts index d73a5563b7..e0183d2115 100644 --- a/readium/lcp/build.gradle.kts +++ b/readium/lcp/build.gradle.kts @@ -45,8 +45,8 @@ afterEvaluate { from(components.getByName("release")) groupId = "com.github.readium" artifactId = "readium-lcp" - artifact("sourcesJar") - artifact("javadocsJar") + artifact(tasks.findByName("sourcesJar")) + artifact(tasks.findByName("javadocsJar")) } } } diff --git a/readium/navigator/build.gradle.kts b/readium/navigator/build.gradle.kts index 9e43b53b4f..d6f423a008 100644 --- a/readium/navigator/build.gradle.kts +++ b/readium/navigator/build.gradle.kts @@ -49,8 +49,8 @@ afterEvaluate { from(components.getByName("release")) groupId = "com.github.readium" artifactId = "readium-navigator" - artifact("sourcesJar") - artifact("javadocsJar") + artifact(tasks.findByName("sourcesJar")) + artifact(tasks.findByName("javadocsJar")) } } } diff --git a/readium/opds/build.gradle.kts b/readium/opds/build.gradle.kts index 51bcd22bb0..3e2a368271 100644 --- a/readium/opds/build.gradle.kts +++ b/readium/opds/build.gradle.kts @@ -41,8 +41,8 @@ afterEvaluate { from(components.getByName("release")) groupId = "com.github.readium" artifactId = "readium-opds" - artifact("sourcesJar") - artifact("javadocsJar") + artifact(tasks.findByName("sourcesJar")) + artifact(tasks.findByName("javadocsJar")) } } } diff --git a/readium/shared/build.gradle.kts b/readium/shared/build.gradle.kts index 062b9ee692..215097bd9c 100644 --- a/readium/shared/build.gradle.kts +++ b/readium/shared/build.gradle.kts @@ -45,8 +45,8 @@ afterEvaluate { from(components.getByName("release")) groupId = "com.github.readium" artifactId = "readium-shared" - artifact("sourcesJar") - artifact("javadocsJar") + artifact(tasks.findByName("sourcesJar")) + artifact(tasks.findByName("javadocsJar")) } } } diff --git a/readium/streamer/build.gradle.kts b/readium/streamer/build.gradle.kts index ca924ec657..34effa75ba 100644 --- a/readium/streamer/build.gradle.kts +++ b/readium/streamer/build.gradle.kts @@ -47,8 +47,8 @@ afterEvaluate { from(components.getByName("release")) groupId = "com.github.readium" artifactId = "readium-streamer" - artifact("sourcesJar") - artifact("javadocsJar") + artifact(tasks.findByName("sourcesJar")) + artifact(tasks.findByName("javadocsJar")) } } } From e2a220bfa0b065d1de990826738b540a045a4be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Fri, 24 Dec 2021 15:26:13 +0100 Subject: [PATCH 11/12] Fix typo and remove the noinspection comments --- readium/navigator/build.gradle.kts | 2 +- readium/streamer/build.gradle.kts | 2 -- settings.gradle.kts | 1 + test-app/build.gradle.kts | 7 +------ 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/readium/navigator/build.gradle.kts b/readium/navigator/build.gradle.kts index d6f423a008..ac14eebf51 100644 --- a/readium/navigator/build.gradle.kts +++ b/readium/navigator/build.gradle.kts @@ -13,7 +13,7 @@ plugins { } android { - // FIXME: This doesn"t pass the lint because some resources don"t start with r2_ yet. We need to rename all resources for the next major version. + // FIXME: This doesn't pass the lint because some resources don"t start with r2_ yet. We need to rename all resources for the next major version. // resourcePrefix "r2_" compileSdk = 31 diff --git a/readium/streamer/build.gradle.kts b/readium/streamer/build.gradle.kts index 34effa75ba..8af74a4f8c 100644 --- a/readium/streamer/build.gradle.kts +++ b/readium/streamer/build.gradle.kts @@ -63,11 +63,9 @@ dependencies { @Suppress("GradleDependency") implementation("com.github.barteksc:pdfium-android:1.8.2") implementation("com.jakewharton.timber:timber:5.0.1") - //noinspection GradleDependency implementation("com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT") { exclude(group = "org.parboiled") } - //noinspection GradleDependency implementation("com.github.edrlab.nanohttpd:nanohttpd-nanolets:master-SNAPSHOT") { exclude(group = "org.parboiled") } diff --git a/settings.gradle.kts b/settings.gradle.kts index f9286c7481..a8f80312f1 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,6 +4,7 @@ * available in the top-level LICENSE file of the project. */ +// FIXME: Android Studio doesn't support the gradle/libs.versions.toml2 well yet. //enableFeaturePreview("VERSION_CATALOGS") pluginManagement { diff --git a/test-app/build.gradle.kts b/test-app/build.gradle.kts index a28c9a2eda..b9af1cbfad 100644 --- a/test-app/build.gradle.kts +++ b/test-app/build.gradle.kts @@ -7,8 +7,8 @@ plugins { id("com.android.application") id("kotlin-android") - id("kotlin-parcelize") id("kotlin-kapt") + id("kotlin-parcelize") } val major: Int = 2 @@ -103,23 +103,19 @@ dependencies { implementation("androidx.recyclerview:recyclerview:1.2.1") implementation("androidx.viewpager2:viewpager2:1.0.0") implementation("androidx.webkit:webkit:1.4.0") - //noinspection GradleDependency implementation("com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT") { exclude(group = "org.parboiled") } - //noinspection GradleDependency implementation("com.github.edrlab.nanohttpd:nanohttpd-nanolets:master-SNAPSHOT") { exclude(group = "org.parboiled") } implementation("com.google.android.material:material:1.4.0") implementation("com.jakewharton.timber:timber:5.0.1") // AM NOTE: needs to stay this version for now (June 24,2020) - //noinspection GradleDependency implementation("com.squareup.picasso:picasso:2.71828") implementation("joda-time:joda-time:2.10.13") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2") // AM NOTE: needs to stay this version for now (June 24,2020) - //noinspection GradleDependency implementation("org.jsoup:jsoup:1.14.3") // Room database @@ -129,7 +125,6 @@ dependencies { kapt("androidx.room:room-compiler:$roomVersion") implementation("androidx.lifecycle:lifecycle-extensions:2.2.0") - @Suppress("LifecycleAnnotationProcessorWithJava8") kapt ("androidx.lifecycle:lifecycle-compiler:2.4.0") // Tests From 0c887edbaa68d5f44358f0fa86f282cce824cbca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Fri, 24 Dec 2021 15:31:03 +0100 Subject: [PATCH 12/12] Simplify test app version generation --- test-app/build.gradle.kts | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/test-app/build.gradle.kts b/test-app/build.gradle.kts index b9af1cbfad..5f96988db4 100644 --- a/test-app/build.gradle.kts +++ b/test-app/build.gradle.kts @@ -11,24 +11,6 @@ plugins { id("kotlin-parcelize") } -val major: Int = 2 -val minor: Int= 2 -val patch: Int = 1 -val build: Int = 29 -val type: String = "" - -var version: String = "$major.$minor.$patch" -val appendBuild = build != 0 -if (appendBuild || type.isNotEmpty()) { - version += "-$type" - if (appendBuild) { - version += build - } -} - -project.ext.set("versionName", version) -project.ext.set("versionCode", 1_000_000 * major + 10_000 * minor + 100 * patch + build) - android { compileSdk = 31 @@ -38,8 +20,8 @@ android { applicationId = "org.readium.r2reader" - versionCode = project.ext.get("versionCode") as Int - versionName = project.ext.get("versionName") as String + versionName = "2.1.1" + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" ndk.abiFilters.add("armeabi-v7a") ndk.abiFilters.add("arm64-v8a")