Skip to content

Comments

Add extraSourceDirs capability for additional source directories#105

Merged
jiakuan merged 3 commits intomainfrom
feature/104-add-extra-source-dirs
Aug 23, 2025
Merged

Add extraSourceDirs capability for additional source directories#105
jiakuan merged 3 commits intomainfrom
feature/104-add-extra-source-dirs

Conversation

@jiakuan
Copy link
Owner

@jiakuan jiakuan commented Aug 23, 2025

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

  • Core Plugin Enhancement: Added extraSourceDirs property as ConfigurableFileCollection to AbstractBaseOptions, enabling flexible source directory specification
  • Task Integration: Updated AbstractBaseTask to include extra source directories in the GWT compiler classpath, merging them seamlessly with main sources
  • Configuration Support: Extended all configuration classes (GwtCompileConfig, GwtDevModeConfig, GwtSuperDevConfig) to pass extraSourceDirs from both root and nested configurations
  • Auto-Integration: Modified GwtPlugin to automatically add extraSourceDirs to Java source sets, eliminating the need for duplicate configuration
  • Documentation: Comprehensive updates to all documentation files including Configuration.md, Quickstart.md, Best Practices.md, and README
  • Example Project: Created complete example demonstrating the feature with external source directory integration

Impact

  • Enables multi-module project support without complex workarounds
  • Supports annotation processor output directories
  • Maintains backward compatibility while adding new functionality
  • Simplifies configuration by automatically handling Java source set integration

Fixes #104

#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
@jiakuan jiakuan requested a review from Copilot August 23, 2025 02:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 extraSourceDirs property to AbstractBaseOptions and 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
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@jiakuan jiakuan merged commit 468f3a9 into main Aug 23, 2025
1 check passed
@jiakuan jiakuan deleted the feature/104-add-extra-source-dirs branch August 23, 2025 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add back capability to specify additional source directories.

1 participant