|
10
|
1 |
/*
|
|
|
2 |
* Geekdroid is a utility library for development on the Android
|
|
|
3 |
* Platform.
|
|
|
4 |
*
|
|
37
|
5 |
* Copyright (C) 2017-2023 by Frederic-Charles Barthelery.
|
|
10
|
6 |
*
|
|
|
7 |
* This file is part of Geekdroid.
|
|
|
8 |
*
|
|
|
9 |
* Geekdroid is free software: you can redistribute it and/or modify
|
|
|
10 |
* it under the terms of the GNU General Public License as published by
|
|
|
11 |
* the Free Software Foundation, either version 3 of the License, or
|
|
|
12 |
* (at your option) any later version.
|
|
|
13 |
*
|
|
|
14 |
* Geekdroid is distributed in the hope that it will be useful,
|
|
|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
17 |
* GNU General Public License for more details.
|
|
|
18 |
*
|
|
|
19 |
* You should have received a copy of the GNU General Public License
|
|
|
20 |
* along with Geekdroid. If not, see <http://www.gnu.org/licenses/>.
|
|
|
21 |
*/
|
|
1
|
22 |
package com.geekorum.build
|
|
|
23 |
|
|
19
|
24 |
import com.android.build.api.dsl.*
|
|
1
|
25 |
import org.gradle.api.Project
|
|
|
26 |
|
|
55
|
27 |
private typealias AppExtensionWithSigning = CommonExtension<*, ApplicationBuildType, *, *, *>
|
|
|
28 |
private typealias LibExtensionWithSigning = CommonExtension<*, LibraryBuildType, *, *, *>
|
|
|
29 |
private typealias TestExtensionWithSigning = CommonExtension<*, TestBuildType, *, *, *>
|
|
19
|
30 |
|
|
|
31 |
// TODO This implicitly supports only the AppPlugin
|
|
|
32 |
// should we support other android plugins: LibraryPlugin TestPlugin ?
|
|
1
|
33 |
internal fun Project.configureReleaseSigningConfig() {
|
|
|
34 |
val releaseStoreFile = findProperty("RELEASE_STORE_FILE") as? String ?: ""
|
|
|
35 |
val releaseStorePassword = findProperty("RELEASE_STORE_PASSWORD") as? String ?: ""
|
|
|
36 |
val releaseKeyAlias= findProperty("RELEASE_KEY_ALIAS") as? String ?: ""
|
|
|
37 |
val releaseKeyPassword= findProperty("RELEASE_KEY_PASSWORD") as? String ?: ""
|
|
|
38 |
|
|
19
|
39 |
extensions.configure<AppExtensionWithSigning>("android") {
|
|
1
|
40 |
signingConfigs {
|
|
|
41 |
register("release") {
|
|
|
42 |
storeFile = file(releaseStoreFile)
|
|
|
43 |
storePassword = releaseStorePassword
|
|
|
44 |
keyAlias = releaseKeyAlias
|
|
|
45 |
keyPassword = releaseKeyPassword
|
|
|
46 |
}
|
|
|
47 |
}
|
|
|
48 |
|
|
|
49 |
buildTypes {
|
|
|
50 |
named("release") {
|
|
|
51 |
signingConfig = signingConfigs.getByName("release")
|
|
|
52 |
}
|
|
|
53 |
}
|
|
|
54 |
}
|
|
|
55 |
}
|
|
|
56 |
|