Skip to content

Fix sbt build issues - #29

Open
arnkore wants to merge 4 commits into
liancheng:masterfrom
arnkore:fix_sbt_build_issues
Open

Fix sbt build issues#29
arnkore wants to merge 4 commits into
liancheng:masterfrom
arnkore:fix_sbt_build_issues

Conversation

@arnkore

@arnkore arnkore commented Sep 25, 2025

Copy link
Copy Markdown

🚀 Upgrade sbt to 1.11.6 and Add CI/CD Integration

📋 Summary

This PR modernizes the Spear project by upgrading from the deprecated sbt 0.13.12 to sbt 1.11.6, ensuring JDK 11 compatibility, and implementing a comprehensive CI/CD pipeline with automated code quality checks.

🔧 Key Changes

1. SBT Upgrade & JDK 11 Compatibility

  • Upgraded sbt from 0.13.12 to 1.11.6
  • Updated all sbt plugins to compatible versions for sbt 1.x
  • Migrated build syntax from sbt 0.13 to sbt 1.x (slash syntax, task dependencies)
  • Fixed Java compatibility issues for JDK 11 while maintaining Java 1.8 compilation target
  • Resolved dependency conflicts (fansi version override for ammonite)

2. Code Quality & Style

  • Fixed import order issues in Scala files to pass scalastyle checks
  • Maintained all business logic unchanged
  • All 369 tests pass successfully

3. CI/CD Integration

  • Added GitHub Actions workflow (.github/workflows/ci.yml)
  • Created build scripts (scripts/build.sh, scripts/check-style.sh)
  • Added Makefile with convenient build commands
  • Integrated scalastyle code style checking into CI pipeline

4. Project Cleanup

  • Added .bsp/ to .gitignore to exclude IDE-specific files
  • Removed IDE-generated files from version control
  • Updated documentation with new build instructions

🛠️ Technical Details

SBT Plugin Updates

  • sbt-native-packager: 1.8.1
  • sbt-site: 1.4.1
  • sbt-scalariform: 1.8.3
  • sbt-scoverage: 1.9.3
  • scalastyle-sbt-plugin: 1.0.0

Build Commands

make help      # Show all available commands
make clean     # Clean previous build artifacts
make compile   # Compile source code
make test      # Run all tests
make style     # Run scalastyle code style check
make package   # Create JAR package
make build     # Run complete build (clean + compile + test + style + package)

✅ Verification

  • Compilation: All modules compile successfully
  • Tests: All 369 tests pass
  • Code Style: All scalastyle checks pass
  • CI/CD: GitHub Actions workflow configured
  • Documentation: README updated with new instructions

�� Benefits

  1. Modern Toolchain: Up-to-date sbt and plugin versions
  2. JDK 11 Support: Full compatibility with modern Java versions
  3. Automated Quality: CI/CD pipeline ensures code quality
  4. Developer Experience: Convenient build commands and scripts
  5. Maintainability: Clean project structure and proper gitignore

📝 Breaking Changes

None. This is a backward-compatible upgrade that maintains all existing functionality while modernizing the build system.


This change is Reviewable

- Upgrade sbt version from 0.13.12 to 1.11.6 in project/build.properties
- Update sbt plugins to compatible versions for sbt 1.x:
  - sbt-native-packager: 1.8.1
  - sbt-site: 1.4.1
  - sbt-scalariform: 1.8.3
  - sbt-scoverage: 1.9.3
  - scalastyle-sbt-plugin: 1.0.0
- Migrate build.sbt syntax from sbt 0.13 to sbt 1.x:
  - Replace 'in' operator with slash syntax (e.g., 'Compile / compile')
  - Update task dependency syntax
  - Fix Universal mappings syntax
- Update Java compilation target from 1.7 to 1.8 for JDK 11 compatibility
- Fix Java 8 Stream API compatibility issue in spear-utils:
  - Replace 'lines mkString' with 'lines.toArray mkString'
- Resolve dependency conflicts:
  - Add fansi version override to resolve ammonite dependency conflicts
- Maintain Scala 2.11.11 and all business logic unchanged
- All 369 tests pass successfully

This upgrade enables the project to build and run on JDK 11 while maintaining
Java 1.8 compilation target and preserving all existing functionality.
- Add .bsp/ directory to .gitignore to exclude IDE-generated BSP configuration files
- Remove .bsp/sbt.json from version control as it contains local-specific paths
- The .bsp/sbt.json file contained incorrect JDK path (jdk-24.jdk) which should not be tracked
- Add scripts/check-style.sh for standalone scalastyle checking
- Add scripts/build.sh for complete build process including style checks
- Add Makefile with convenient build commands (make help, make style, make build, etc.)
- Add GitHub Actions CI workflow (.github/workflows/ci.yml) with:
  - Scalastyle code style checking
  - Compilation
  - Testing
  - Packaging
- Fix import order issues in Scala files to pass scalastyle checks:
  - ValueExpressionParser.scala
  - aggregationAnalysis.scala
  - LogicalPlan.scala
- Update README.md with new build instructions and CI/CD information
- All scalastyle checks now pass successfully

This provides a complete CI/CD solution for code quality assurance while
maintaining the existing build functionality.
- Remove build/ directory containing old Apache Spark sbt launcher scripts
- Update README.md to use modern sbt commands instead of ./build/sbt
- Update spear-docs/overview.rst to use sbt spear-repl/run
- Remove build/sbt-launch-*.jar from .gitignore as it's no longer needed
- All documentation now uses standard sbt 1.11.6 commands

The old build/sbt script was designed for sbt 0.13.x and is no longer
compatible with the modern sbt 1.11.6 setup.
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.

1 participant