| author | Da Risk <da_risk@geekorum.com> |
| Sat, 06 May 2023 19:27:48 -0400 | |
| changeset 44 | 275cbb10a516 |
| parent 39 | 0559eab9f132 |
| child 45 | e8e44d416387 |
| permissions | -rw-r--r-- |
|
6
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
1 |
/* |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
2 |
* Geekdroid is a utility library for development on the Android |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
3 |
* Platform. |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
4 |
* |
| 37 | 5 |
* Copyright (C) 2017-2023 by Frederic-Charles Barthelery. |
|
6
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
6 |
* |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
7 |
* This file is part of Geekdroid. |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
8 |
* |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
9 |
* Geekdroid is free software: you can redistribute it and/or modify |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
10 |
* it under the terms of the GNU General Public License as published by |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
11 |
* the Free Software Foundation, either version 3 of the License, or |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
12 |
* (at your option) any later version. |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
13 |
* |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
14 |
* Geekdroid is distributed in the hope that it will be useful, |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
17 |
* GNU General Public License for more details. |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
18 |
* |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
19 |
* You should have received a copy of the GNU General Public License |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
20 |
* along with Geekdroid. If not, see <http://www.gnu.org/licenses/>. |
|
99ad8c14fec2
Add missing source license headers
Da Risk <da_risk@geekorum.com>
parents:
3
diff
changeset
|
21 |
*/ |
|
33
6291c6dab84b
geekdroid: remove dagger-platform from generated pom
Da Risk <da_risk@geekorum.com>
parents:
32
diff
changeset
|
22 |
import groovy.util.Node |
|
6291c6dab84b
geekdroid: remove dagger-platform from generated pom
Da Risk <da_risk@geekorum.com>
parents:
32
diff
changeset
|
23 |
import groovy.util.NodeList |
| 1 | 24 |
|
25 |
plugins {
|
|
26 |
id("com.android.library")
|
|
27 |
kotlin("android")
|
|
28 |
kotlin("kapt")
|
|
29 |
id("com.geekorum.build.android-tests")
|
|
30 |
id("com.geekorum.build.android-avdl")
|
|
| 2 | 31 |
`maven-publish` |
| 1 | 32 |
} |
33 |
||
34 |
||
35 |
android {
|
|
| 17 | 36 |
val compileSdkInt: Int by rootProject.extra |
37 |
compileSdk = compileSdkInt |
|
| 19 | 38 |
namespace = "com.geekorum.geekdroid" |
| 1 | 39 |
|
40 |
defaultConfig {
|
|
| 17 | 41 |
minSdk = 24 |
| 1 | 42 |
} |
| 44 | 43 |
compileOptions {
|
44 |
sourceCompatibility(JavaVersion.VERSION_11) |
|
45 |
targetCompatibility(JavaVersion.VERSION_11) |
|
46 |
} |
|
| 1 | 47 |
|
48 |
buildTypes {
|
|
49 |
getByName("release") {
|
|
50 |
isMinifyEnabled = false |
|
51 |
proguardFiles(getDefaultProguardFile("proguard-android.txt"),
|
|
52 |
"proguard-rules.pro") |
|
53 |
} |
|
54 |
} |
|
55 |
||
| 17 | 56 |
lint {
|
| 19 | 57 |
abortOnError = false |
| 1 | 58 |
} |
59 |
||
60 |
dataBinding {
|
|
| 19 | 61 |
enable = true |
| 1 | 62 |
} |
63 |
||
|
32
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
64 |
publishing {
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
65 |
singleVariant("release") {
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
66 |
withSourcesJar() |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
67 |
} |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
68 |
singleVariant("debug") {
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
69 |
withSourcesJar() |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
70 |
} |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
71 |
} |
| 1 | 72 |
} |
73 |
||
| 44 | 74 |
kotlin {
|
75 |
jvmToolchain(11) |
|
76 |
} |
|
77 |
||
| 1 | 78 |
dependencies {
|
| 22 | 79 |
implementation("androidx.recyclerview:recyclerview:1.2.1")
|
| 39 | 80 |
implementation("androidx.appcompat:appcompat:1.6.1")
|
81 |
implementation("com.google.android.material:material:1.8.0")
|
|
| 22 | 82 |
api("androidx.constraintlayout:constraintlayout:2.1.4")
|
83 |
implementation("androidx.coordinatorlayout:coordinatorlayout:1.2.0")
|
|
| 39 | 84 |
implementation("androidx.annotation:annotation:1.6.0")
|
| 22 | 85 |
implementation("androidx.preference:preference:1.2.0")
|
86 |
implementation("androidx.core:core-ktx:1.9.0")
|
|
| 39 | 87 |
implementation("androidx.fragment:fragment-ktx:1.5.5")
|
| 1 | 88 |
|
| 22 | 89 |
implementation("com.squareup.okhttp3:okhttp:4.10.0")
|
| 1 | 90 |
|
| 39 | 91 |
val daggerVersion = "2.45" |
|
32
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
92 |
implementation(daggerPlatform(daggerVersion)) |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
93 |
kapt(daggerPlatform(daggerVersion)) |
| 1 | 94 |
implementation("com.google.dagger:dagger:$daggerVersion")
|
95 |
kapt("com.google.dagger:dagger-compiler:$daggerVersion")
|
|
96 |
||
|
32
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
97 |
implementation(platform(kotlin("bom")))
|
| 1 | 98 |
implementation(kotlin("stdlib-jdk8"))
|
99 |
||
|
32
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
100 |
implementation(platform("org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.4"))
|
| 1 | 101 |
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core")
|
102 |
||
| 22 | 103 |
implementation("androidx.lifecycle:lifecycle-livedata-core-ktx:2.5.1")
|
104 |
implementation("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1")
|
|
| 39 | 105 |
testImplementation("androidx.arch.core:core-testing:2.2.0")
|
| 1 | 106 |
|
| 39 | 107 |
implementation("androidx.room:room-runtime:2.5.0")
|
108 |
implementation("androidx.browser:browser:1.5.0")
|
|
109 |
implementation("androidx.work:work-runtime:2.8.0")
|
|
| 22 | 110 |
implementation("androidx.navigation:navigation-common-ktx:2.5.3")
|
111 |
implementation("androidx.navigation:navigation-fragment:2.5.3")
|
|
| 1 | 112 |
} |
113 |
||
114 |
||
115 |
apply {
|
|
116 |
from("$projectDir/../config/source-archive.gradle")
|
|
117 |
} |
|
|
32
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
118 |
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
119 |
publishing {
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
120 |
publications {
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
121 |
val pomConfiguration: (MavenPom).() -> Unit = {
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
122 |
name.set("Geekdroid")
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
123 |
description.set("An Android library used in various Android projects. ")
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
124 |
licenses {
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
125 |
license {
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
126 |
name.set("GPL-3.0-or-later")
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
127 |
url.set("https://www.gnu.org/licenses/gpl-3.0.html")
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
128 |
distribution.set("repo")
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
129 |
} |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
130 |
} |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
131 |
inceptionYear.set("2017")
|
|
33
6291c6dab84b
geekdroid: remove dagger-platform from generated pom
Da Risk <da_risk@geekorum.com>
parents:
32
diff
changeset
|
132 |
|
|
6291c6dab84b
geekdroid: remove dagger-platform from generated pom
Da Risk <da_risk@geekorum.com>
parents:
32
diff
changeset
|
133 |
// exclude dagger-platform |
|
6291c6dab84b
geekdroid: remove dagger-platform from generated pom
Da Risk <da_risk@geekorum.com>
parents:
32
diff
changeset
|
134 |
withXml {
|
|
6291c6dab84b
geekdroid: remove dagger-platform from generated pom
Da Risk <da_risk@geekorum.com>
parents:
32
diff
changeset
|
135 |
val dependencyManagement = asNode().get("dependencyManagement") as NodeList
|
|
6291c6dab84b
geekdroid: remove dagger-platform from generated pom
Da Risk <da_risk@geekorum.com>
parents:
32
diff
changeset
|
136 |
val dependencies = dependencyManagement.getAt("dependencies") as NodeList
|
|
6291c6dab84b
geekdroid: remove dagger-platform from generated pom
Da Risk <da_risk@geekorum.com>
parents:
32
diff
changeset
|
137 |
dependencies.getAt("dependency")
|
|
6291c6dab84b
geekdroid: remove dagger-platform from generated pom
Da Risk <da_risk@geekorum.com>
parents:
32
diff
changeset
|
138 |
.forEach {
|
|
6291c6dab84b
geekdroid: remove dagger-platform from generated pom
Da Risk <da_risk@geekorum.com>
parents:
32
diff
changeset
|
139 |
val node = it as Node |
|
6291c6dab84b
geekdroid: remove dagger-platform from generated pom
Da Risk <da_risk@geekorum.com>
parents:
32
diff
changeset
|
140 |
val artifactId = (node.get("artifactId") as NodeList).single() as Node
|
|
6291c6dab84b
geekdroid: remove dagger-platform from generated pom
Da Risk <da_risk@geekorum.com>
parents:
32
diff
changeset
|
141 |
val artifactIdTxt = (artifactId.value() as NodeList).single() |
|
6291c6dab84b
geekdroid: remove dagger-platform from generated pom
Da Risk <da_risk@geekorum.com>
parents:
32
diff
changeset
|
142 |
if (artifactIdTxt == "dagger-platform") {
|
|
6291c6dab84b
geekdroid: remove dagger-platform from generated pom
Da Risk <da_risk@geekorum.com>
parents:
32
diff
changeset
|
143 |
node.parent().remove(node) |
|
6291c6dab84b
geekdroid: remove dagger-platform from generated pom
Da Risk <da_risk@geekorum.com>
parents:
32
diff
changeset
|
144 |
} |
|
6291c6dab84b
geekdroid: remove dagger-platform from generated pom
Da Risk <da_risk@geekorum.com>
parents:
32
diff
changeset
|
145 |
} |
|
6291c6dab84b
geekdroid: remove dagger-platform from generated pom
Da Risk <da_risk@geekorum.com>
parents:
32
diff
changeset
|
146 |
} |
|
32
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
147 |
} |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
148 |
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
149 |
register<MavenPublication>("release") {
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
150 |
afterEvaluate {
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
151 |
from(components["release"]) |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
152 |
} |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
153 |
artifactId = "geekdroid" |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
154 |
pom(pomConfiguration) |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
155 |
} |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
156 |
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
157 |
register<MavenPublication>("debugSnapshot") {
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
158 |
afterEvaluate {
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
159 |
from(components["debug"]) |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
160 |
} |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
161 |
artifactId = "geekdroid" |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
162 |
version = "$version-SNAPSHOT" |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
163 |
pom(pomConfiguration) |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
164 |
|
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
165 |
} |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
166 |
} |
|
f165a9538ee3
build: improve maven publication
Da Risk <da_risk@geekorum.com>
parents:
26
diff
changeset
|
167 |
} |