Skip to content

build: 支持打包zip产物 #2129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 4, 2025
Merged

build: 支持打包zip产物 #2129

merged 4 commits into from
May 4, 2025

Conversation

unknowIfGuestInDream
Copy link
Owner

@unknowIfGuestInDream unknowIfGuestInDream commented May 4, 2025

Close #2084

Fixes #

Proposed Changes

  1. ...
  2. ...
  3. ...

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request

Reviewing Maintainer

  • Label as either enhancement, bug, documentation or dependencies
  • Verify design and implementation

Summary by Sourcery

Add support for generating zip artifacts for smc and qe projects with platform-specific packaging

Build:

  • Added Maven profile to support generating platform-specific zip packages for smc and qe projects
  • Implemented SHA-256 checksum generation for zip artifacts

Documentation:

  • Updated README files to include instructions for generating zip packages with platform-specific options

Summary by CodeRabbit

  • 文档

    • 更新了中、英、日三种语言的README,详细说明了打包步骤,并新增了基于Maven profile和平台参数生成zip包的说明及命令示例。
  • 新功能

    • 为 smc 和 qe 项目新增了 Maven zip 打包配置,支持通过指定 profile 和平台参数生成平台专属的 zip 包及对应的 SHA-256 校验文件。

Close #2084

Signed-off-by: unknowIfGuestInDream <liang.tang.cx@gmail.com>
Copy link

vercel bot commented May 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
javafx-tool ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 4, 2025 8:23am

Copy link

sourcery-ai bot commented May 4, 2025

Reviewer's Guide

This pull request adds the capability to package the qe and smc projects into zip archives by introducing a new Maven profile named zip in their respective pom.xml files. This profile uses the maven-assembly-plugin to create the zip and maven-antrun-plugin to generate a SHA-256 checksum.

File-Level Changes

Change Details Files
Added a Maven profile (zip) to package projects as zip archives.
  • Defined a new profile named zip triggered via -Pzip.
  • Configured maven-assembly-plugin to create a zip archive named qeTool/smcTool-${javafx.platform}.zip.
  • Configured maven-antrun-plugin to generate a SHA-256 checksum file for the zip archive.
  • Added a property javafx.platform to allow specifying the target platform (win/mac/linux).
qe/pom.xml
smc/pom.xml
Updated documentation for the new zip packaging feature.
  • Added instructions on how to build the zip package using the new zip profile and Maven command.
README.md
README_jp.md
README_zh.md

Assessment against linked issues

Issue Objective Addressed Explanation
#2084 Implement a feature to package the project into a zip archive using the -Pproduct control.
#2084 Optimize the README to reflect the new packaging feature.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

quine-bot bot commented May 4, 2025

👋 Figuring out if a PR is useful is hard, hopefully this will help.

  • @unknowIfGuestInDream has been on GitHub since 2019 and in that time has had 1238 public PRs merged
  • Don't you recognize them? They've been here before 🎉
  • Here's a good example of their work: javafxTool (Javafx scaffolding, built on JDK17 + JavaFX21 + controlsfx 11.x.x + Maven)
  • From looking at their profile, they seem to be good with Java and HTML.

Their most recently public accepted PR is: unknowIfGuestInDream/document#170

Copy link

Thank you for following naming conventions! 😻

Copy link

coderabbitai bot commented May 4, 2025

