Enhancement: scan Gradle `plugins { id "…" version "…" }` declarations

未关闭
#725 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
java, typescript

调研方向

Start with parseGradleBuild in src/core-open/scanners/java-scanner.ts and the Gradle fixtures under test/fixtures/gradle-android-app; check the existing dependency row shape and tests. Add coverage for Groovy and Kotlin DSL plugin pins, apply false, settings plugin management, and unversioned plugins, then update the Gradle mapping table in DOCS.md. Done means plugin pins appear as development/build rows with marker coordinates and declared versions, unversioned plugins gain no invented coordinate, and ordinary implementation rows remain unchanged; buildscript.classpath may be left out of scope.

由索引模型根据 Issue 内容生成。

描述

enhancement help wanted
  • Difficulty: medium
  • Area: Java / Gradle
Problem

parseGradleBuild in src/core-open/scanners/java-scanner.ts (around lines 546–618) reads dependencies { }, platform(), version-catalog aliases, and toolchain / compatibility versions. It does not read the plugins { } block, buildscript { dependencies { classpath … } }, or settings.gradle / settings.gradle.kts pluginManagement { plugins { } }.

These declarations are real build dependencies and are often the only pin for the Android / Kotlin / Spring plugin:

// build.gradle.kts
plugins {
    id("org.jetbrains.kotlin.jvm") version "1.9.24"
    id("com.android.application") version "8.5.2" apply false
}
plugins {
    id 'org.springframework.boot' version '3.3.0'
}

A scan of test/fixtures/gradle-android-app/app/build.gradle.kts would already show id("com.android.application") with no version on the app project (the version often lives in the root plugins or pluginManagement block). Those pins never become Maven coordinates today.

Expected behaviour

Read plugins { id("…") version "…" } / id '…' version '…' from build.gradle and build.gradle.kts, and from settings.gradle / settings.gradle.kts pluginManagement { plugins { } } when that file is in the project or scan root. Map a plugin id to the plugin-portal marker artifact id:id.gradle.plugin (for example org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin). Record them as development / build rows (they are not production application dependencies), with the declared version as currentSpec. apply false still records the pin. Plugins with no version (applied from a parent or a version catalog alias) should reuse the existing version-catalog work when the alias is already resolvable; otherwise leave them unversioned and out of mavenCoordinateReady-style rows rather than inventing a version. buildscript.classpath can be a follow-up; mention it as out of scope if you skip it.

Acceptance
  • Tests include Groovy and Kotlin DSL, apply false, a settings.gradle pluginManagement pin, and a plugin id with no version (no invented coordinate).
  • id("org.jetbrains.kotlin.jvm") version "1.9.24" appears as org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin at 1.9.24, in a non-production section.
  • Ordinary implementation 'g:a:v' rows are unchanged.
  • DOCS.md gets a short row in the Gradle mapping table.

主要语言
TypeScript
星标
4
派生
3
平均合并
1 天 22 小时
30 天内合并 PR
76

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

vibgrate/cli 的其他 Issue

查看 vibgrate/cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。