@@ -111,15 +111,6 @@ subprojects {
111111 }
112112 }
113113
114- // Skip samples parent
115- if (project.buildFile.exists() && project.name != " okhttp" ) {
116- apply (plugin = " com.android.lint" )
117-
118- dependencies {
119- " lintChecks" (rootProject.libs.androidx.lint.gradle)
120- }
121- }
122-
123114 tasks.withType<JavaCompile > {
124115 options.encoding = Charsets .UTF_8 .toString()
125116 }
@@ -309,7 +300,7 @@ subprojects {
309300
310301/* * Configure publishing and signing for published Java and JavaPlatform subprojects. */
311302subprojects {
312- plugins.withId (" com.vanniktech.maven.publish.base" ) {
303+ if ( plugins.hasPlugin (" com.vanniktech.maven.publish.base" ) ) {
313304 if (dokkaBuild) {
314305 apply (plugin = " org.jetbrains.dokka" )
315306
@@ -329,7 +320,7 @@ subprojects {
329320 url.set(URI .create(" https://square.github.io/okio/3.x/okio/" ))
330321 packageListUrl.set(URI .create(" https://square.github.io/okio/3.x/okio/okio/package-list" ))
331322 }
332-
323+
333324 externalDocumentationLinks.named(" jdk" ) {
334325 url.set(URI .create(" https://docs.oracle.com/en/java/javase/21/docs/api/" ))
335326 packageListUrl.set(URI .create(" https://docs.oracle.com/en/java/javase/21/docs/api/element-list" ))
@@ -342,6 +333,15 @@ subprojects {
342333 }
343334 }
344335
336+ // Only enable lint checks for published modules
337+ if (project.name != " okhttp" ) {
338+ apply (plugin = " com.android.lint" )
339+
340+ dependencies {
341+ " lintChecks" (rootProject.libs.androidx.lint.gradle)
342+ }
343+ }
344+
345345 configure<MavenPublishBaseExtension > {
346346 publishToMavenCentral(automaticRelease = true )
347347 signAllPublications()
0 commit comments