"""

Walkthrough

本次更改主要围绕项目的打包流程进行扩展和优化。README(含中、英、日三语版本)中“打包”部分被详细补充,明确了 IDEA 工件聚合包、推荐使用 mvn package、依赖文件位置,并新增了通过 -Pzip profile 及平台参数打包 zip 产品的说明。smcqe 项目分别新增了 Maven zip 打包 profile(含 zip.xml 装配描述符与 SHA-256 校验生成),支持按平台生成 zip 包及校验文件。此次改动未涉及对代码导出或公共实体的更改。

Changes

文件/路径分组 变更摘要
README.md, README_jp.md, README_zh.md 扩充并细化打包说明,新增 zip 产品打包步骤及示例命令。
smc/config/zip.xml, qe/config/zip.xml 新增 Maven assembly zip 装配描述符文件,定义 zip 包内容与结构。
smc/pom.xml, qe/pom.xml 新增 zip profile,配置 assembly 插件和 antrun 插件生成 zip 包及 SHA-256 校验文件。

Sequence Diagram(s)

sequenceDiagram
    participant 开发者
    participant Maven
    participant Assembly插件
    participant Antrun插件

    开发者->>Maven: mvn package -Pzip -Djavafx.platform=xxx -DskipTests
    Maven->>Assembly插件: 读取 zip.xml,打包 zip(含依赖、docs、平台特定文件等)
    Assembly插件-->>Maven: 生成 zip 包
    Maven->>Antrun插件: 计算 zip 包 SHA-256 校验值
    Antrun插件-->>Maven: 输出 .sha256 校验文件
    Maven-->>开发者: 产出 zip 包及校验文件
Loading

Assessment against linked issues

Objective Addressed Explanation
通过 -Pproduct(实际为 -Pzip)控制 zip 打包流程(#2084
优化 README,补充打包说明(#2084

Suggested labels

workflow

Suggested reviewers

  • DreamAwakenFateBroke

Poem

兔子挥爪写新诗,
打包流程更明晰。
zip 包随平台来,
校验文件伴身齐。
README 指路不迷失,
工程打包乐无比!
🐇✨
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a25ffc and 6ea13e2.

📒 Files selected for processing (2)
  • qe/config/zip.xml (1 hunks)
  • smc/config/zip.xml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • qe/config/zip.xml
  • smc/config/zip.xml
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: build (17, windows-latest, false)
  • GitHub Check: check_bad_merge
  • GitHub Check: spellcheck (en, English style, README.md **/i18n/messages_en.properties)
  • GitHub Check: qodana
  • GitHub Check: StepSecurity Harden-Runner
  • GitHub Check: Summary

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

@github-actions github-actions bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file SMC smc QE dependency-submission labels May 4, 2025
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @unknowIfGuestInDream - I've reviewed your changes - here's some feedback:

  • Consider extracting the common build profile configuration for zip packaging into a parent POM or shared plugin management to avoid duplication between qe/pom.xml and smc/pom.xml.
  • Setting a default value for javafx.platform might lead to accidental builds for the wrong platform if the -D flag is forgotten; consider removing the default to force explicit platform specification.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Close #2084

Signed-off-by: unknowIfGuestInDream <liang.tang.cx@gmail.com>
Close #2084

Signed-off-by: unknowIfGuestInDream <liang.tang.cx@gmail.com>
Copy link
Contributor

github-actions bot commented May 4, 2025

Qodana Community for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (8)
qe/pom.xml (2)

248-267: 检查 maven-assembly-plugin 配置
assembly 插件已配置为在 package 阶段生成平台特定的 ZIP 包,且 appendAssemblyId=false 保持最终文件名清晰。建议在此处显式声明插件 <version>,以确保构建可复现。


268-297: 验证 SHA-256 校验生成及插件版本

  • 请确认 ${commons-codec.version} 在父 POM 或当前 POM 中已定义,否则会导致构建失败。
  • 建议为 maven-antrun-plugin 明确指定 <version>,保证插件版本可控。
smc/pom.xml (2)

320-338: 检查 maven-assembly-plugin 配置
assembly 插件配置正确,生成名称格式为 smcTool-${javafx.platform},建议在该插件段落中添加 <version> 声明,以提升构建可复现性。


340-369: 验证 SHA-256 校验及依赖属性

  • 请确认 ${commons-codec.version} 属性在父 POM 或当前 POM 中有定义,以防构建中断。
  • 建议为 maven-antrun-plugin 明确指定 <version>,并校验校验流程与 qe 项目保持一致。
qe/config/zip.xml (2)

1-3: 建议添加 XML 声明
在文件开头加入 <?xml version="1.0" encoding="UTF-8"?> 可以明确指定编码并提高工具兼容性。


1-26: 校验许可证头信息
许可证声明使用了 unknowIfGuestInDream 和年份 2025,请确认与项目实际版权归属及年份保持一致,避免信息不符或法律风险。

smc/config/zip.xml (2)

1-3: 建议添加 XML 声明
为避免编码歧义和增强 IDE 识别,可以在开头加入 <?xml version="1.0" encoding="UTF-8"?>


1-26: 校验许可证头信息
请确认许可证中 unknowIfGuestInDream2025 年份信息准确无误,以符合项目实际版权声明。

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4fc278d and 4a25ffc.

📒 Files selected for processing (7)
  • README.md (1 hunks)
  • README_jp.md (1 hunks)
  • README_zh.md (1 hunks)
  • qe/config/zip.xml (1 hunks)
  • qe/pom.xml (1 hunks)
  • smc/config/zip.xml (1 hunks)
  • smc/pom.xml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: qodana
  • GitHub Check: build (21, ubuntu-latest, false)
  • GitHub Check: build (21, windows-latest, false)
  • GitHub Check: build (17, macos-latest, false)
  • GitHub Check: build (17, ubuntu-latest, false)
  • GitHub Check: build (17, windows-latest, false)
  • GitHub Check: StepSecurity Harden-Runner
  • GitHub Check: Summary
🔇 Additional comments (13)
README_zh.md (3)

47-47: 文档更新:步骤1标题已更改
已将“IDEA工件打包”更新为“IDEA工件打聚合包”,与英文和日文文档保持一致,更准确地表达了构建聚合包的意图。


50-50: 文档更新:步骤2推荐 mvn package
新增了推荐使用 mvn package 进行打包的说明,并明确指出依赖会放置在 lib 文件夹下,提升了文档的可读性和实用性。


51-52: 文档更新:新增 ZIP 产物打包说明
增加了通过指定 Profile=zip 及 javafx.platform 平台参数生成 smc 和 qe 项目 ZIP 产物的步骤说明,并提供了示例命令,文档内容完整且易于操作。

README_jp.md (3)

48-48: ドキュメント更新:ステップ1タイトルの変更
「IDEA アーティファクトのパッケージ化」を「IDEAアーティファクト集約パッケージ」に更新し、英語版・中国語版と整合性を確保しています。


52-52: ドキュメント更新:ステップ2の推奨パッケージング
mvn package コマンドの使用を推奨し、依存関係が lib フォルダに配置されることを明示しており、ユーザーの理解を助けます。


53-54: ドキュメント更新:ZIP 生成手順の追加
smc および qe プロジェクトで Profile=zip と javafx.platform プロパティを指定して ZIP を生成する手順とサンプルコマンドを追加し、実用的なガイドを提供しています。

README.md (3)

63-63: Docs: Step1 描述已更新
将 “IDEA artifact packaging” 修改为 “IDEA artifact aggregation packaging”,与多语言文档保持一致,表述更精准。


68-68: Docs: 推荐 mvn package
新增推荐使用 mvn package 进行打包,并说明依赖位于 lib 文件夹,提升了操作指南的清晰度。


69-70: Docs: 新增 ZIP 包打包说明
增加了通过 -Pzip profile 以及 javafx.platform 平台参数生成 smc 和 qe 项目 ZIP 包的步骤,并提供跳过测试的示例命令,实用且完整。

qe/pom.xml (1)

239-246: 新增 Maven Profile zip
已在 qe/pom.xml 中新增 zip profile,默认平台属性为 win,并引入构建打包流程。配置清晰,符合 PR 目标。

smc/pom.xml (1)

312-317: 新增 Maven Profile zip
smc/pom.xml 中新增 zip profile,设置默认 javafx.platform 属性为 win,使打包流程与 qe 项目保持一致。配置清晰合理。

qe/config/zip.xml (1)

74-80: 确认平台特定文件的输出路径
<directory>../jenkins/${javafx.platform}/qe</directory><outputDirectory>/</outputDirectory> 会把所有平台相关文件扁平化到 ZIP 根目录,可能与其它资源冲突。请验证是否需要保留目录结构(例如改为 <outputDirectory>/jenkins/${javafx.platform}/qe</outputDirectory>)。

smc/config/zip.xml (1)

74-80: 确认平台特定文件的输出路径
<directory>../jenkins/${javafx.platform}/smc</directory><outputDirectory>/</outputDirectory> 会将该目录下所有内容直接平铺到 ZIP 根目录,请验证是否需要保留子目录结构以避免文件冲突。

Close #2084

Signed-off-by: unknowIfGuestInDream <liang.tang.cx@gmail.com>
Copy link

sonarqubecloud bot commented May 4, 2025

@unknowIfGuestInDream unknowIfGuestInDream merged commit a53c65a into master May 4, 2025
36 checks passed
@unknowIfGuestInDream unknowIfGuestInDream deleted the amp branch May 4, 2025 09:10
@quine-bot quine-bot bot mentioned this pull request May 4, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file dependency-submission documentation Improvements or additions to documentation QE size/L SMC smc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] package打包zip
1 participant