Skip to content

build: Apply convention plugins per module instead of the root subprojects block - #6354

Draft
markushi wants to merge 6 commits into
mainfrom
refactor/apply-plugins-per-module
Draft

markushi wants to merge 6 commits into
mainfrom
refactor/apply-plugins-per-module

Conversation

@markushi

Copy link
Copy Markdown
Member

📜 Description

Removes the root subprojects {} block: Spotless, the JDK target, Detekt and the publishing setup are now applied per module via convention plugins in build-logic (io.sentry.detekt, io.sentry.publish, io.sentry.publish.multiplatform). As a side effect the four integration-test modules and the empty container projects stop publishing and building distributions, which they only ever did because the old exclusion test matched on project.name rather than the path.

💡 Motivation and Context

First step towards Isolated Projects, which forbids cross-project configuration.

💚 How did you test it?

Built the distribution zips for 12 modules covering each archetype (plain JVM, Spring, BOM, Android library, umbrella, KMP, shadow agent) before and after, and compared zip contents, POMs and Gradle module metadata. The only difference is a byte-identical duplicate sources.jar entry disappearing from sourcesElements in the plain-JVM modules. spotlessCheck, apiCheck (no .api file changed), detekt and unit tests pass.

📝 Checklist

  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Follow-up PRs for the remaining cross-project access: allprojects {}, buildForCodeQL, apiValidation.ignoredProjects, the subprojects {} in io.sentry.javadoc.aggregate, and sentry-bom's evaluationDependsOn walk.

#skip-changelog

@sentry

sentry Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.61.1 (1) release

⚙️ sentry-android Build Distribution Settings

Comment on lines +1 to +17
/*
* Adapted from https://github.com/androidx/androidx/blob/c799cba927a71f01ea6b421a8f83c181682633fb/buildSrc/private/src/main/kotlin/androidx/build/MavenUploadHelper.kt#L524-L549
*
* Copyright 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Missing THIRD_PARTY_NOTICES.md entry

build-logic/src/main/kotlin/io/sentry/gradle/AarTypes.kt — This file is adapted from AndroidX MavenUploadHelper (Apache 2.0, Copyright 2018 The Android Open Source Project) and has a complete attribution header, but there is no matching entry in THIRD_PARTY_NOTICES.md. Add an entry with Source URL, License name, Copyright, Scope, and full license text.

Evidence
  • File header lines 1–17 state Adapted from androidx MavenUploadHelper, Copyright 2018 The Android Open Source Project, and Apache License 2.0 with source URL.
  • Grep of THIRD_PARTY_NOTICES.md for AarTypes, MavenUploadHelper, and the androidx MavenUploadHelper path returns no matching entry.
  • Existing AOSP NOTICES entries cover Base64, Thread Dump Parsing, and Jetpack Compose UI only — not this Maven POM aar-type helper.
  • assignAarTypes() is live code called from SentryPublishPlugin.kt.

Identified by Warden · check-code-attribution · JAJ-FF6

Comment thread build.gradle.kts
}
}

subprojects {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im crying right now because this is so beautiful

@runningcode

Copy link
Copy Markdown
Contributor

there's a IP compatible way to apply a plugin to all subprojects. see this doc: https://docs.gradle.org/current/userguide/isolated_projects.html#sec:applying_plugins_from_a_lifecycle_callback

Resolve plugins {} conflict in sentry-samples-spring-boot-4/build.gradle.kts:
keep io.sentry.spotless and io.sentry.jdk-target from this branch, drop
io.sentry.systemtest as removed on main (#6298).
Resolve spring sample plugin conflict after main removed io.sentry.systemtest; retain convention plugins added by this branch.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants