Skip to content

Commit 61a9f7a

Browse files
committed
Publish lint to artifact too
1 parent 227eee5 commit 61a9f7a

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

build.gradle.kts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ buildscript {
44
mavenCentral()
55
}
66
dependencies {
7-
classpath("com.android.tools.build:gradle:9.1.0")
7+
// Lint API version tracks AGP: AGP 9.1.1 → Lint 32.1.1
8+
// in module lint:
9+
// val lintVersion = "32.1.1"
10+
classpath("com.android.tools.build:gradle:9.1.1")
811
classpath("com.github.dcendents:android-maven-gradle-plugin:2.1")
912
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.3.20")
1013
}

chartLib/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ android {
5050
}
5151

5252
dependencies {
53-
lintChecks(project(":lint"))
53+
lintChecks(project(":lint")) // applies locally
54+
lintPublish(project(path = ":lint", configuration = "lintJar")) // embeds in published AAR
5455

5556
implementation("androidx.annotation:annotation:1.10.0")
5657
implementation("androidx.core:core:1.18.0")

lint/build.gradle.kts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ tasks.withType<KotlinCompile>().configureEach {
1616
}
1717
}
1818

19-
// Lint API version tracks AGP: AGP 9.1.0 → Lint 32.1.0
20-
val lintVersion = "32.1.0"
19+
// Lint API version tracks AGP: AGP 9.1.1 → Lint 32.1.1
20+
val lintVersion = "32.1.1"
2121

2222
dependencies {
2323
compileOnly("com.android.tools.lint:lint-api:$lintVersion")
@@ -35,3 +35,12 @@ tasks.jar {
3535
}
3636
}
3737

38+
// Expose a single-artifact configuration so library modules can use lintPublish.
39+
// lintPublish requires exactly one JAR — the default project() dependency
40+
// resolves to multiple artifacts and causes "Found more than one jar" errors.
41+
configurations {
42+
create("lintJar")
43+
}
44+
artifacts {
45+
add("lintJar", tasks.named("jar"))
46+
}

0 commit comments

Comments
 (0)