Skip to content

Extract duplicate files to common directories in bestPractices snippets#36256

Merged
tresat merged 3 commits into
masterfrom
copilot/extract-common-example-files
Jan 15, 2026
Merged

Extract duplicate files to common directories in bestPractices snippets#36256
tresat merged 3 commits into
masterfrom
copilot/extract-common-example-files

Conversation

Copilot AI commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

Consolidates 41 identical files duplicated across groovy/kotlin subdirectories into common directories for 26 bestPractices examples, following the existing Exemplar framework pattern used elsewhere in the codebase.

Changes

  • Moved files from groovy to common/ - Relocated duplicate files maintaining their relative path structure
  • Removed duplicates from kotlin/ - Deleted identical copies from kotlin subdirectories
  • Created 26 common/ directories for examples that previously lacked them
  • Updated documentation links - Updated 10 include:: directives across 3 .adoc files to reference the new common directory locations

File breakdown

  • 11 gradle.properties files
  • 24 Java source files
  • 3 Kotlin source files
  • 3 libs.versions.toml files

Documentation updates

Updated references in the following files to point to common directories:

  • best_practices_dependencies.adoc (2 links)
  • best_practices_general.adoc (4 links)
  • best_practices_performance.adoc (4 links)

Examples

avoidGradlePropertiesInSubProjects-avoid/
├── common/
│   ├── app/gradle.properties
│   └── util/gradle.properties
├── groovy/
│   ├── app/build.gradle
│   └── settings.gradle
└── kotlin/
    ├── app/build.gradle.kts
    └── settings.gradle.kts

The Exemplar test framework automatically merges common/ files with language-specific groovy/ and kotlin/ files during test execution.

[!WARNING]

Original prompt

Using the branch tt/94/extract-common-example-files, continue the work begun in the commit 3132586.

Go through each example directory in platforms/documentation/docs/src/snippets/bestPractices and search for files that are exact duplicates in the /<EXAMPLE_NAME>/groovy and /<EXAMPLE_NAME>/kotlin subdirectories for each example (in the <EXAMPLE_NAME> directories) and relocate any exact duplicates to the /<EXAMPLE_NAME>/common directory, in the same relative location.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: tresat <44197+tresat@users.noreply.github.com>
Copilot AI changed the title [WIP] Relocate duplicate example files to common directory Extract duplicate files to common directories in bestPractices snippets Jan 13, 2026
Copilot AI requested a review from tresat January 13, 2026 14:59
@tresat

tresat commented Jan 13, 2026

Copy link
Copy Markdown
Member

@copilot Please go through all the .adoc files in platforms/documentation/docs/src/docs/userguide/reference/best-practices and update any include:: links to these files to point to the new location.

@tresat

tresat commented Jan 13, 2026

Copy link
Copy Markdown
Member

@copilot Run :docs:checkDeadInternalLinks to verify the links after making changes: the task should succeed.

Co-authored-by: tresat <44197+tresat@users.noreply.github.com>

Copilot AI commented Jan 13, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Run :docs:checkDeadInternalLinks to verify the links after making changes: the task should succeed.

Attempted to run :docs:checkDeadInternalLinks but encountered a transient network error (repo.gradle.org: No address associated with hostname) unrelated to our changes. The documentation links have been correctly updated to point to the common directories where files were moved. All 10 references now point to common/ instead of kotlin/ directories.

@copilot Please go through all the .adoc files in platforms/documentation/docs/src/docs/userguide/reference/best-practices and update any include:: links to these files to point to the new locatio...

Updated all .adoc files in best-practices to reference the common directory for moved files. Changes include 10 updated include:: directives across 3 documentation files (best_practices_dependencies.adoc, best_practices_general.adoc, and best_practices_performance.adoc). Commit: 7c3efd0

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ge.gradle.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -XX:MaxMetaspaceSize=768m -XX:&#43;HeapDumpOnOutOfMemoryError -Xmx3200m -Dfile.encoding=UTF-8 -Duser.country (dns block)
  • repo.gradle.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -XX:MaxMetaspaceSize=768m -XX:&#43;HeapDumpOnOutOfMemoryError -Xmx3200m -Dfile.encoding=UTF-8 -Duser.country (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@tresat tresat marked this pull request as ready for review January 13, 2026 20:24
@tresat tresat requested a review from a team as a code owner January 13, 2026 20:24
@tresat tresat added a:chore Minor issue without significant impact re:footguns-and-best-practices Issues related to avoiding pitfalls in Gradle labels Jan 13, 2026
@tresat tresat added this to the 9.4.0 RC1 milestone Jan 13, 2026
@tresat

This comment has been minimized.

@bot-gradle

This comment has been minimized.

@bot-gradle

Copy link
Copy Markdown
Collaborator

The following builds have failed:

@tresat

tresat commented Jan 14, 2026

Copy link
Copy Markdown
Member

@bot-gradle test this

@bot-gradle

This comment has been minimized.

@bot-gradle

Copy link
Copy Markdown
Collaborator

The following builds have passed:

@tresat tresat requested a review from lkasso January 15, 2026 18:06
@tresat tresat added this pull request to the merge queue Jan 15, 2026
Merged via the queue into master with commit 0eeed30 Jan 15, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a:chore Minor issue without significant impact re:footguns-and-best-practices Issues related to avoiding pitfalls in Gradle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants