| author | Da Risk <da_risk@geekorum.com> |
| Mon, 16 Jan 2023 17:05:31 -0400 | |
| changeset 943 | 298742859784 |
| parent 882 | 7a74abf66c49 |
| child 944 | f542381c10d3 |
| permissions | -rw-r--r-- |
|
137
5464f07a306c
Update copyright headers for 2019
Da Risk <da_risk@geekorum.com>
parents:
101
diff
changeset
|
1 |
/* |
|
101
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
2 |
* Geekttrss is a RSS feed reader application on the Android Platform. |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
3 |
* |
|
943
298742859784
build: update license headers
Da Risk <da_risk@geekorum.com>
parents:
882
diff
changeset
|
4 |
* Copyright (C) 2017-2023 by Frederic-Charles Barthelery. |
|
101
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
5 |
* |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
6 |
* This file is part of Geekttrss. |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
7 |
* |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
8 |
* Geekttrss is free software: you can redistribute it and/or modify |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
9 |
* it under the terms of the GNU General Public License as published by |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
10 |
* the Free Software Foundation, either version 3 of the License, or |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
11 |
* (at your option) any later version. |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
12 |
* |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
13 |
* Geekttrss is distributed in the hope that it will be useful, |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
16 |
* GNU General Public License for more details. |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
17 |
* |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
18 |
* You should have received a copy of the GNU General Public License |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
19 |
* along with Geekttrss. If not, see <http://www.gnu.org/licenses/>. |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
20 |
*/ |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
21 |
package com.geekorum.build |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
22 |
|
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
23 |
import com.android.build.gradle.BaseExtension |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
24 |
import org.gradle.api.JavaVersion |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
25 |
import org.gradle.api.Project |
|
599
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
26 |
import org.gradle.api.artifacts.dsl.DependencyHandler |
|
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
27 |
import org.gradle.kotlin.dsl.dependencies |
|
101
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
28 |
|
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
29 |
/** |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
30 |
* Configure java version compile options based on minSdkVersion value |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
31 |
*/ |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
32 |
fun BaseExtension.configureJavaVersion() {
|
| 765 | 33 |
val api = defaultConfig.minSdkVersion?.apiLevel ?: 1 |
|
101
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
34 |
val version = when {
|
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
35 |
api >= 24 -> JavaVersion.VERSION_1_8 |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
36 |
api >= 19 -> JavaVersion.VERSION_1_7 |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
37 |
else -> JavaVersion.VERSION_1_6 |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
38 |
} |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
39 |
compileOptions {
|
|
599
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
40 |
sourceCompatibility = version |
|
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
41 |
targetCompatibility = version |
|
101
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
42 |
} |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
43 |
} |
|
599
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
44 |
|
|
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
45 |
/** |
|
670
1e81fe121832
Use geekdroid from jitpack instead of prebuilt library
Da Risk <da_risk@geekorum.com>
parents:
611
diff
changeset
|
46 |
* Add missing annotation processor dependencies to build on Java 11 |
|
599
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
47 |
*/ |
|
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
48 |
fun Project.configureAnnotationProcessorDeps() {
|
|
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
49 |
dependencies {
|
|
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
50 |
configurations.whenObjectAdded {
|
|
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
51 |
when (name) {
|
|
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
52 |
"kapt" -> {
|
|
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
53 |
add(name,"javax.xml.bind:jaxb-api:2.3.1") |
|
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
54 |
add(name, "com.sun.xml.bind:jaxb-core:2.3.0.1") |
|
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
55 |
add(name, "com.sun.xml.bind:jaxb-impl:2.3.2") |
|
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
56 |
} |
|
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
57 |
"annotationProcessor" -> add(name, "javax.xml.bind:jaxb-api:2.3.1") |
|
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
58 |
} |
|
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
59 |
} |
|
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
60 |
} |
|
235be2a04607
build: configure annotation processor deps to build on java 11
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
61 |
} |