Provisioning: add feature delivery to the Gradle cache project

Add feature-delivery plugin to the provisioning Gradle cache
to avoid potential fetching on each build in qtbase tests.

The cache project still lives under common/linux/android in
this branch, so apply the changes there. The feature module
uses a Java source since the project is Java based.

Change-Id: Ie9126114287aff77abcd2f68bfff4d8dc25fa6a9
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit 4549003489)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6b1a3ddb0b)
This commit is contained in:
Assam Boudjelthia
2026-08-04 12:06:49 +03:00
parent a6073008b5
commit 6942ac8d64
9 changed files with 51 additions and 1 deletions
@@ -15,6 +15,9 @@ that might need updates in the future:
layout and logic of the app, this shouldn't need to be touched.
- AndroidManifest.xml / app/build.gradle: Sets project settings like target version.
- gradle/libs.versions.toml: This sets the version numbers of various dependencies.
- feature/: an on-demand dynamic feature module, it caches the
com.android.dynamic-feature plugin and the Play feature delivery library
used by the Feature Delivery tests.
Other files required for the project build are gradle wrapper and scripts which
are fetched by android_linux.sh from qtbase.
@@ -18,10 +18,13 @@ android {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
dynamicFeatures = [':feature']
}
dependencies {
implementation libs.core
implementation libs.appcompat
implementation libs.material
implementation libs.play.feature.delivery
}
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="feature_title">Feature</string>
</resources>
@@ -1,4 +1,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.androidDynamicFeature) apply false
}
@@ -0,0 +1,17 @@
plugins {
alias(libs.plugins.androidDynamicFeature)
}
android {
namespace 'com.example.gradle_project.feature'
compileSdk 36
defaultConfig {
minSdk 28
}
}
dependencies {
implementation project(':app')
implementation libs.play.feature.delivery
}
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution">
<dist:module
dist:instant="false"
dist:title="@string/feature_title">
<dist:delivery>
<dist:on-demand />
</dist:delivery>
<dist:fusing dist:include="true" />
</dist:module>
</manifest>
@@ -0,0 +1,7 @@
package com.example.gradle_project.feature;
public class Feature {
public static String hello() {
return "hello";
}
}
@@ -4,14 +4,17 @@ core = "1.17.0"
appcompat = "1.7.1"
material = "1.13.0"
constraintlayout = "2.2.1"
play-feature-delivery = "2.1.0"
[libraries]
core = { group = 'androidx.core', name = "core", version.ref = "core" }
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
play-feature-delivery = { module = "com.google.android.play:feature-delivery", version.ref = "play-feature-delivery" }
[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
androidDynamicFeature = { id = "com.android.dynamic-feature", version.ref = "agp" }
[bundles]
@@ -14,4 +14,4 @@ dependencyResolutionManagement {
}
rootProject.name = "gradle_project"
include ':app'
include ':app', ':feature'