-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
102 lines (92 loc) · 3.33 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
102 lines (92 loc) · 3.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
plugins {
`maven-publish`
alias(libs.plugins.guardian.library.android)
alias(libs.plugins.guardian.compose.library)
alias(libs.plugins.metalava)
alias(libs.plugins.ksp)
}
// Generates API signature files for use in API compatibility checks, and for automatic versioning.
metalava {
javaSourceLevel.set(JavaVersion.toVersion(libs.versions.java.get()))
filename.set("api/$name-api.txt")
apiCompatAnnotations.set(listOf("androidx.compose.runtime.Composable"))
}
android {
namespace = libs.versions.group.get()
defaultConfig {
consumerProguardFiles("consumer-rules.pro")
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
}
// Create a single variant for publishing called "release". Add separate jars for javadoc
// and sources.
publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}
dependencies {
}
publishing {
publications {
register<MavenPublication>("release") {
groupId = libs.versions.group.get()
artifactId = "source-android"
version = rootProject.file(libs.versions.versionFileName.get()).readText().trim()
pom {
name.set("Source Android")
description.set("The Guardian's design system library for Android")
url.set("https://github.com/guardian/source-apps")
packaging = "aar"
licenses {
license {
name.set("Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("guardian/android-developers")
name.set("Guardian Android Team")
email.set("android@guardian.co.uk")
url.set("https://github.com/guardian/source-apps/tree/main/android")
}
}
organization {
name.set("Guardian News & Media")
url.set("https://www.theguardian.com")
}
scm {
connection.set("scm:git:github.com/guardian/source-apps.git")
developerConnection.set("scm:git:ssh://github.com/guardian/source-apps.git")
url.set("https://github.com/guardian/source-apps/tree/main")
}
}
// Use the artifacts called "release" for publishing.
afterEvaluate {
from(components["release"])
}
}
}
repositories {
// Adds a task for publishing locally to the build directory.
// Use as `./gradlew :source:publishReleasePublicationToCustomRepository`
// Use with -Prepo.local=$LOCAL_ARTIFACTS_STAGING_PATH to output to a custom path.
maven {
name = "custom"
url = uri(
(project.findProperty("repo.local") as? String)
?: "${project.layout.buildDirectory.asFile.get().path}/custom"
)
}
}
}