getsentry / getsentry/sentry-java

Migrate to new AGP DSL and remove android.newDsl=false opt-out

Đang mở
#5,781 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Platform: Android Platform: Java Task
Ngôn ngữ chính
Kotlin
Star
1.4k
Fork
478
Merge trung bình
2 ngày 23 giờ
Pull request đã merge (30 ngày)
67

Mô tả

Follow-up to the AGP 8.13.1 → 9.2.1 bump (getsentry/sentry-java#5777). To land AGP 9 without a large refactor, the bump added a temporary opt-out in `gradle.properties`:

```
# AGP 9+ migration opt-outs until we remove kotlin-android plugin and adopt built-in Kotlin.
android.newDsl=false
```

**Why this matters:** `android.newDsl=false` opts out of AGP 9's new DSL. If Google removes this flag in a future AGP release, we will be unable to upgrade until the migration is done.

**Current state:**

* The root `build.gradle.kts` (around lines 174-180) still configures library modules via the legacy `com.android.build.gradle.BaseExtension` inside `plugins.withId("com.android.library") { ... }`. This is what depends on the old DSL.
* Runtime modules already use the new `androidComponents` Variant API (`beforeVariants`/`onVariants`); the old `libraryVariants`/`applicationVariants`/`BaseVariant` API is not used anywhere. Good starting position.
* Fragility to address: `sentry-samples/sentry-samples-android/build.gradle.kts` imports the internal `com.android.build.api.variant.impl.VariantImpl` (a non-stable `.impl.` class), a likely future break point.

**Scope:**

* Replace the `BaseExtension`-based configuration in the root build with the new DSL.
* Remove the internal `VariantImpl` usage in the Android sample.
* Remove `android.newDsl=false` from `gradle.properties` and confirm the build passes.

**Done when:** `android.newDsl=false` is removed and the build works on the new AGP DSL.

Should be picked up after the AGP bump PRs merge.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start with the root build.gradle.kts around lines 174-180 and inspect the library-module configuration using BaseExtension. Then review sentry-samples/sentry-samples-android/build.gradle.kts for its internal VariantImpl import, remove android.newDsl=false from gradle.properties, and confirm the build passes with the new AGP DSL.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
android, kotlin
Lĩnh vực
build-system, mobile
Loại issue
Tái cấu trúc
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
55/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.