Skip to content

Commit

Permalink
Build updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Jawnnypoo committed Jun 4, 2024
1 parent 70e8eb4 commit e529fc0
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 80 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-java@v1
with:
java-version: 11
distribution: 'zulu'
java-version: 17
- uses: actions/cache@v2
with:
path: ~/.gradle/caches
Expand Down
21 changes: 3 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,50 +1,35 @@
apply from: 'dependencies.gradle'
apply plugin: "com.github.ben-manes.versions"
apply plugin: "org.jetbrains.dokka"

buildscript {
ext {
kotlinVersion = '1.5.21'
kotlinVersion = '1.9.20'

versions = [:]
libraries = [:]
constants = [
minSdk : 21,
targetSdk : 29,
compileSdk : 29
]
}

repositories {
google()
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
}

dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "com.vanniktech:gradle-android-junit-jacoco-plugin:0.16.0"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "com.github.ben-manes:gradle-versions-plugin:0.28.0"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.4.32"
classpath "org.jetbrains.dokka:android-documentation-plugin:1.4.32"
classpath "com.vanniktech:gradle-maven-publish-plugin:0.14.2"
}
}

allprojects {
repositories {
google()
mavenCentral()
jcenter()
}

tasks.withType(org.jetbrains.dokka.gradle.DokkaTaskPartial).configureEach {
dokkaSourceSets.named("main") {
configuration {
jdkVersion.set(8)
jdkVersion.set(17)
skipDeprecated.set(true)
skipEmptyPackages.set(true)
reportUndocumented.set(false)
Expand All @@ -60,7 +45,7 @@ task clean(type: Delete) {
apply plugin: "com.vanniktech.android.junit.jacoco"
junitJacoco {
// WARNING! Don't upgrade unless https://github.com/Malinskiy/danger-jacoco/issues/10 is fixed
jacocoVersion = '0.8.2'
jacocoVersion = '0.8.12'
excludes = [
// Defaults
'**/androidx/**/*.*',
Expand Down
5 changes: 0 additions & 5 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
ext {
junitVersion = "4.12"
robolectricVersion = "4.1" // be aware of updating https://github.com/robolectric/robolectric/pull/4736
truthVersion = "1.0.1"

libraries = [
junit : "junit:junit:$junitVersion",
kotlin : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion",
kotlinReflect : "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion",
robolectric : "org.robolectric:robolectric:$robolectricVersion",
rxjava : "io.reactivex.rxjava3:rxjava:3.0.4",
rxrelays : "com.jakewharton.rxrelay3:rxrelay:3.0.0",
truth : "com.google.truth:truth:$truthVersion"
]
}
28 changes: 10 additions & 18 deletions lce-rxjava3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,19 @@ apply plugin: 'org.jetbrains.dokka'

apply from: rootProject.file('.buildscript/configure-signing.gradle')

repositories {
mavenCentral()
}

tasks.withType(JavaCompile) {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
kotlin {
jvmToolchain(17)
}

dependencies {
implementation libraries.kotlin

api project(":lce")
api libraries.rxjava
api(project(":lce"))
api(libraries.rxjava)

testImplementation libraries.truth
testImplementation libraries.junit
testImplementation(libraries.truth)
testImplementation(libraries.junit)
}
8 changes: 4 additions & 4 deletions lce-rxjava3/src/main/java/com/laimiux/lce/rxjava3/Init.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ import io.reactivex.rxjava3.core.Maybe
import io.reactivex.rxjava3.core.Observable
import io.reactivex.rxjava3.core.Single

inline fun <C, E> Completable.toUCE(
inline fun <C: Any, E> Completable.toUCE(
value: C,
crossinline mapError: (Throwable) -> E
): Observable<UCE<C, E>> {
return toSingleDefault(value).toUCE(mapError)
}

inline fun <C, E> Single<C>.toUCE(
inline fun <C: Any, E> Single<C>.toUCE(
crossinline mapError: (Throwable) -> E
): Observable<UCE<C, E>> {
return toObservable().toUCE(mapError)
}

inline fun <C, E> Maybe<C>.toUCE(
inline fun <C: Any, E> Maybe<C>.toUCE(
crossinline mapError: (Throwable) -> E
): Observable<UCE<C, E>> {
return toObservable().toUCE(mapError)
}

inline fun <C, E> Observable<C>.toUCE(
inline fun <C: Any, E> Observable<C>.toUCE(
crossinline mapError: (Throwable) -> E
): Observable<UCE<C, E>> {
return this
Expand Down
26 changes: 9 additions & 17 deletions lce-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,18 @@ apply plugin: 'org.jetbrains.dokka'

apply from: rootProject.file('.buildscript/configure-signing.gradle')

repositories {
mavenCentral()
}

tasks.withType(JavaCompile) {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
kotlin {
jvmToolchain(17)
}

dependencies {
implementation libraries.kotlin

api project(":lce")
api(project(":lce"))

testImplementation libraries.truth
testImplementation libraries.junit
testImplementation(libraries.truth)
testImplementation(libraries.junit)
}
24 changes: 8 additions & 16 deletions lce/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,16 @@ apply plugin: 'org.jetbrains.dokka'

apply from: rootProject.file('.buildscript/configure-signing.gradle')

repositories {
mavenCentral()
}

tasks.withType(JavaCompile) {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
kotlin {
jvmToolchain(17)
}

dependencies {
implementation libraries.kotlin

testImplementation libraries.truth
testImplementation libraries.junit
testImplementation(libraries.truth)
testImplementation(libraries.junit)
}
4 changes: 3 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#!/bin/bash
./gradlew testDebugUnitTest
./gradlew :lce:test
./gradlew :lce-rxjava3:test
./gradlew :lce-test:test

0 comments on commit e529fc0

Please sign in to comment.