|
1 | | -@file:Suppress("HasPlatformType") |
2 | | - |
| 1 | +import org.gradle.api.Project |
3 | 2 | import java.io.File |
4 | 3 | import java.util.Properties |
5 | 4 |
|
6 | | -private val properties = Properties().apply { File("gradle.properties").inputStream().use { load(it) } } |
7 | | - |
8 | 5 | // Versions |
9 | | -val androidToolsBuildVersion = properties.getProperty("androidToolsBuildVersion") |
10 | | -val androidxActivityVersion = properties.getProperty("androidxActivityVersion") |
11 | | -val androidxAppcompatVersion = properties.getProperty("androidxAppcompatVersion") |
12 | | -val androidxConstraintLayoutVersion = properties.getProperty("androidxConstraintLayoutVersion") |
13 | | -val androidxCoreVersion = properties.getProperty("androidxCoreVersion") |
14 | | -val androidxDynamicAnimationVersion = properties.getProperty("androidxDynamicAnimationVersion") |
15 | | -val androidxEspressoVersion = properties.getProperty("androidxEspressoVersion") |
16 | | -val androidxJunitVersion = properties.getProperty("androidxJunitVersion") |
17 | | -val androidxLifecycleVersion = properties.getProperty("androidxLifecycleVersion") |
18 | | -val androidxRecyclerviewVersion = properties.getProperty("androidxRecyclerviewVersion") |
19 | | -val arrowVersion = properties.getProperty("arrowVersion") |
20 | | -val coroutinesVersion = properties.getProperty("coroutinesVersion") |
21 | | -val junitVersion = properties.getProperty("junitVersion") |
22 | | -val kotlinComposeVersion = properties.getProperty("kotlinComposeVersion") |
23 | | -val kotlinVersion = properties.getProperty("kotlinVersion") |
24 | | -val moshiVersion = properties.getProperty("moshiVersion") |
25 | | -val okhttpVersion = properties.getProperty("okhttpVersion") |
26 | | -val retrofitVersion = properties.getProperty("retrofitVersion") |
| 6 | +val Project.androidToolsBuildVersion: String get() = props.getProperty("androidToolsBuildVersion") |
| 7 | +val Project.androidxActivityVersion: String get() = props.getProperty("androidxActivityVersion") |
| 8 | +val Project.androidxAppcompatVersion: String get() = props.getProperty("androidxAppcompatVersion") |
| 9 | +val Project.androidxConstraintLayoutVersion: String get() = props.getProperty("androidxConstraintLayoutVersion") |
| 10 | +val Project.androidxCoreVersion: String get() = props.getProperty("androidxCoreVersion") |
| 11 | +val Project.androidxDynamicAnimationVersion: String get() = props.getProperty("androidxDynamicAnimationVersion") |
| 12 | +val Project.androidxEspressoVersion: String get() = props.getProperty("androidxEspressoVersion") |
| 13 | +val Project.androidxJunitVersion: String get() = props.getProperty("androidxJunitVersion") |
| 14 | +val Project.androidxLifecycleVersion: String get() = props.getProperty("androidxLifecycleVersion") |
| 15 | +val Project.androidxRecyclerviewVersion: String get() = props.getProperty("androidxRecyclerviewVersion") |
| 16 | +val Project.arrowVersion: String get() = props.getProperty("arrowVersion") |
| 17 | +val Project.coroutinesVersion: String get() = props.getProperty("coroutinesVersion") |
| 18 | +val Project.junitVersion: String get() = props.getProperty("junitVersion") |
| 19 | +val Project.kotlinComposeVersion: String get() = props.getProperty("kotlinComposeVersion") |
| 20 | +val Project.kotlinVersion: String get() = props.getProperty("kotlinVersion") |
| 21 | +val Project.moshiVersion: String get() = props.getProperty("moshiVersion") |
| 22 | +val Project.okhttpVersion: String get() = props.getProperty("okhttpVersion") |
| 23 | +val Project.retrofitVersion: String get() = props.getProperty("retrofitVersion") |
27 | 24 |
|
28 | 25 | // Android |
29 | | -val androidCompileSdkVersion = properties.getProperty("androidCompileSdkVersion").toInt() |
30 | | -val androidMinSdkVersion = properties.getProperty("androidMinSdkVersion").toInt() |
31 | | -val androidTargetSdkVersion = properties.getProperty("androidTargetSdkVersion").toInt() |
| 26 | +val Project.androidCompileSdkVersion: Int get() = props.getProperty("androidCompileSdkVersion").toInt() |
| 27 | +val Project.androidMinSdkVersion: Int get() = props.getProperty("androidMinSdkVersion").toInt() |
| 28 | +val Project.androidTargetSdkVersion: Int get() = props.getProperty("androidTargetSdkVersion").toInt() |
| 29 | + |
| 30 | +private val Project.props: Properties |
| 31 | + get() = Properties().apply { File(rootDir, "gradle.properties").inputStream().use { load(it) } } |
0 commit comments