sofa-ark icon indicating copy to clipboard operation
sofa-ark copied to clipboard

feat: initial implementation of gradle plugin #73

Open pmupkin opened this issue 1 year ago • 2 comments

Motivation

Related issue: #73

Enable SofaArk to support building Biz and Ark packages in the Gradle environment. Subsequent implementations, documentation, testing, and optimizations will be carried out in this PR.

Summary by CodeRabbit

  • New Features

    • Introduced new classes for managing ARK archive creation and configuration, including ArkArchiveSupport, ArkBizCopyAction, ArkPluginAction, and ArkJar.
    • Added a Gradle plugin for the Sofa Ark framework, enabling seamless integration and configuration within Gradle projects.
    • Enhanced functionality for managing JAR tasks and dependencies, including bootable JAR creation and artifact configuration.
    • Implemented a utility for resolving and storing the main class name for Java applications.
  • Documentation

    • Added comprehensive documentation for the sofa-ark-gradle-plugin, outlining configuration and usage instructions.
  • Bug Fixes

    • Improved error handling and exception management across various classes to ensure smoother operation during archive creation and configuration.

pmupkin avatar Sep 09 '24 17:09 pmupkin

Walkthrough

This pull request introduces a comprehensive set of new classes and functionalities within the ark-gradle-plugin project, specifically in the com.alipay.sofa.ark.plugin package. Key additions include the ArkArchiveSupport class for managing ARK archives, the ArkBizCopyAction class for handling business artifacts, and the ArkPluginAction class for configuring the Gradle plugin. Additional classes such as SofaArkGradlePlugin, SofaArkGradlePluginExtension, and various utility classes enhance the Gradle build process, providing structured management of classpath entries, archive creation, and error handling mechanisms.

Changes

File Path Summary of Changes
.../ArkArchiveSupport.java Introduced ArkArchiveSupport class for managing ARK archives, including manifest configuration and file operations.
.../ArkBizCopyAction.java Added ArkBizCopyAction class for copying business artifacts into archives, handling errors, and processing files.
.../ArkPluginAction.java Created ArkPluginAction class to manage Gradle project configurations and tasks related to the Sofa Ark framework.
.../SofaArkGradlePlugin.java Introduced SofaArkGradlePlugin class to define plugin behavior and configuration for the Sofa Ark framework.
.../SofaArkGradlePluginExtension.java Added an abstract class for configuring the Sofa Ark Gradle plugin, encapsulating various properties and settings.
.../ArkJar.java Added ArkJar class for creating bootable JAR files with specific configurations and classpath management.
.../BootArchive.java Introduced BootArchive interface for defining properties related to bootable archives in Gradle.
.../DefaultTimeZoneOffset.java Added DefaultTimeZoneOffset class for handling time offsets based on the system's default time zone.
.../JarTypeFileSpec.java Introduced JarTypeFileSpec class for evaluating JAR files based on their manifest attributes.
.../LoaderZipEntries.java Added LoaderZipEntries class for copying entries from the spring-boot-loader.jar.
.../MainClassFinder.java Introduced MainClassFinder class for locating Java classes with a public static main method.
.../ResolveMainClassName.java Added ResolveMainClassName class for resolving and storing the name of the main class for Java applications.
.../StringUtils.java Introduced StringUtils class for utility methods related to string manipulation and collections.
.../ZipCompression.java Added ZipCompression enum for defining compression types for JAR entries.
.../README.md New documentation added for the sofa-ark-gradle-plugin module, outlining configuration and usage.

Suggested labels

size/XL

Suggested reviewers

  • gaosaroma

Poem

🐰 In the garden of code, where the rabbits play,
New classes and features hop in every day.
With archives and jars, they dance in delight,
Packaging dreams, making builds feel just right.
So here's to the changes, both big and small,
In the world of Sofa Ark, we celebrate all! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Sep 09 '24 17:09 coderabbitai[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 78.36%. Comparing base (0a41e92) to head (5dbb578). Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1005      +/-   ##
============================================
+ Coverage     78.21%   78.36%   +0.14%     
  Complexity      874      874              
============================================
  Files           171      171              
  Lines          7052     7052              
  Branches       1036     1036              
============================================
+ Hits           5516     5526      +10     
+ Misses         1005      994      -11     
- Partials        531      532       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Oct 22 '24 17:10 codecov[bot]