Gradle tab (tasks, dependencies, sync gradle project, download sources)#115
Merged
DaRealTurtyWurty merged 10 commits intoRailroad-Team:devfrom Dec 20, 2025
Merged
Conversation
Introduces new Gradle UI classes for project and task context menus, task tree builder, and tasks pane. Refactors RRButton to use a support class for shared logic and adds LocalizedTab for localized JavaFX tabs. GradleSettings is converted from a record to a class with getters/setters, and related usages are updated. GradleModelMapper and GradleTaskModel are updated to associate tasks with their project, improving model mapping and equality checks. GradleManager now supports saving Gradle settings. Various improvements and new features for Gradle integration and UI localization.
Introduces a new 'Download Sources' button in the Gradle tool window, which triggers a bundled init script to download sources for all Gradle projects using the updated download-sources plugin (v1.0.1). Implements supporting logic in GradleManager and adds the required init script resource.
GradleTaskContextMenu now checks for an existing run configuration before creating a new one, preventing duplicate configurations for the same Gradle task. Added a helper to set the selected run configuration in RunConfigurationManager. GradleTasksPane updated to use the new logic.
Replaces GradleTasksPane and related classes with a generic GradleTreeViewPane and GradleTreeBuilder interface, enabling both task and dependency tree views. Adds support for displaying Gradle dependency configurations and their trees in the UI, updates model mapping to include dependency data, and refactors context menus and resource keys for consistency. Removes obsolete task tree classes and updates styles and resource references accordingly.
Deleted dev.railroadide.fabricExtractorPlugin.properties and dev.railroadide.javaVersionExtractorPlugin.properties from META-INF/gradle-plugins
Replaces custom Gradle model and task classes with DTOs from railroad-gradle-plugin. Removes obsolete mapping and argument classes, updates UI and service layers to use new types, and simplifies model loading logic. Also updates build.gradle to depend on the unified plugin and removes unused init scripts. This is a WIP.
Refactored GradleManager to detect Gradle projects and extract Gradle version directly from gradle-wrapper.properties. Updated GradleFacetDetector to simplify facet data and rely on GradleManager for detection. Improved Gradle model loading by injecting an init script for plugin application in ToolingGradleModelService. Enhanced GradleTasksPane and GradleDependenciesPane to extract data from the cached model. Added error logging for model reload failures. Moved Gradle tab opening logic into a reusable method in IDESetup. Added the init-gradle-plugin.gradle script to resources.
Updated Gradle plugin usage to 'RailroadGradlePlugin:1.0.0' and refactored init scripts for improved plugin application. Enhanced dependency tree builder to group configurations by module and display module nodes. Improved model service to handle missing models gracefully. Minor code cleanups and bug fixes in JavaFacetDetector, GradleTasksPane, and JDK class.
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request modernizes the Gradle integration by replacing legacy task modeling with a new DTO-based architecture using RailroadGradlePlugin. The changes consolidate Gradle model extraction into a single plugin, remove three separate init scripts, and introduce a comprehensive Gradle tools UI with task and dependency visualization.
- Replaced legacy
GradleTaskModel,GradleTaskArgument, andGradleModelMapperwith DTOs fromRailroadGradlePlugin(RailroadProject,RailroadGradleTask,RailroadConfiguration, etc.) - Refactored
GradleSettingsfrom an immutable record to a mutable Lombok-annotated class to support runtime modifications (e.g., toggling offline mode) - Added new Gradle UI components:
GradleToolsPanewith tasks/dependencies tabs, tree builders, and context menus for running tasks directly from the UI - Enhanced localization support with
LocalizedTaband extendedLocalizedMenuItemto accept graphic nodes - Refactored
RRButtonto support toggle buttons with proper CSS pseudo-class states
Reviewed changes
Copilot reviewed 55 out of 57 changed files in this pull request and generated 19 comments.
Show a summary per file
| File | Description |
|---|---|
GradleSettings.java |
Converted from record to mutable class with getters/setters |
GradleBuildModel.java |
Updated to use RailroadProject and FabricDataModel DTOs |
GradleManager.java |
Added downloadAllSources(), saveSettings(), and isGradleProject() methods; improved Gradle version parsing |
ToolingGradleModelService.java |
Refactored model loading to use new init script and DTOs; removed legacy task argument extraction |
GradleRunConfigurationData.java |
Updated to use RailroadGradleTask and RailroadGradleTaskArgument interfaces |
GradleToolsPane.java |
New UI component providing sync, download sources, and offline mode buttons |
GradleTasksPane.java / GradleDependenciesPane.java |
New tree-based views for tasks and dependencies |
| Gradle tree components | New tree element classes (GradleTaskElement, GradleProjectElement, etc.) for UI rendering |
LocalizedTab.java |
New class for localized JavaFX tabs |
LocalizedMenuItem.java |
Extended to support graphic nodes alongside text |
RRButton.java |
Refactored with internal RRButtonBase helper; added Toggle inner class for toggle buttons |
| Facet detectors | Updated to accept Project instead of Path; refactored to use new Gradle model service |
| Init scripts | Removed init-task-args.gradle, init-java-version.gradle, init-fabric-extractor.gradle; added init-gradle-plugin.gradle and init-download-sources.gradle |
build.gradle |
Replaced separate plugin dependencies with unified RailroadGradlePlugin |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/dev/railroadide/railroad/gradle/ui/tree/GradleProjectElement.java
Outdated
Show resolved
Hide resolved
src/main/java/dev/railroadide/railroad/gradle/ui/GradleProjectContextMenu.java
Outdated
Show resolved
Hide resolved
src/main/java/dev/railroadide/railroad/gradle/project/GradleManager.java
Outdated
Show resolved
Hide resolved
src/main/java/dev/railroadide/railroad/gradle/project/GradleManager.java
Show resolved
Hide resolved
src/main/java/dev/railroadide/railroad/gradle/GradleSettings.java
Outdated
Show resolved
Hide resolved
src/main/java/dev/railroadide/railroad/gradle/ui/task/GradleTaskContextMenu.java
Show resolved
Hide resolved
...in/java/dev/railroadide/railroad/ide/runconfig/defaults/data/GradleRunConfigurationData.java
Show resolved
Hide resolved
src/main/java/dev/railroadide/railroad/gradle/project/GradleManager.java
Outdated
Show resolved
Hide resolved
src/main/java/dev/railroadide/railroad/gradle/project/GradleManager.java
Outdated
Show resolved
Hide resolved
src/main/java/dev/railroadide/railroad/project/facet/detector/JavaFacetDetector.java
Outdated
Show resolved
Hide resolved
Closed
Signed-off-by: Ryan <43997792+DaRealTurtyWurty@users.noreply.github.com>
DaRealTurtyWurty
added a commit
that referenced
this pull request
Jan 16, 2026
…s) (#115) * Add Gradle UI components and refactor Gradle model Introduces new Gradle UI classes for project and task context menus, task tree builder, and tasks pane. Refactors RRButton to use a support class for shared logic and adds LocalizedTab for localized JavaFX tabs. GradleSettings is converted from a record to a class with getters/setters, and related usages are updated. GradleModelMapper and GradleTaskModel are updated to associate tasks with their project, improving model mapping and equality checks. GradleManager now supports saving Gradle settings. Various improvements and new features for Gradle integration and UI localization. * Add Gradle sources download feature Introduces a new 'Download Sources' button in the Gradle tool window, which triggers a bundled init script to download sources for all Gradle projects using the updated download-sources plugin (v1.0.1). Implements supporting logic in GradleManager and adds the required init script resource. * Reuse existing Gradle run configurations if available GradleTaskContextMenu now checks for an existing run configuration before creating a new one, preventing duplicate configurations for the same Gradle task. Added a helper to set the selected run configuration in RunConfigurationManager. GradleTasksPane updated to use the new logic. * Refactor Gradle UI to support dependency tree view Replaces GradleTasksPane and related classes with a generic GradleTreeViewPane and GradleTreeBuilder interface, enabling both task and dependency tree views. Adds support for displaying Gradle dependency configurations and their trees in the UI, updates model mapping to include dependency data, and refactors context menus and resource keys for consistency. Removes obsolete task tree classes and updates styles and resource references accordingly. * Remove plugin properties files from META-INF Deleted dev.railroadide.fabricExtractorPlugin.properties and dev.railroadide.javaVersionExtractorPlugin.properties from META-INF/gradle-plugins * Refactor Gradle model to use plugin DTOs Replaces custom Gradle model and task classes with DTOs from railroad-gradle-plugin. Removes obsolete mapping and argument classes, updates UI and service layers to use new types, and simplifies model loading logic. Also updates build.gradle to depend on the unified plugin and removes unused init scripts. This is a WIP. * Refactor Gradle integration and improve model loading Refactored GradleManager to detect Gradle projects and extract Gradle version directly from gradle-wrapper.properties. Updated GradleFacetDetector to simplify facet data and rely on GradleManager for detection. Improved Gradle model loading by injecting an init script for plugin application in ToolingGradleModelService. Enhanced GradleTasksPane and GradleDependenciesPane to extract data from the cached model. Added error logging for model reload failures. Moved Gradle tab opening logic into a reusable method in IDESetup. Added the init-gradle-plugin.gradle script to resources. * Refactor Gradle plugin integration and dependency tree Updated Gradle plugin usage to 'RailroadGradlePlugin:1.0.0' and refactored init scripts for improved plugin application. Enhanced dependency tree builder to group configurations by module and display module nodes. Improved model service to handle missing models gracefully. Minor code cleanups and bug fixes in JavaFacetDetector, GradleTasksPane, and JDK class. * Implement copilot suggestions and fix merge errors --------- Signed-off-by: Ryan <43997792+DaRealTurtyWurty@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several significant changes to the Gradle integration and localization features in the codebase. The most notable updates include refactoring the Gradle model and settings classes to use new data transfer objects, removing legacy Gradle task modeling code, and adding new localization support for UI components. These changes aim to improve maintainability, enable richer Gradle project representation, and enhance UI localization.
Gradle model and settings refactor:
GradleSettingsfrom a record to a mutable class with Lombok annotations, and updated related usages to use getter/setter methods instead of direct field access. This improves flexibility and compatibility with frameworks expecting JavaBeans conventions. [1] [2] [3] [4]GradleBuildModelandGradleProjectModelto use new DTOs (FabricDataModel,RailroadProject,RailroadGradleTask,RailroadConfiguration) for richer project and task representation. [1] [2] [3]Removal of legacy Gradle task modeling:
GradleModelMapper,GradleTaskModel,GradleTaskArgument, andGradleTaskArgType. [1] [2] [3] [4]Gradle manager and environment improvements:
GradleManagerto cache and exposeGradleSettingsdirectly, and to build settings using the new approach. This simplifies environment initialization and future configuration updates. [1] [2] [3] [4] [5]Localization enhancements:
LocalizedTabclass to support localized JavaFX tabs, and extendedLocalizedMenuItemto allow setting a graphic node alongside the localized text. [1] [2] [3]Plugin configuration:
META-INF/gradle-plugins/dev.railroadide.railroadgradleplugin.properties.