| author | Da Risk <da_risk@geekorum.com> |
| Wed, 03 Jan 2024 15:26:40 -0400 | |
| changeset 1174 | 731f6ee517b6 |
| parent 1013 | 18d820f292d6 |
| child 1278 | d9fce3f12778 |
| permissions | -rw-r--r-- |
|
137
5464f07a306c
Update copyright headers for 2019
Da Risk <da_risk@geekorum.com>
parents:
54
diff
changeset
|
1 |
/* |
| 0 | 2 |
* Geekttrss is a RSS feed reader application on the Android Platform. |
3 |
* |
|
| 1174 | 4 |
* Copyright (C) 2017-2024 by Frederic-Charles Barthelery. |
| 0 | 5 |
* |
6 |
* This file is part of Geekttrss. |
|
7 |
* |
|
8 |
* Geekttrss is free software: you can redistribute it and/or modify |
|
9 |
* it under the terms of the GNU General Public License as published by |
|
10 |
* the Free Software Foundation, either version 3 of the License, or |
|
11 |
* (at your option) any later version. |
|
12 |
* |
|
13 |
* Geekttrss is distributed in the hope that it will be useful, |
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
* GNU General Public License for more details. |
|
17 |
* |
|
18 |
* You should have received a copy of the GNU General Public License |
|
19 |
* along with Geekttrss. If not, see <http://www.gnu.org/licenses/>. |
|
20 |
*/ |
|
21 |
package com.geekorum.build |
|
22 |
||
|
1013
18d820f292d6
build: rework buildSrc to use agp-api
Da Risk <da_risk@geekorum.com>
parents:
943
diff
changeset
|
23 |
import com.android.build.api.dsl.ApplicationExtension |
| 0 | 24 |
import com.github.triplet.gradle.play.PlayPublisherExtension |
25 |
import org.gradle.api.NamedDomainObjectContainer |
|
26 |
import org.gradle.api.Project |
|
27 |
import org.gradle.api.plugins.ExtensionAware |
|
28 |
import org.gradle.kotlin.dsl.apply |
|
29 |
import org.gradle.kotlin.dsl.configure |
|
30 |
import org.gradle.kotlin.dsl.the |
|
31 |
||
32 |
||
33 |
// Configuration for "com.github.triplet.play" plugin |
|
34 |
// This configuration expects the given properties |
|
35 |
// PLAY_STORE_JSON_KEY_FILE: google play console service credentials json file to use |
|
36 |
// PLAY_STORE_TRACK: track to publish the build, default to internal but can be set to alpha, beta or production |
|
37 |
// PLAY_STORE_FROM_TRACK: track from which to promote a build, default to internal but can be set to alpha, beta or production |
|
38 |
||
39 |
internal fun Project.configureAndroidPlayStorePublisher(): Unit {
|
|
|
635
1c1d190b326a
build: update to agp 4.0.0-beta1 and latest play-publisher plugin
Da Risk <da_risk@geekorum.com>
parents:
611
diff
changeset
|
40 |
apply(plugin = "com.github.triplet.play") |
| 0 | 41 |
configure<PlayPublisherExtension> {
|
|
799
c8bdc3274161
build: update gradle play publisher
Da Risk <da_risk@geekorum.com>
parents:
635
diff
changeset
|
42 |
defaultToAppBundles.set(true) |
|
c8bdc3274161
build: update gradle play publisher
Da Risk <da_risk@geekorum.com>
parents:
635
diff
changeset
|
43 |
track.set(properties.getOrDefault("PLAY_STORE_TRACK", "internal") as String)
|
|
c8bdc3274161
build: update gradle play publisher
Da Risk <da_risk@geekorum.com>
parents:
635
diff
changeset
|
44 |
fromTrack.set(properties.getOrDefault("PLAY_STORE_FROM_TRACK", "internal") as String)
|
|
c8bdc3274161
build: update gradle play publisher
Da Risk <da_risk@geekorum.com>
parents:
635
diff
changeset
|
45 |
serviceAccountCredentials.set(file(properties["PLAY_STORE_JSON_KEY_FILE"]!!)) |
| 0 | 46 |
} |
47 |
||
|
1013
18d820f292d6
build: rework buildSrc to use agp-api
Da Risk <da_risk@geekorum.com>
parents:
943
diff
changeset
|
48 |
val android = the<ApplicationExtension>() as ExtensionAware |
| 0 | 49 |
|
|
398
164702325c93
build: Update to Gradle Play Publisher 2.3.0
Da Risk <da_risk@geekorum.com>
parents:
142
diff
changeset
|
50 |
android.extensions.configure<NamedDomainObjectContainer<PlayPublisherExtension>> {
|
|
164702325c93
build: Update to Gradle Play Publisher 2.3.0
Da Risk <da_risk@geekorum.com>
parents:
142
diff
changeset
|
51 |
register("free") {
|
|
799
c8bdc3274161
build: update gradle play publisher
Da Risk <da_risk@geekorum.com>
parents:
635
diff
changeset
|
52 |
enabled.set(false) |
|
398
164702325c93
build: Update to Gradle Play Publisher 2.3.0
Da Risk <da_risk@geekorum.com>
parents:
142
diff
changeset
|
53 |
} |
|
399
d7616118282e
build: publish a prebuild artifact
Da Risk <da_risk@geekorum.com>
parents:
398
diff
changeset
|
54 |
register("google") {
|
|
d7616118282e
build: publish a prebuild artifact
Da Risk <da_risk@geekorum.com>
parents:
398
diff
changeset
|
55 |
// we always build the release as a separate step when publishing |
|
d7616118282e
build: publish a prebuild artifact
Da Risk <da_risk@geekorum.com>
parents:
398
diff
changeset
|
56 |
// use artifactDir to be sure that publish don't rebuild it |
|
799
c8bdc3274161
build: update gradle play publisher
Da Risk <da_risk@geekorum.com>
parents:
635
diff
changeset
|
57 |
artifactDir.set(file("$buildDir/outputs/bundle/googleRelease"))
|
|
399
d7616118282e
build: publish a prebuild artifact
Da Risk <da_risk@geekorum.com>
parents:
398
diff
changeset
|
58 |
} |
| 0 | 59 |
} |
|
40
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
60 |
|
|
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
61 |
tasks.apply {
|
|
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
62 |
register("publishToGooglePlayStore") {
|
|
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
63 |
group = "Continuous Delivery" |
|
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
64 |
description = "Publish project to Google play store" |
|
799
c8bdc3274161
build: update gradle play publisher
Da Risk <da_risk@geekorum.com>
parents:
635
diff
changeset
|
65 |
dependsOn(named("publishApps"))
|
|
40
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
66 |
} |
|
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
67 |
|
|
54
53068a23963e
build: update Gradle Play Publisher to 2.1.0
Da Risk <da_risk@geekorum.com>
parents:
40
diff
changeset
|
68 |
// only there for consistent naming scheme |
|
40
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
69 |
register("promoteOnGooglePlayStore") {
|
|
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
70 |
group = "Continuous Delivery" |
|
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
71 |
description = "Promote project Google play store" |
|
54
53068a23963e
build: update Gradle Play Publisher to 2.1.0
Da Risk <da_risk@geekorum.com>
parents:
40
diff
changeset
|
72 |
dependsOn(named("promoteArtifact"))
|
|
40
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
73 |
} |
|
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
74 |
} |
|
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
75 |
|
| 0 | 76 |
} |