diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml new file mode 100644 index 0000000..f082593 --- /dev/null +++ b/.github/workflows/codestyle.yml @@ -0,0 +1,21 @@ +name: Code Style Tests + +on: [push, pull_request] + +jobs: + detekt: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Run detekt checks + run: ./gradlew :plugin:detekt diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 3dc1807..daf9017 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,4 +1,4 @@ -name: All tests +name: All Tests on: push: @@ -11,7 +11,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - kotlin-version: [1.4.21, 1.5.21] + kotlin-version: [1.4.21, 1.5.30] runs-on: ${{ matrix.os }} steps: @@ -26,3 +26,21 @@ jobs: uses: eskatos/gradle-command-action@v1 with: arguments: :plugin:test --stacktrace -Pkotlin.version=${{ matrix.kotlin-version }} + + build: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + kotlin-version: [1.4.21, 1.5.30] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build plugin + run: ./gradlew :plugin:publishToMavenLocal diff --git a/CHANGELOG.md b/CHANGELOG.md index 4406709..19d3087 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +# 1.3.1 + +##### Add +* Support of Detekt. +* Execute GitHub actions to run detekt checks on each push and pull request. + +##### Fix +* [issue#32](https://github.com/cianru/huawei-publish-gradle-plugin/issues/32): + Fix correct finding of aab and apk build files. +* [issue#33](https://github.com/cianru/huawei-publish-gradle-plugin/issues/33): + Publish task must run after assemble and bundle tasks. + # 1.3.0 ##### Add diff --git a/README.md b/README.md index d2c5a9e..6eb7bd8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Huawei App Gallery Publishing [![Maven Central](https://img.shields.io/maven-central/v/ru.cian/huawei-publish-gradle-plugin.svg)](https://search.maven.org/search?q=a:huawei-publish-gradle-plugin) -![Version](https://img.shields.io/badge/Version-1.3.0-green.svg) +![Version](https://img.shields.io/badge/Version-1.3.1-green.svg) ![Version](https://img.shields.io/badge/Gradle-7.0.*-pink.svg) [![License](https://img.shields.io/github/license/srs/gradle-node-plugin.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) @@ -35,7 +35,7 @@ so a different version of AGP corresponds to a specific version of the current p | 4.0.+ | 1.2.3 | | 4.1.+ | 1.2.4 | | 4.2.+ | 1.2.5 | -| 7.+ | 1.3.0 | +| 7.+ | 1.3.1 | # Adding the plugin to your project @@ -376,6 +376,7 @@ For more information see the [Issue#10](https://github.com/cianru/huawei-publish # Known Huawei Issues * I use correct `client_id` and `client_secret` but get [Huawei AppGallery Connect API - 403 client token authorization fail](https://stackoverflow.com/questions/63999681/huawei-appgallery-connect-api-403-client-token-authorization-fail) +* There is no way to publish build to open testing track in AppGallery. See [issues/34](https://github.com/cianru/huawei-publish-gradle-plugin/issues/34) # License diff --git a/RELEASING.md b/RELEASING.md index 26a8393..d2a5255 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -90,12 +90,17 @@ rm -rv ~/.m2/repository/ru/cian/huawei-publish-gradle-plugin/ ```bash ./gradlew clean check ``` +1. Verify that the code style is correct: + ```bash + ./gradlew detekt + ``` 1. Upload binaries to Sonatype: ```bash ./gradlew publishHuaweiPublicationToMavenRepository ``` -1. Check uploaded files and version Sonatype site: https://search.maven.org/search?q=ru.cian and https://repo1.maven.org/maven2/ru/cian/huawei-publish-gradle-plugin/ -1. Go to https://oss.sonatype.org, log in with your credentials +1. Check uploaded files and version Sonatype site: [search.maven.org](https://search.maven.org/search?q=ru.cian) + and [repo1.maven.org](https://repo1.maven.org/maven2/ru/cian/huawei-publish-gradle-plugin/) +1. Go to [oss.sonatype.org](https://oss.sonatype.org), log in with your credentials 1. Click "Staging Repositories" 1. Find the "ru.cian" repo, usually at the bottom of the list 1. "Close" the repository (select it then click the "close" button up top), the text field doesn't matter so put whatever you want in it @@ -114,7 +119,7 @@ rm -rv ~/.m2/repository/ru/cian/huawei-publish-gradle-plugin/ ```bash ./gradlew build bintrayUpload ``` -1. Check uploaded files and version Bintray site: https://bintray.com/myumatov/ru.cian/huawei-publish-gradle-plugin +1. Check uploaded files and version Bintray site: [bintray.com](https://bintray.com/myumatov/ru.cian/huawei-publish-gradle-plugin) ######################################################################## ### Pushing a release build to Gradle Plugin Portal diff --git a/build.gradle.kts b/build.gradle.kts index 152db96..a2174df 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -23,6 +23,11 @@ allprojects { } } +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + tasks.withType { kotlinOptions { jvmTarget = "11" diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index 4712620..f15c97d 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -79,6 +79,11 @@ tasks.withType { } } +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + repositories { google() mavenCentral() diff --git a/plugin/gradle.properties b/plugin/gradle.properties index 9b618e6..2d207f2 100644 --- a/plugin/gradle.properties +++ b/plugin/gradle.properties @@ -8,7 +8,7 @@ android.enableJetifier=true #################################################################################################### GROUP=ru.cian -VERSION_NAME=1.3.1-SNAPSHOT +VERSION_NAME=1.3.1 POM_ARTIFACT_ID=huawei-publish-gradle-plugin POM_NAME=Huawei Publish Gradle Plugin diff --git a/plugin/src/main/kotlin/ru/cian/huawei/publish/utils/KotlinExtensions.kt b/plugin/src/main/kotlin/ru/cian/huawei/publish/utils/KotlinExtensions.kt index 17648de..4b19139 100644 --- a/plugin/src/main/kotlin/ru/cian/huawei/publish/utils/KotlinExtensions.kt +++ b/plugin/src/main/kotlin/ru/cian/huawei/publish/utils/KotlinExtensions.kt @@ -1,16 +1,11 @@ package ru.cian.huawei.publish.utils -import org.gradle.util.GUtil -import java.lang.StringBuilder - private const val SECOND_IN_MILLIS = 1000L private const val MINUTE_IN_MILLIS = SECOND_IN_MILLIS * 60 private const val HOUR_IN_MILLIS = MINUTE_IN_MILLIS * 60 private const val DAY_IN_MILLIS = HOUR_IN_MILLIS * 24 private const val WEEK_IN_MILLIS = DAY_IN_MILLIS * 7 -internal fun String.toCamelCase() = GUtil.toCamelCase(this) - internal fun String?.nullIfBlank(): String? { if (this.isNullOrBlank()) { return null diff --git a/sample-groovy/build.gradle b/sample-groovy/build.gradle index 58143ab..27c31c2 100644 --- a/sample-groovy/build.gradle +++ b/sample-groovy/build.gradle @@ -79,4 +79,5 @@ android { dependencies { implementation Dependencies.libs.appcompat + implementation Dependencies.libs.kotlinStdlib } diff --git a/sample-kotlin/build.gradle.kts b/sample-kotlin/build.gradle.kts index 314e6f8..b3b6aff 100644 --- a/sample-kotlin/build.gradle.kts +++ b/sample-kotlin/build.gradle.kts @@ -52,8 +52,8 @@ android { isAbortOnError = false } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } @@ -65,4 +65,5 @@ configurations { dependencies { implementation(Dependencies.libs.appcompat) + implementation(Dependencies.libs.kotlinStdlib) }