diff --git a/.github/workflows/code-analysis.yml b/.github/workflows/code-analysis.yml index 07ffc73f..6228198d 100644 --- a/.github/workflows/code-analysis.yml +++ b/.github/workflows/code-analysis.yml @@ -9,13 +9,12 @@ on: - '*' jobs: - checkout: - name: Code analysis + detekt: + name: Detekt runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v1 - - name: Save Gradle Caches uses: actions/cache@v2 with: @@ -23,13 +22,42 @@ jobs: key: gradle-caches-${{ runner.os }} restore-keys: | gradle-caches-${{ runner.os }} - - name: Detekt run: ./gradlew detektAll + - name: Stop Gradle + run: ./gradlew --stop + + ktlint: + name: ktlint + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Save Gradle Caches + uses: actions/cache@v2 + with: + path: ~/.gradle/caches/ + key: gradle-caches-${{ runner.os }} + restore-keys: | + gradle-caches-${{ runner.os }} - name: ktlint run: ./gradlew ktlintAll + - name: Stop Gradle + run: ./gradlew --stop + cpd: + name: CPD + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Save Gradle Caches + uses: actions/cache@v2 + with: + path: ~/.gradle/caches/ + key: gradle-caches-${{ runner.os }} + restore-keys: | + gradle-caches-${{ runner.os }} - name: CPD run: ./gradlew cpdAll - - name: Stop Gradle - run: ./gradlew --stop + run: ./gradlew --stop \ No newline at end of file diff --git a/.gitignore b/.gitignore index 575b0ccd..d86697da 100644 --- a/.gitignore +++ b/.gitignore @@ -74,6 +74,6 @@ atlassian-ide-plugin.xml # generated by Crashlytics plugin (for Android Studio and Intellij) com_crashlytics_export_strings.xml -bintray.properties - +publish.properties +*.gpg diff --git a/CHANGELOG.md b/CHANGELOG.md index fc72be3b..085ef755 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Changelog ========= +## Version 5.2.4 + +_2021-02-11_ + +* Update more dependencies to stable versions. + ## Version 5.2.3 _2021-02-03_ diff --git a/README.md b/README.md index bb157ba5..bd7dea24 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[ ![Download](https://api.bintray.com/packages/infinum/android/dbinspector/images/download.svg) ](https://bintray.com/infinum/android/dbinspector/_latestVersion) ![Validate Gradle Wrapper](https://github.com/infinum/android_dbinspector/workflows/Validate%20Gradle%20Wrapper/badge.svg) ![Code analysis](https://github.com/infinum/android_dbinspector/workflows/Code%20analysis/badge.svg) +![Download](https://img.shields.io/maven-central/v/com.infinum.dbinspector/dbinspector) ![Validate Gradle Wrapper](https://github.com/infinum/android_dbinspector/workflows/Validate%20Gradle%20Wrapper/badge.svg) ![Code analysis](https://github.com/infinum/android_dbinspector/workflows/Code%20analysis/badge.svg) ### # DbInspector @@ -26,9 +26,7 @@ To include _DbInspector_ in your project, you have to add buildscript dependenci ```groovy buildscript { repositories { - jcenter() - // or ... - maven { url "https://dl.bintray.com/infinum/android" } + mavenCentral() } } ``` @@ -36,9 +34,7 @@ buildscript { ```kotlin buildscript { repositories { - jcenter() - // or ... - maven(url = "https://dl.bintray.com/infinum/android") + mavenCentral() } } ``` @@ -47,13 +43,13 @@ Then add the following dependencies in your app `build.gradle` or `build.gradle. **Groovy** ```groovy -debugImplementation "com.infinum.dbinspector:dbinspector:5.2.3" -releaseImplementation "com.infinum.dbinspector:dbinspector-no-op:5.2.3" +debugImplementation "com.infinum.dbinspector:dbinspector:5.2.4" +releaseImplementation "com.infinum.dbinspector:dbinspector-no-op:5.2.4" ``` **KotlinDSL** ```kotlin -debugImplementation("com.infinum.dbinspector:dbinspector:5.2.3") -releaseImplementation("com.infinum.dbinspector:dbinspector-no-op:5.2.3") +debugImplementation("com.infinum.dbinspector:dbinspector:5.2.4") +releaseImplementation("com.infinum.dbinspector:dbinspector-no-op:5.2.4") ``` ### Usage diff --git a/build.gradle b/build.gradle index 8ae9c1ec..9742b413 100644 --- a/build.gradle +++ b/build.gradle @@ -8,17 +8,16 @@ buildscript { "buildTools": "30.0.3" ] + apply from: "maven.gradle" apply from: "dependencies.gradle" repositories { google() - maven { url "https://dl.bintray.com/infinum/android" } - jcenter() + mavenCentral() maven { url "https://plugins.gradle.org/m2/" } } dependencies { classpath packages.gradle - classpath packages.bintray classpath packages.kotlin.plugin classpath packages.cpd.plugin classpath packages.detekt.plugin @@ -32,9 +31,17 @@ allprojects { repositories { google() - maven { url "https://dl.bintray.com/infinum/android" } - jcenter() - maven { url "https://jitpack.io" } + mavenCentral() + jcenter() { + content { + includeModule("com.soywiz.korlibs.korte", "korte-jvm") + includeModule("org.jetbrains.trove4j", "trove4j") + includeModule("org.jetbrains.kotlinx", "kotlinx-html-jvm") + includeGroup("org.jetbrains.dokka") + includeGroup("org.jetbrains") + includeGroup("org.koin") + } + } } def buildProperties = new Properties() @@ -52,19 +59,15 @@ allprojects { } subprojects { - repositories { - google() - maven { url "https://dl.bintray.com/infinum/android" } - jcenter() - mavenCentral() - } - - apply from: "../cpd.gradle" - apply from: "../detekt.gradle" - apply from: "../ktlint.gradle" - apply from: "../dokka.gradle" + apply from: "$rootDir/cpd.gradle" + apply from: "$rootDir/detekt.gradle" + apply from: "$rootDir/ktlint.gradle" + apply from: "$rootDir/dokka.gradle" } +apply from: "shared.gradle" +apply from: "deploy.gradle" + tasks.withType(JavaCompile) { options.compilerArgs += ["--release", "8"] } @@ -97,8 +100,6 @@ task cpdAll(dependsOn: [ description = "Run cpdCheck on all modules" } -apply from: "shared.gradle" - task runStaticChecks(dependsOn: ordered( ':detektAll', ':ktlintAll', @@ -107,5 +108,3 @@ task runStaticChecks(dependsOn: ordered( group = "Verification" description = "Run static checks on all modules" } - -apply from: "deploy.gradle" diff --git a/buildSrc/src/main/groovy/com/infinum/maven/BintrayConfiguration.groovy b/buildSrc/src/main/groovy/com/infinum/maven/BintrayConfiguration.groovy new file mode 100644 index 00000000..0a62e2c0 --- /dev/null +++ b/buildSrc/src/main/groovy/com/infinum/maven/BintrayConfiguration.groovy @@ -0,0 +1,41 @@ +package com.infinum.maven + +import com.infinum.maven.shared.BaseConfiguration + +class BintrayConfiguration implements BaseConfiguration { + + private Properties properties = new Properties() + + @Override + void load() { + File file = new File("publish.properties") + if (file.exists()) { + properties.load(new FileInputStream(file)) + } else { + properties.setProperty("bintray.name", "") + properties.setProperty("bintray.url", "") + properties.setProperty("bintray.user", "") + properties.setProperty("bintray.apikey", "") + } + } + + @Override + String name() { + return properties.getProperty("bintray.name").toString() + } + + @Override + String url() { + return properties.getProperty("bintray.url").toString() + } + + @Override + String username() { + return properties.getProperty("bintray.user").toString() + } + + @Override + String password() { + return properties.getProperty("bintray.apikey").toString() + } +} \ No newline at end of file diff --git a/buildSrc/src/main/groovy/com/infinum/maven/GithubConfiguration.groovy b/buildSrc/src/main/groovy/com/infinum/maven/GithubConfiguration.groovy new file mode 100644 index 00000000..f569f743 --- /dev/null +++ b/buildSrc/src/main/groovy/com/infinum/maven/GithubConfiguration.groovy @@ -0,0 +1,41 @@ +package com.infinum.maven + +import com.infinum.maven.shared.BaseConfiguration + +class GithubConfiguration implements BaseConfiguration { + + private Properties properties = new Properties() + + @Override + void load() { + File file = new File("publish.properties") + if (file.exists()) { + properties.load(new FileInputStream(file)) + } else { + properties.setProperty("github.name", "") + properties.setProperty("github.url", "") + properties.setProperty("github.user", "") + properties.setProperty("github.token", "") + } + } + + @Override + String name() { + return properties.getProperty("github.name").toString() + } + + @Override + String url() { + return properties.getProperty("github.url").toString() + } + + @Override + String username() { + return properties.getProperty("github.user").toString() + } + + @Override + String password() { + return properties.getProperty("github.token").toString() + } +} \ No newline at end of file diff --git a/buildSrc/src/main/groovy/com/infinum/maven/SonatypeConfiguration.groovy b/buildSrc/src/main/groovy/com/infinum/maven/SonatypeConfiguration.groovy new file mode 100644 index 00000000..000bacbd --- /dev/null +++ b/buildSrc/src/main/groovy/com/infinum/maven/SonatypeConfiguration.groovy @@ -0,0 +1,41 @@ +package com.infinum.maven + +import com.infinum.maven.shared.BaseConfiguration + +class SonatypeConfiguration implements BaseConfiguration { + + private Properties properties = new Properties() + + @Override + void load() { + File file = new File("publish.properties") + if (file.exists()) { + properties.load(new FileInputStream(file)) + } else { + properties.setProperty("sonatype.name", "") + properties.setProperty("sonatype.url", "") + properties.setProperty("sonatype.user", "") + properties.setProperty("sonatype.password", "") + } + } + + @Override + String name() { + return properties.getProperty("sonatype.name").toString() + } + + @Override + String url() { + return properties.getProperty("sonatype.url").toString() + } + + @Override + String username() { + return properties.getProperty("sonatype.user").toString() + } + + @Override + String password() { + return properties.getProperty("sonatype.password").toString() + } +} \ No newline at end of file diff --git a/buildSrc/src/main/groovy/com/infinum/maven/shared/BaseConfiguration.groovy b/buildSrc/src/main/groovy/com/infinum/maven/shared/BaseConfiguration.groovy new file mode 100644 index 00000000..20dc4f12 --- /dev/null +++ b/buildSrc/src/main/groovy/com/infinum/maven/shared/BaseConfiguration.groovy @@ -0,0 +1,14 @@ +package com.infinum.maven.shared + +interface BaseConfiguration { + + void load() + + String name() + + String url() + + String username() + + String password() +} \ No newline at end of file diff --git a/cpd.gradle b/cpd.gradle index b07f1f86..aa9c4fa9 100644 --- a/cpd.gradle +++ b/cpd.gradle @@ -9,4 +9,4 @@ cpdCheck { xml.enabled = true } source = allprojects*.file("src/main/kotlin") -} \ No newline at end of file +} diff --git a/dbinspector-no-op/build.gradle b/dbinspector-no-op/build.gradle index 3ce28082..0b415502 100644 --- a/dbinspector-no-op/build.gradle +++ b/dbinspector-no-op/build.gradle @@ -48,4 +48,4 @@ dependencies { implementation packages.kotlin.core } -apply from: "bintray.gradle" +apply from: "publish.gradle" diff --git a/dbinspector-no-op/bintray.gradle b/dbinspector-no-op/publish.gradle similarity index 67% rename from dbinspector-no-op/bintray.gradle rename to dbinspector-no-op/publish.gradle index 3baae2be..f0d5c2e5 100644 --- a/dbinspector-no-op/bintray.gradle +++ b/dbinspector-no-op/publish.gradle @@ -1,5 +1,5 @@ apply plugin: "maven-publish" -apply plugin: "com.jfrog.bintray" +apply plugin: "signing" task sourcesJar(type: Jar) { archiveClassifier.set("sources") @@ -13,8 +13,34 @@ task javadocsJar(type: Jar, dependsOn: "dokkaJavadoc") { afterEvaluate { publishing { + repositories { + maven { + name sonatype.name() + url sonatype.url() + credentials { + username sonatype.username() + password sonatype.password() + } + } + maven { + name github.name() + url github.url() + credentials { + username github.username() + password github.password() + } + } + maven { + name bintray.name() + url bintray.url() + "/dbinspector-no-op/;publish=1;override=1" + credentials { + username bintray.username() + password bintray.password() + } + } + } publications { - infinum(MavenPublication) { + release(MavenPublication) { groupId = dbinspector.group version = dbinspector.version @@ -61,42 +87,10 @@ afterEvaluate { dependencyNode.appendNode("version", it.version) } } + signing { + sign publishing.publications.release + } } } } } - -bintray { - Properties properties = new Properties() - def bintrayProperties = rootProject.file("bintray.properties") - if (bintrayProperties.exists()) { - properties.load(new FileInputStream(bintrayProperties)) - } else { - properties.setProperty("bintray.user", "") - properties.setProperty("bintray.apikey", "") - } - - user = properties.getProperty("bintray.user") - key = properties.getProperty("bintray.apikey") - - publications = ["infinum"] - - pkg { - repo = "android" - name = "dbinspector-no-op" - userOrg = "infinum" - desc = "DbInspector no op package" - websiteUrl = "https://github.com/infinum/android_dbinspector" - issueTrackerUrl = "https://github.com/infinum/android_dbinspector/issues" - vcsUrl = "https://github.com/infinum/android_dbinspector.git" - licenses = ["Apache-2.0"] - version { - name = "${dbinspector.version}" - released = new Date() - vcsTag = "${dbinspector.version}" - } - publish = true - override = true - publicDownloadNumbers = true - } -} \ No newline at end of file diff --git a/dbinspector/build.gradle b/dbinspector/build.gradle index f0d6116a..6454a53a 100644 --- a/dbinspector/build.gradle +++ b/dbinspector/build.gradle @@ -70,4 +70,4 @@ dependencies { implementation packages.timber.core } -apply from: "bintray.gradle" +apply from: "publish.gradle" diff --git a/dbinspector/bintray.gradle b/dbinspector/publish.gradle similarity index 67% rename from dbinspector/bintray.gradle rename to dbinspector/publish.gradle index 968322bf..5798f536 100644 --- a/dbinspector/bintray.gradle +++ b/dbinspector/publish.gradle @@ -1,5 +1,5 @@ apply plugin: "maven-publish" -apply plugin: "com.jfrog.bintray" +apply plugin: "signing" task sourcesJar(type: Jar) { archiveClassifier.set("sources") @@ -13,8 +13,34 @@ task javadocsJar(type: Jar, dependsOn: "dokkaJavadoc") { afterEvaluate { publishing { + repositories { + maven { + name sonatype.name() + url sonatype.url() + credentials { + username sonatype.username() + password sonatype.password() + } + } + maven { + name github.name() + url github.url() + credentials { + username github.username() + password github.password() + } + } + maven { + name bintray.name() + url bintray.url() + "/dbinspector/;publish=1;override=1" + credentials { + username bintray.username() + password bintray.password() + } + } + } publications { - infinum(MavenPublication) { + release(MavenPublication) { groupId = dbinspector.group version = dbinspector.version @@ -61,42 +87,10 @@ afterEvaluate { dependencyNode.appendNode("version", it.version) } } + signing { + sign publishing.publications.release + } } } } -} - -bintray { - Properties properties = new Properties() - def bintrayProperties = rootProject.file("bintray.properties") - if (bintrayProperties.exists()) { - properties.load(new FileInputStream(bintrayProperties)) - } else { - properties.setProperty("bintray.user", "") - properties.setProperty("bintray.apikey", "") - } - - user = properties.getProperty("bintray.user") - key = properties.getProperty("bintray.apikey") - - publications = ["infinum"] - - pkg { - repo = "android" - name = "dbinspector" - userOrg = "infinum" - desc = "DbInspector package" - websiteUrl = "https://github.com/infinum/android_dbinspector" - issueTrackerUrl = "https://github.com/infinum/android_dbinspector/issues" - vcsUrl = "https://github.com/infinum/android_dbinspector.git" - licenses = ["Apache-2.0"] - version { - name = "${dbinspector.version}" - released = new Date() - vcsTag = "${dbinspector.version}" - } - publish = true - override = true - publicDownloadNumbers = true - } -} +} \ No newline at end of file diff --git a/dependencies.gradle b/dependencies.gradle index fd38d83b..1845e119 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,25 +1,24 @@ ext.dbinspector = [ "group" : "com.infinum.dbinspector", - "version" : "5.2.3", - "versionCode": 5 * 100 * 100 + 2 * 100 + 3 + "version" : "5.2.4", + "versionCode": 5 * 100 * 100 + 2 * 100 + 4 ] ext.versions = [ - "dbinspector" : "5.2.3", + "dbinspector" : "5.2.4", "gradle" : '4.1.2', - "kotlin" : "1.4.21", + "kotlin" : "1.4.30", "coroutines" : "1.4.2", - "bintray" : "1.8.5", "core" : "1.3.2", "appcompat" : "1.2.0", - "fragment" : "1.3.0-rc02", + "fragment" : "1.3.0", "viewpager" : "1.0.0", - "paging" : "3.0.0-alpha13", + "paging" : "3.0.0-beta01", "recyclerview" : "1.2.0-beta01", "startup" : "1.0.0", "swiperefreshlayout": "1.1.0", "datastore" : "1.0.0-alpha06", - "design" : "1.2.1", + "design" : "1.3.0", "protobuf" : "3.14.0", "protobuf_plugin" : "0.8.14", "koin" : "2.2.2", @@ -39,7 +38,6 @@ ext.packages = [ "kotlinx" : [ "coroutines": "org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.coroutines}" ], - "bintray" : "com.jfrog.bintray.gradle:gradle-bintray-plugin:${versions.bintray}", "dbinspector": [ "dbinspector" : "com.infinum.dbinspector:dbinspector:${versions.dbinspector}", "dbinspector_no_op": "com.infinum.dbinspector:dbinspector-no-op:${versions.dbinspector}" diff --git a/deploy.gradle b/deploy.gradle index d956f5fe..9b62c17b 100644 --- a/deploy.gradle +++ b/deploy.gradle @@ -2,18 +2,22 @@ apply from: "shared.gradle" task deployDbInspector(dependsOn: ordered( ':dbinspector:clean', - ':dbinspector:bintrayUpload' + ':dbinspector:publishReleasePublicationToBintrayRepository', + ':dbinspector:publishReleasePublicationToGithubRepository', + ':dbinspector:publishReleasePublicationToSonatypeRepository' )) { group = "Deploy" - description = "Deploy module to Bintray" + description = "Deploy module to repositories" } task deployDbInspectorNoOp(dependsOn: ordered( ':dbinspector-no-op:clean', - ':dbinspector-no-op:bintrayUpload' + ':dbinspector-no-op:publishReleasePublicationToBintrayRepository', + ':dbinspector-no-op:publishReleasePublicationToGithubRepository', + ':dbinspector-no-op:publishReleasePublicationToSonatypeRepository' )) { group = "Deploy" - description = "Deploy module to Bintray" + description = "Deploy module to repositories" } task deployAll(dependsOn: ordered( @@ -21,5 +25,5 @@ task deployAll(dependsOn: ordered( 'deployDbInspectorNoOp' )) { group = "Deploy" - description = "Deploy all modules to Bintray" + description = "Deploy all modules to repositories" } diff --git a/gradle.properties b/gradle.properties index 6b9f5979..96551656 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,4 +18,4 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryErro # org.gradle.parallel=true android.useAndroidX=true -android.enableJetifier=false +android.enableJetifier=false \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 65de8353..e4b92272 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-all.zip \ No newline at end of file diff --git a/maven.gradle b/maven.gradle new file mode 100644 index 00000000..8ecc3776 --- /dev/null +++ b/maven.gradle @@ -0,0 +1,30 @@ +import com.infinum.maven.BintrayConfiguration +import com.infinum.maven.GithubConfiguration +import com.infinum.maven.SonatypeConfiguration + +BintrayConfiguration.metaClass.constructor = { -> + def constructor = BintrayConfiguration.class.getConstructor() + def instance = constructor.newInstance() + instance.load() + instance +} + +GithubConfiguration.metaClass.constructor = { -> + def constructor = GithubConfiguration.class.getConstructor() + def instance = constructor.newInstance() + instance.load() + instance +} + +SonatypeConfiguration.metaClass.constructor = { -> + def constructor = SonatypeConfiguration.class.getConstructor() + def instance = constructor.newInstance() + instance.load() + instance +} + +ext { + bintray = new BintrayConfiguration() + github = new GithubConfiguration() + sonatype = new SonatypeConfiguration() +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index b68f1dbb..a88c9449 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,5 @@ -include ':sample', 'dbinspector', 'dbinspector-no-op' +rootProject.name="DbInspector" + +include "dbinspector" +include "dbinspector-no-op" +include ":sample"