diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 05918295..c2a4dde0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: build +name: "build" on: push diff --git a/.github/workflows/deploy-release.yml b/.github/workflows/deploy-release.yml new file mode 100644 index 00000000..cfb10e5e --- /dev/null +++ b/.github/workflows/deploy-release.yml @@ -0,0 +1,46 @@ +name: "deploy release" + +on: + push: + tags-ignore: + - '*-SNAPSHOT' + +jobs: + all_checks: + runs-on: ubuntu-latest + steps: + - name: "Checkout" + uses: actions/checkout@v1 + - name: "Set up Java" + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: "Checks all the things" + run: ./gradlew lint ktlintCheck test jacocoTestCoverageVerification pitest apiCheck assemble + + publish: + needs: [ all_checks ] + runs-on: ubuntu-latest + steps: + - name: "Checkout" + uses: actions/checkout@v1 + - name: "Set up Java" + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: "Get tag and save into env" + uses: olegtarasov/get-tag@v2.1 + id: tagName + - name: "Upload release" + run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel + env: + libraryVersionTag: ${{ steps.tagName.outputs.tag }} + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} + - name: "Publish release" + run: ./gradlew closeAndReleaseRepository --no-daemon --no-parallel + env: + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy-snapshot.yml similarity index 63% rename from .github/workflows/deploy.yml rename to .github/workflows/deploy-snapshot.yml index a075a287..eea93148 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy-snapshot.yml @@ -1,9 +1,9 @@ -name: deploy +name: "deploy snapshot" on: push: tags: - - '*' + - '*-SNAPSHOT' jobs: all_checks: @@ -19,7 +19,7 @@ jobs: run: ./gradlew lint ktlintCheck test jacocoTestCoverageVerification pitest apiCheck assemble publish: - needs: [all_checks] + needs: [ all_checks ] runs-on: ubuntu-latest steps: - name: "Checkout" @@ -29,11 +29,11 @@ jobs: with: java-version: 1.8 - name: "Get tag and save into env" - uses: olegtarasov/get-tag@v1 + uses: olegtarasov/get-tag@v2.1 id: tagName - - name: "Build, publish and upload to Bintray" + - name: "Upload release" + run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel env: libraryVersionTag: ${{ steps.tagName.outputs.tag }} - bintrayUser: ${{ secrets.BINTRAY_USER }} - bintrayApiKey: ${{ secrets.BINTRAY_TOKEN }} - run: ./gradlew build publish bintrayUpload \ No newline at end of file + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} diff --git a/.idea/gradle.xml b/.idea/gradle.xml index b0ae76a1..be23598a 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,13 +4,12 @@ diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index e497da99..00000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.media/btc.png b/.media/btc.png deleted file mode 100644 index 14246d81..00000000 Binary files a/.media/btc.png and /dev/null differ diff --git a/CHANGELOG.md b/CHANGELOG.md index 82a75734..8057ddee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,13 @@ - binary compatibility will now be verified and held up on every release. -## `[0.14.0]` - 2021-XX-XX +## `[0.14.0]` - 2021-10-17 -- Update kotlinx.coroutines to `1.4.3`. +- Update kotlinx.coroutines to `1.5.2`. - Remove kotlin as `api` dependency. - Remove `ControllerLog.default`. - Lazily start controller when accessing `Controller.effects` field (#26) +- `control-core` will now be deployed to mavenCentral ## `[0.13.1]` - 2020-09-13 diff --git a/README.md b/README.md index f7ce717b..5cb1855a 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ test coverage is automatically run by github actions on `[push]` | | threshold | run | output | |---:|:---:|---|---| -| instruction/branch | 90% | `./gradlew test jacocoTestReport` | `./control-core/build/reports/jacoco/` | +| instruction/branch | 94% | `./gradlew test jacocoTestReport` | `./control-core/build/reports/jacoco/` | | mutation | 100% | `./gradlew pitest` | `./control-core/build/reports/pitest/` | ## author diff --git a/build.gradle.kts b/build.gradle.kts index 7990406d..e8c926f9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,19 +7,22 @@ buildscript { } dependencies { - classpath(Libs.kotlin_gradle_plugin) - classpath(Libs.com_jfrog_bintray_gradle_plugin) - classpath(Libs.com_android_tools_build_gradle) - classpath(Libs.kotlin_serialization) - classpath(Libs.gradle_pitest_plugin) - classpath(Libs.binary_compatibility_validator) + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0") + classpath("info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.7.0") + classpath("org.jetbrains.kotlinx:binary-compatibility-validator:0.7.1") + classpath("com.vanniktech:gradle-maven-publish-plugin:0.18.0") + classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.5.31") + + classpath("com.android.tools.build:gradle:4.2.2") + classpath("org.jetbrains.kotlin:kotlin-serialization:1.5.31") } } plugins { - buildSrcVersions jacoco - id("org.jlleitschuh.gradle.ktlint").version(Versions.org_jlleitschuh_gradle_ktlint_gradle_plugin) + id("org.jlleitschuh.gradle.ktlint").version("10.0.0") + `maven-publish` + signing } // ---- api-validation --- // @@ -30,7 +33,7 @@ configure { ignoredProjects.addAll(listOf("kotlin-counter", "android-counter", "android-github")) } -// ---- api-validation --- // +// ---- end api-validation --- // // ---- jacoco --- // @@ -46,7 +49,7 @@ subprojects { } } -// ---- jacoco --- // +// ---- end jacoco --- // allprojects { repositories { diff --git a/buildSrc/.gitignore b/buildSrc/.gitignore deleted file mode 100644 index ea958e57..00000000 --- a/buildSrc/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ - -.gradle/ -build/ diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts deleted file mode 100644 index a53bb063..00000000 --- a/buildSrc/build.gradle.kts +++ /dev/null @@ -1,9 +0,0 @@ -import org.gradle.kotlin.dsl.`kotlin-dsl` - -plugins { - `kotlin-dsl` -} - -repositories { - jcenter() -} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Libs.kt b/buildSrc/src/main/kotlin/Libs.kt deleted file mode 100644 index 28e43434..00000000 --- a/buildSrc/src/main/kotlin/Libs.kt +++ /dev/null @@ -1,205 +0,0 @@ -import kotlin.String - -/** - * Generated by https://github.com/jmfayard/buildSrcVersions - * - * Update this file with - * `$ ./gradlew buildSrcVersions` - */ -object Libs { - /** - * https://github.com/Kotlin/kotlinx.serialization - */ - const val kotlinx_serialization_core: String = - "org.jetbrains.kotlinx:kotlinx-serialization-core:" + - Versions.org_jetbrains_kotlinx_kotlinx_serialization - - /** - * https://github.com/Kotlin/kotlinx.coroutines - */ - const val kotlinx_coroutines_core: String = "org.jetbrains.kotlinx:kotlinx-coroutines-core:" + - Versions.org_jetbrains_kotlinx_kotlinx_coroutines - - /** - * https://github.com/reactivecircus/FlowBinding - */ - const val flowbinding_android: String = - "io.github.reactivecircus.flowbinding:flowbinding-android:" + - Versions.io_github_reactivecircus_flowbinding - - /** - * https://github.com/reactivecircus/FlowBinding - */ - const val flowbinding_core: String = "io.github.reactivecircus.flowbinding:flowbinding-core:" + - Versions.io_github_reactivecircus_flowbinding - - /** - * https://github.com/reactivecircus/FlowBinding - */ - const val flowbinding_recyclerview: String = - "io.github.reactivecircus.flowbinding:flowbinding-recyclerview:" + - Versions.io_github_reactivecircus_flowbinding - - /** - * https://kotlinlang.org/ - */ - const val kotlin_gradle_plugin: String = "org.jetbrains.kotlin:kotlin-gradle-plugin:" + - Versions.org_jetbrains_kotlin - - /** - * https://kotlinlang.org/ - */ - const val kotlin_scripting_compiler_embeddable: String = - "org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:" + - Versions.org_jetbrains_kotlin - - /** - * https://kotlinlang.org/ - */ - const val kotlin_serialization: String = "org.jetbrains.kotlin:kotlin-serialization:" + - Versions.org_jetbrains_kotlin - - /** - * https://kotlinlang.org/ - */ - const val kotlin_stdlib_jdk8: String = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:" + - Versions.org_jetbrains_kotlin - - /** - * https://developer.android.com/jetpack/androidx/releases/fragment#1.3.3 - */ - const val fragment_ktx: String = "androidx.fragment:fragment-ktx:" + Versions.androidx_fragment - - /** - * https://developer.android.com/jetpack/androidx/releases/fragment#1.3.3 - */ - const val fragment_testing: String = "androidx.fragment:fragment-testing:" + - Versions.androidx_fragment - - /** - * https://developer.android.com/testing - */ - const val core_ktx: String = "androidx.test:core-ktx:" + Versions.androidx_test - - /** - * https://developer.android.com/testing - */ - const val androidx_test_rules: String = "androidx.test:rules:" + Versions.androidx_test - - /** - * https://developer.android.com/testing - */ - const val androidx_test_runner: String = "androidx.test:runner:" + Versions.androidx_test - - /** - * https://github.com/ktorio/ktor - */ - const val ktor_client_cio: String = "io.ktor:ktor-client-cio:" + Versions.io_ktor - - /** - * https://github.com/ktorio/ktor - */ - const val ktor_client_json_jvm: String = "io.ktor:ktor-client-json-jvm:" + Versions.io_ktor - - /** - * https://github.com/ktorio/ktor - */ - const val ktor_client_logging_jvm: String = "io.ktor:ktor-client-logging-jvm:" + - Versions.io_ktor - - /** - * https://github.com/ktorio/ktor - */ - const val ktor_client_serialization_jvm: String = "io.ktor:ktor-client-serialization-jvm:" + - Versions.io_ktor - - /** - * http://tools.android.com/ - */ - const val com_android_tools_build_gradle: String = "com.android.tools.build:gradle:" + - Versions.com_android_tools_build_gradle - - const val org_jlleitschuh_gradle_ktlint_gradle_plugin: String = - "org.jlleitschuh.gradle.ktlint:org.jlleitschuh.gradle.ktlint.gradle.plugin:" + - Versions.org_jlleitschuh_gradle_ktlint_gradle_plugin - - const val de_fayard_buildsrcversions_gradle_plugin: String = - "de.fayard.buildSrcVersions:de.fayard.buildSrcVersions.gradle.plugin:" + - Versions.de_fayard_buildsrcversions_gradle_plugin - - const val com_jfrog_bintray_gradle_plugin: String = - "com.jfrog.bintray:com.jfrog.bintray.gradle.plugin:" + - Versions.com_jfrog_bintray_gradle_plugin - - /** - * https://github.com/Kotlin/binary-compatibility-validator - */ - const val binary_compatibility_validator: String = - "org.jetbrains.kotlinx:binary-compatibility-validator:" + - Versions.binary_compatibility_validator - - /** - * https://github.com/floschu/coroutines-test-extensions - */ - const val coroutines_test_extensions: String = - "at.florianschuster.test:coroutines-test-extensions:" + - Versions.coroutines_test_extensions - - /** - * https://developer.android.com/jetpack/androidx/releases/lifecycle#2.3.1 - */ - const val lifecycle_runtime_ktx: String = "androidx.lifecycle:lifecycle-runtime-ktx:" + - Versions.lifecycle_runtime_ktx - - /** - * http://gradle-pitest-plugin.solidsoft.info/ - */ - const val gradle_pitest_plugin: String = "info.solidsoft.gradle.pitest:gradle-pitest-plugin:" + - Versions.gradle_pitest_plugin - - /** - * http://tools.android.com - */ - const val constraintlayout: String = "androidx.constraintlayout:constraintlayout:" + - Versions.constraintlayout - - /** - * https://developer.android.com/testing - */ - const val espresso_core: String = "androidx.test.espresso:espresso-core:" + - Versions.espresso_core - - /** - * http://tools.android.com/ - */ - const val lint_gradle: String = "com.android.tools.lint:lint-gradle:" + Versions.lint_gradle - - const val viewbinding: String = "androidx.databinding:viewbinding:" + Versions.viewbinding - - /** - * https://developer.android.com/jetpack/androidx - */ - const val appcompat: String = "androidx.appcompat:appcompat:" + Versions.appcompat - - /** - * https://developer.android.com/testing - */ - const val junit_ktx: String = "androidx.test.ext:junit-ktx:" + Versions.junit_ktx - - /** - * https://github.com/material-components/material-components-android - */ - const val material: String = "com.google.android.material:material:" + Versions.material - - const val ktlint: String = "com.pinterest:ktlint:" + Versions.ktlint - - /** - * http://mockk.io - */ - const val mockk: String = "io.mockk:mockk:" + Versions.mockk - - /** - * https://github.com/coil-kt/coil - */ - const val coil: String = "io.coil-kt:coil:" + Versions.coil -} diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt deleted file mode 100644 index c31a99e4..00000000 --- a/buildSrc/src/main/kotlin/Versions.kt +++ /dev/null @@ -1,79 +0,0 @@ -import kotlin.String -import org.gradle.plugin.use.PluginDependenciesSpec -import org.gradle.plugin.use.PluginDependencySpec - -/** - * Generated by https://github.com/jmfayard/buildSrcVersions - * - * Find which updates are available by running - * `$ ./gradlew buildSrcVersions` - * This will only update the comments. - * - * YOU are responsible for updating manually the dependency version. - */ -object Versions { - const val org_jetbrains_kotlinx_kotlinx_serialization: String = "1.2.0" - - const val org_jetbrains_kotlinx_kotlinx_coroutines: String = "1.4.3" - - const val io_github_reactivecircus_flowbinding: String = "0.12.0" - - const val org_jetbrains_kotlin: String = "1.5.0" - - const val androidx_fragment: String = "1.3.3" - - const val androidx_test: String = "1.3.0" - - const val io_ktor: String = "1.5.4" - - const val com_android_tools_build_gradle: String = "4.2.0" - - const val org_jlleitschuh_gradle_ktlint_gradle_plugin: String = "10.0.0" - - const val de_fayard_buildsrcversions_gradle_plugin: String = "0.7.0" - - const val com_jfrog_bintray_gradle_plugin: String = "1.8.5" - - const val binary_compatibility_validator: String = "0.5.0" - - const val coroutines_test_extensions: String = "0.1.2" - - const val lifecycle_runtime_ktx: String = "2.3.1" - - const val gradle_pitest_plugin: String = "1.5.2" // available: "1.6.0" - - const val constraintlayout: String = "2.0.4" - - const val espresso_core: String = "3.3.0" - - const val lint_gradle: String = "27.2.0" - - const val viewbinding: String = "4.2.0" - - const val appcompat: String = "1.2.0" - - const val junit_ktx: String = "1.1.2" - - const val material: String = "1.3.0" - - const val ktlint: String = "0.40.0" - - const val mockk: String = "1.11.0" - - const val coil: String = "1.2.1" - - /** - * Current version: "6.8.2" - * See issue 19: How to update Gradle itself? - * https://github.com/jmfayard/buildSrcVersions/issues/19 - */ - const val gradleLatestVersion: String = "7.0.1" -} - -/** - * See issue #47: how to update buildSrcVersions itself - * https://github.com/jmfayard/buildSrcVersions/issues/47 - */ -val PluginDependenciesSpec.buildSrcVersions: PluginDependencySpec - inline get() = - id("de.fayard.buildSrcVersions").version(Versions.de_fayard_buildsrcversions_gradle_plugin) diff --git a/control-core/build.gradle.kts b/control-core/build.gradle.kts index 2f7ca66f..d997934d 100644 --- a/control-core/build.gradle.kts +++ b/control-core/build.gradle.kts @@ -2,14 +2,17 @@ plugins { id("kotlin") id("jacoco") id("info.solidsoft.pitest") + id("com.vanniktech.maven.publish") } dependencies { - api(Libs.kotlinx_coroutines_core) - testImplementation(Libs.mockk) - testImplementation(Libs.coroutines_test_extensions) + api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2") + testImplementation("io.mockk:mockk:1.12.0") + testImplementation("at.florianschuster.test:coroutines-test-extensions:0.1.2") } +// ---- kotlin --- // + tasks.compileTestKotlin { kotlinOptions.freeCompilerArgs = listOf( "-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi", @@ -17,6 +20,16 @@ tasks.compileTestKotlin { ) } +// ---- end kotlin --- // + +// ---- jacoco --- // + +tasks.jacocoTestCoverageVerification { + violationRules { + rule { limit { minimum = "0.94".toBigDecimal() } } + } +} + tasks.jacocoTestReport { reports { xml.isEnabled = true @@ -26,18 +39,19 @@ tasks.jacocoTestReport { classDirectories.setFrom( files(classDirectories.files.map { file -> fileTree(file) { - // jacoco cannot handle inline functions - exclude("at/florianschuster/control/DefaultTagKt.class") + // jacoco cannot handle inline functions properly + exclude( + "at/florianschuster/control/DefaultTagKt.class", + "at/florianschuster/control/ExtensionsKt.class" + ) } }) ) } -tasks.jacocoTestCoverageVerification { - violationRules { - rule { limit { minimum = "0.9".toBigDecimal() } } - } -} +// ---- end jacoco --- // + +// ---- pitest --- // pitest { targetClasses.add("at.florianschuster.control.*") @@ -60,4 +74,10 @@ pitest { verbose.set(true) } -apply(from = "$rootDir/gradle/deploy.gradle") +// ---- end pitest --- // + +// ---- publishing --- // + +version = System.getenv("libraryVersionTag") + +// ---- end publishing --- // diff --git a/control-core/deploy.properties b/control-core/deploy.properties deleted file mode 100644 index 1d5d2ea8..00000000 --- a/control-core/deploy.properties +++ /dev/null @@ -1,3 +0,0 @@ -repo=control -name=control-core -description=coroutines flow based uni-directional architecture \ No newline at end of file diff --git a/control-core/src/test/kotlin/at/florianschuster/control/StartTest.kt b/control-core/src/test/kotlin/at/florianschuster/control/StartTest.kt index 818acb30..73b87a22 100644 --- a/control-core/src/test/kotlin/at/florianschuster/control/StartTest.kt +++ b/control-core/src/test/kotlin/at/florianschuster/control/StartTest.kt @@ -91,6 +91,21 @@ internal class StartTest { assertFalse(sut.stateJob.isActive) } + @Test + fun `lazy start mode with effects`() { + val scope = TestCoroutineScope(Job()) + val sut = scope.createSimpleCounterController( + controllerStart = ControllerStart.Lazy + ) + assertFalse(sut.stateJob.isActive) + + sut.effects + assertTrue(sut.stateJob.isActive) + + scope.cancel() + assertFalse(sut.stateJob.isActive) + } + @Test fun `manual start mode`() { val scope = TestCoroutineScope(Job()) @@ -102,6 +117,7 @@ internal class StartTest { sut.currentState sut.state sut.dispatch(1) + sut.effects assertFalse(sut.stateJob.isActive) val started = sut.start() diff --git a/examples/android-counter/build.gradle.kts b/examples/android-counter/build.gradle.kts index 760a654f..682e9741 100644 --- a/examples/android-counter/build.gradle.kts +++ b/examples/android-counter/build.gradle.kts @@ -6,11 +6,11 @@ plugins { } android { - compileSdkVersion(29) + compileSdkVersion(30) defaultConfig { applicationId = "at.florianschuster.control.counterexample" - minSdkVersion(21) - targetSdkVersion(29) + minSdkVersion(23) + targetSdkVersion(30) versionCode = 1 versionName = "1.0.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" @@ -37,20 +37,20 @@ dependencies { implementation(project(":control-core")) implementation(project(":examples:kotlin-counter")) - implementation(Libs.appcompat) - implementation(Libs.constraintlayout) - implementation(Libs.flowbinding_android) - implementation(Libs.flowbinding_core) - implementation(Libs.lifecycle_runtime_ktx) - implementation(Libs.fragment_ktx) - debugImplementation(Libs.fragment_testing) + implementation("androidx.appcompat:appcompat:1.3.1") + implementation("androidx.constraintlayout:constraintlayout:2.1.1") + implementation("io.github.reactivecircus.flowbinding:flowbinding-android:1.2.0") + implementation("io.github.reactivecircus.flowbinding:flowbinding-core:1.2.0") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.1") + implementation("androidx.fragment:fragment-ktx:1.3.6") + debugImplementation("androidx.fragment:fragment-testing:1.3.6") - testImplementation(Libs.coroutines_test_extensions) + testImplementation("at.florianschuster.test:coroutines-test-extensions:0.1.2") - androidTestImplementation(Libs.androidx_test_rules) - androidTestImplementation(Libs.androidx_test_runner) - androidTestImplementation(Libs.core_ktx) - androidTestImplementation(Libs.espresso_core) - androidTestImplementation(Libs.coroutines_test_extensions) - androidTestImplementation(Libs.junit_ktx) + androidTestImplementation("androidx.test:rules:1.4.0") + androidTestImplementation("androidx.test:runner:1.4.0") + androidTestImplementation("androidx.test:core-ktx:1.4.0") + androidTestImplementation("androidx.test.espresso:espresso-core:3.3.0") + androidTestImplementation("at.florianschuster.test:coroutines-test-extensions:0.1.2") + androidTestImplementation("androidx.test.ext:junit-ktx:1.1.3") } diff --git a/examples/android-github/build.gradle.kts b/examples/android-github/build.gradle.kts index b923736c..a88952ff 100644 --- a/examples/android-github/build.gradle.kts +++ b/examples/android-github/build.gradle.kts @@ -7,11 +7,11 @@ plugins { } android { - compileSdkVersion(29) + compileSdkVersion(30) defaultConfig { applicationId = "at.florianschuster.control.githubexample" - minSdkVersion(21) - targetSdkVersion(29) + minSdkVersion(23) + targetSdkVersion(30) versionCode = 1 versionName = "1.0.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" @@ -43,30 +43,31 @@ android { dependencies { implementation(project(":control-core")) - implementation(Libs.appcompat) - implementation(Libs.coil) - implementation(Libs.constraintlayout) - implementation(Libs.flowbinding_android) - implementation(Libs.flowbinding_core) - implementation(Libs.flowbinding_recyclerview) - implementation(Libs.fragment_ktx) - implementation(Libs.kotlinx_serialization_core) - implementation(Libs.ktor_client_cio) - implementation(Libs.ktor_client_json_jvm) - implementation(Libs.ktor_client_logging_jvm) - implementation(Libs.ktor_client_serialization_jvm) - implementation(Libs.lifecycle_runtime_ktx) - implementation(Libs.material) - debugImplementation(Libs.fragment_testing) + implementation("androidx.appcompat:appcompat:1.3.1") + implementation("io.coil-kt:coil:1.4.0") + implementation("androidx.constraintlayout:constraintlayout:2.1.1") + implementation("io.github.reactivecircus.flowbinding:flowbinding-android:1.2.0") + implementation("io.github.reactivecircus.flowbinding:flowbinding-core:1.2.0") + implementation("io.github.reactivecircus.flowbinding:flowbinding-recyclerview:1.2.0") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.1") + implementation("androidx.fragment:fragment-ktx:1.3.6") + debugImplementation("androidx.fragment:fragment-testing:1.3.6") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.0") + implementation("io.ktor:ktor-client-cio:1.6.4") + implementation("io.ktor:ktor-client-json-jvm:1.6.4") + implementation("io.ktor:ktor-client-logging-jvm:1.6.4") + implementation("io.ktor:ktor-client-serialization-jvm:1.6.4") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.1") + implementation("com.google.android.material:material:1.4.0") - testImplementation(Libs.coroutines_test_extensions) - testImplementation(Libs.mockk) + testImplementation("at.florianschuster.test:coroutines-test-extensions:0.1.2") + testImplementation("io.mockk:mockk:1.12.0") - androidTestImplementation(Libs.core_ktx) - androidTestImplementation(Libs.junit_ktx) - androidTestImplementation(Libs.espresso_core) - androidTestImplementation(Libs.androidx_test_rules) - androidTestImplementation(Libs.androidx_test_runner) - androidTestImplementation(Libs.coroutines_test_extensions) - androidTestImplementation(Libs.mockk) + androidTestImplementation("androidx.test:rules:1.4.0") + androidTestImplementation("androidx.test:runner:1.4.0") + androidTestImplementation("androidx.test:core-ktx:1.4.0") + androidTestImplementation("androidx.test.espresso:espresso-core:3.3.0") + androidTestImplementation("at.florianschuster.test:coroutines-test-extensions:0.1.2") + androidTestImplementation("androidx.test.ext:junit-ktx:1.1.3") + androidTestImplementation("io.mockk:mockk-android:1.12.0") } diff --git a/examples/kotlin-counter/build.gradle.kts b/examples/kotlin-counter/build.gradle.kts index a5e9d6cd..804cfbf8 100644 --- a/examples/kotlin-counter/build.gradle.kts +++ b/examples/kotlin-counter/build.gradle.kts @@ -4,5 +4,5 @@ plugins { dependencies { implementation(project(":control-core")) - testImplementation(Libs.coroutines_test_extensions) + testImplementation("at.florianschuster.test:coroutines-test-extensions:0.1.2") } diff --git a/gradle.properties b/gradle.properties index 23339e0d..c76fd870 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,21 +1,25 @@ -# Project-wide Gradle settings. -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx1536m -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true -# AndroidX package structure to make it clearer which packages are bundled with the -# Android operating system, and which are packaged with your app's APK -# https://developer.android.com/topic/libraries/support-library/androidx-rn +# AndroidX android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX android.enableJetifier=true # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official + +# maven +GROUP=at.florianschuster.control +POM_ARTIFACT_ID=control-core +POM_NAME=control-core +POM_DESCRIPTION=coroutines flow based uni-directional architecture +POM_INCEPTION_YEAR=2020 +POM_URL=https://github.com/floschu/control +POM_SCM_URL=https://github.com/floschu/control +POM_SCM_CONNECTION=scm:git@github.com:floschu/control.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:floschu/control.git +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo +POM_DEVELOPER_ID=floschu +POM_DEVELOPER_NAME=Florian Schuster +POM_DEVELOPER_URL=https://github.com/floschu +SONATYPE_HOST=S01 \ No newline at end of file diff --git a/gradle/deploy.gradle b/gradle/deploy.gradle deleted file mode 100644 index 12f43797..00000000 --- a/gradle/deploy.gradle +++ /dev/null @@ -1,33 +0,0 @@ -apply plugin: "com.jfrog.bintray" - -version = System.getenv("libraryVersionTag") -group = "at.florianschuster.control" - -def settings = new Properties() -file("deploy.properties").withInputStream { settings.load(it) } - -project.ext { - mavProjectName = settings.name - mavLibraryDescription = settings.description - mavPublishToMavenLocal = true - mavSiteUrl = "https://github.com/floschu/control" - mavGitUrl = mavSiteUrl + ".git" - mavLibraryLicenses = ["Apache-2.0": 'http://www.apache.org/licenses/LICENSE-2.0.txt'] -} - -bintray { - user = System.getenv("bintrayUser") - key = System.getenv("bintrayApiKey") - publications = ['mavenPublish'] - configurations = ['archives'] - publish = true - pkg { - repo = settings.repo - name = settings.name - version { - released = new Date() - } - } -} - -apply from: "https://raw.githubusercontent.com/floschu/gradle-maven-plugin/master/gradle-mavenizer.gradle" \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f04eed8c..c4600fb0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip