Add extraSourceDirs capability for additional source directories#105
Merged
Add extraSourceDirs capability for additional source directories#105
Conversation
#104) - Add extraSourceDirs property to AbstractBaseOptions as ConfigurableFileCollection - Update AbstractBaseTask to include extra source directories in GWT classpath - Update all config classes (GwtCompileConfig, GwtDevModeConfig, GwtSuperDevConfig) to pass extraSourceDirs - Automatically add extraSourceDirs to Java source sets for seamless integration - Add comprehensive example demonstrating the feature - Update all documentation with usage examples and best practices This restores the capability from v1.x to specify additional source directories, supporting multi-module projects and annotation processor outputs. Fixes #104
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR restores the extraSourceDirs capability from the v1.x plugin, enabling developers to specify additional source directories for GWT compilation. This feature is essential for multi-module projects, annotation processor integration, and scenarios requiring external source directories without manual configuration duplication.
Key Changes
- Added
extraSourceDirsproperty toAbstractBaseOptionsand task infrastructure - Implemented automatic source set integration in
GwtPlugin - Updated all configuration classes to support extraSourceDirs with hierarchical fallback logic
- Created comprehensive example project demonstrating the feature
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| plugin/src/main/java/org/docstr/gwt/AbstractBaseOptions.java | Added extraSourceDirs property to base options class |
| plugin/src/main/java/org/docstr/gwt/AbstractBaseTask.java | Integrated extraSourceDirs into GWT compiler classpath |
| plugin/src/main/java/org/docstr/gwt/GwtPlugin.java | Added automatic source set integration for extraSourceDirs |
| plugin/src/main/java/org/docstr/gwt/GwtCompileConfig.java | Added extraSourceDirs configuration support with fallback logic |
| plugin/src/main/java/org/docstr/gwt/GwtDevModeConfig.java | Added extraSourceDirs configuration support with fallback logic |
| plugin/src/main/java/org/docstr/gwt/GwtSuperDevConfig.java | Added extraSourceDirs configuration support with fallback logic |
| examples/extra-sources-example/* | Complete example project demonstrating extraSourceDirs usage |
| doc/latest/* | Updated documentation to cover extraSourceDirs feature |
| justfile | Added extra-sources-example to build targets |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- Use LinkedHashSet to collect all extra source directories - Prevents potential duplicate additions to Java source sets - Maintains insertion order while ensuring uniqueness - More efficient single addition operation Addresses review feedback from PR #105
- addAll() handles empty collections gracefully - Cleaner and more concise code - Same functionality with less verbosity
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.
Summary
Restores the capability from v1.x to specify additional source directories for GWT compilation, addressing a key requirement for multi-module projects and annotation processor integration. This feature allows developers to include source files from external directories without manual configuration duplication.
Changes Made
extraSourceDirsproperty asConfigurableFileCollectiontoAbstractBaseOptions, enabling flexible source directory specificationAbstractBaseTaskto include extra source directories in the GWT compiler classpath, merging them seamlessly with main sourcesGwtCompileConfig,GwtDevModeConfig,GwtSuperDevConfig) to pass extraSourceDirs from both root and nested configurationsGwtPluginto automatically add extraSourceDirs to Java source sets, eliminating the need for duplicate configurationImpact
Fixes #104