GithubHelp home page GithubHelp logo

minamak91 / huawei-publish-gradle-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cianru/huawei-appgallery-publish-gradle-plugin

0.0 0.0 0.0 226 KB

Huawei AppGallery Publish Gradle Plugin allows you to publish the android release build file (*.apk or *.aab) to the Huawei AppGallery store

License: Apache License 2.0

Kotlin 100.00%

huawei-publish-gradle-plugin's Introduction

Huawei App Gallery Publishing

Maven Central Version Version Version License

The plugin allows you to publish the android release build file (*.apk or *.aab) to the Huawei AppGallery.

For publication the plugin used Huawei Publish API (v2)

Adding the plugin to your project

in ./app/build.gradle

buildscript {
    repositories {
        mavenCentral() // or jcenter()
    }

    dependencies {
        classpath "ru.cian:huawei-publish-gradle-plugin:<LAST_RELEASE_VERSION>"
    }
}
Snapshot builds are also available

You'll need to add the Sonatype snapshots repository:

buildscript {
    repositories {
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
    }

    dependencies {
        classpath "ru.cian:huawei-publish-gradle-plugin:<LAST_SNAPSHOT_VERSION>"
    }
}

apply plugin: 'com.android.application'
apply plugin: 'ru.cian.huawei-publish'

huaweiPublish {
    instances {
        release {
            credentialsPath = "$rootDir/huawei-credentials-release.json"
            buildFormat = "apk"
            ...
        }
        debug {
            credentialsPath = "$rootDir/huawei-credentials-debug.json"
            buildFormat = "apk"
            ...
        }
    }
}

Plugin supports different settings for different buildType and flavors. For example, for demo and full flavors and release buildType just change instances like that:

huaweiPublish {
    instances {
        demoRelease {
            credentialsPath = "$rootDir/huawei-credentials-demo-release.json"
            buildFormat = "apk"
            ...
        }
        fullRelease {
            credentialsPath = "$rootDir/huawei-credentials-full-release.json"
            buildFormat = "apk"
            ...
        }
    }
}

File huawei-credentials.json contains next json structure:

{
  "client_id": "<CLIENT_ID>",
  "client_key": "<CLIENT_KEY>"
}

Credentials you should get at Huawei AppGallery Developer Console (Creating an API Client).

Plugin params

param priority type default value cli description
credentialsPath required string null --credentialsPath File path with AppGallery credentials params (client_id and client_key)
publish optional boolean true --publish
--no-publish
true - upload build file and publish it on all users,
false - upload build file without publishing
buildFormat optional string "apk" --buildFormat "apk" or "aab" for corresponding build format
buildFile optional string null --buildFile Path to build file. "null" means use standard path for "apk" and "aab" files.

Features

The following features are available:

  • Publish APK in Huawei AppGallery and auto submit it on all users after getting store approve
  • Different settings for different configurations build types and flavors

The following features are missing:

  • Publish Release Build on a part of users (Huawei Store doesn't support)
  • Change App Store Information: description, app icon, screenshots and etc.

Usage

Gradle generate publishHuaweiAppGallery* task for each buildType configuration those have debuggable=false option.

android {
    buildTypes {
        release {
            debuggable false
            ...
        }
    }
}

Note! Before uploading build file you should build it. Be careful. Don't publish old build file.

./gradlew assembleRelease publishHuaweiAppGalleryRelease

or

./gradlew bundleRelease publishHuaweiAppGalleryRelease

You can override each plugin extension parameter dynamically by using CLI params. For example:

./gradlew assembleRelease publishHuaweiAppGalleryRelease \
    --no-publish \ 
    --credentialsPath="/sample1/huawei-credentials.json" \
    --buildFormat="apk"

License

Copyright 2020 Aleksandr Mirko

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

huawei-publish-gradle-plugin's People

Contributors

cosic avatar destanyinside avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.