The plugin use Rustore API to publish Android build file to the RuStore.
:construction: That's unofficial plugin. We made it for ourselves and are sharing it for you.
The following features are available:
The following features are missing:
The following features are not available on Rustore API side yet:
The Android Gradle Plugin often changes the Variant API, so a different version of AGP corresponds to a specific version of the current plugin
AGP | Plugin |
---|---|
7.+ | 0.2.2 |
8.+ | latest |
in application module ./app/build.gradle
plugins {
id("com.android.application")
id("ru.cian.rustore-publish-gradle-plugin")
}
apply
methodbuildscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath "ru.cian.rustore-plugin:plugin:<VERSION>"
}
}
apply plugin: 'com.android.application'
apply plugin: 'ru.cian.rustore-publish-gradle-plugin'
rustorePublish {
instances {
create("release") {
/**
* Path to json file with RuStore credentials params (`key_id` and `client_secret`).
* How to get credentials see [[RU] Rustore API Getting Started](https://www.rustore.ru/help/work-with-rustore-api/api-authorization-process/).
* Plugin credential json example:
* {
* "key_id": "<KEY_ID>",
* "client_secret": "<CLIENT_SECRET>"
* }
*
* Type: String (Optional)
* Default value: `null` (but plugin wait that you provide credentials by CLI params)
* CLI: `--credentialsPath`
*/
credentialsPath = "$rootDir/rustore-credentials-release.json"
/**
* Build file format.
* See https://www.rustore.ru/help/developers/publishing-and-verifying-apps/app-publication/upload-aab how to prepare project for loading of aab files.
* Type: String (Optional)
* CLI: `--buildFormat`, available values:
* ----| 'apk'
* ----| 'aab'
* Gradle Extention DSL, available values:
* ----| ru.cian.rustore.publish.BuildFormat.APK
* ----| ru.cian.rustore.publish.BuildFormat.AAB
* Default value: `apk`
*/
buildFormat = ru.cian.rustore.publish.BuildFormat.APK
}
}
}
Also the plugin support different buildType and flavors.
So for demo
and full
flavors and release
buildType just change instances like that:
rustorePublish {
instances {
create("release") {
credentialsPath = "$rootDir/rustore-credentials-release.json"
...
}
create("demoRelease") {
credentialsPath = "$rootDir/rustore-credentials-demo-release.json"
...
}
create("fullRelease") {
credentialsPath = "$rootDir/rustore-credentials-full-release.json"
...
}
}
}
Gradle generate publishRustore*
task for all buildType and flavor configurations.
Note! The plugin will publish already existed build file. Before uploading you should build it yourself. Be careful. Don't publish old build file.
./gradlew assembleRelease publishRustoreRelease
or
./gradlew bundleRelease publishRustoreRelease
You can apply or override each plugin extension parameter dynamically by using CLI params. CLI params are more priority than gradle configuration params.
./gradlew assembleRelease publishRustoreRelease \
--credentialsPath="/sample-kotlin/rustore-credentials.json" \
--buildFormat=apk \
--buildFile="/sample-kotlin/app/build/outputs/apk/release/app-release.apk" \
--mobileServicesType="Unknown" \
--releaseNotes="ru_RU:/home/<USERNAME>/str/project/release_notes_ru.txt"
Also consider our Gradle Plugin for publishing to Huawei AppGallery
Copyright 2023 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.