搜索插件、代码仓与 APP 分类

插件详情v1.11.0

package_rename_plus

一种极快的方式,将您出色的 Flutter 项目配置为生产就绪状态。

AndroidiOSmacOSWindowsLinux
近 30 天下载
1010
喜欢数
33
Pub 分数
160

安装插件

flutter pub add package_rename_plus

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

package_rename_plus 是一款高性能工具,旨在简化 Flutter 项目生产环境配置流程。它能够快速重命名包标识符、应用名称以及跨多个平台(包括 Android、iOS、macOS、Windows 和 Linux)的相关资源。通过自动化配置更新,减少手动错误并加速部署准备。非常适合希望在扩展或重新品牌化过程中保持项目结构清晰一致的开发者。

适合场景

  • 重命名Flutter应用以进行重新品牌化
  • 准备应用以进行生产部署
  • 自动化包标识符更改
  • 跨平台配置更新
  • 优化CI/CD流水线

主要特点

  • 飞速执行
  • 多平台支持
  • 自动资产更新
  • 安全的配置处理
  • 命令行集成

适合对象

  • Flutter 开发者
  • App重新品牌化团队
  • CI/CD 自动化工程师
  • 大型项目维护者
  • DevOps 工程师

使用建议

  • 使用前需谨慎备份
  • 可能与自定义配置冲突
  • 不适用于一次性更改
  • 仅限包级别重命名
  • 取决于正确的项目结构

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Package Rename Plus

This a fork repository from official package_rename using different approach to replace the configuration. Fixed ios issue about replace bundle identifier with or without extension targets. Removed logger dependency that can be solved using debugPrint only to minimize dependency to others packages/plugins. A Blazingly Fast way to configure your Bleeding Edge flutter project to be production ready.

pub package GitHub

GitHub issues GitHub issues closed


Package Rename handles changing 37 fields across 19 files on 6 platforms so you can focus on your awesome project.

For more info see list of changed fields

Getting started

Add to Dependencies
dev_dependencies:
  package_rename_plus: ^1.11.0
Create configuration

You can create configurations by adding package_rename_config key in:

  1. Root pubspec.yaml file
  2. package_rename_config.yaml file at root of your project or a custom folder in the project

Usage

Adding Platform Specific Configurations
package_rename_config:
  android:
    app_name: # (String) The display name of the android app
    package_name: # (String) The package name of the android app
    override_old_package: # (Optional) (String) Use this to delete the old folder structure of MainActivity or to use the existing code with the new package name
    lang: # (Optional) (String) The android development language {kotlin(default) or java}

  ios:
    app_name: # (String) The display name of the ios app
    bundle_name: # (String) The bundle name of the ios app
    override_old_package: # (String) Use this to replace the old bundle identifier with the new bundle identifier
    package_name: # (String) The product bundle identifier of the ios app

  linux:
    app_name: # (String) The window title of the linux app
    package_name: # (String) The application id of the linux app
    exe_name: # (String) The executable name (binary name) of the linux app

  macos:
    app_name: # (String) The product name of the macos app
    package_name: # (String) The product bundle identifier of the macos app
    copyright_notice: # (String) The product copyright of the macos app

  web:
    app_name: # (String) The title of the web app and PWA
    short_app_name: # (String) The short display name of the PWA (Optional, defaults to app_name if not set)
    description: # (String) The description of the web app and PWA

  windows:
    app_name: # (String) The window title & software name of the windows app
    organization: # (String) The organization name (company name) of the windows app
    copyright_notice: # (String) The legal copyright of the windows app
    exe_name: # (String) The executable name (binary name) of the windows app

For full example click here

Running Package Rename

Execute the command as per your config location:

if config file exists in either pubspec.yaml or root path:

dart run package_rename_plus

OR

if config file exists in a custom folder:

dart run package_rename_plus --path="path/to/package_rename_config.yaml"

or

dart run package_rename_plus -p "path/to/package_rename_config.yaml"

Flavour Support

Package Rename supports flavours. You can add flavour specific configurations by adding flavour_name in configuration key.

package_rename_config-flavour_name:
  # ...

For full example click here

And then run the following command:

dart run package_rename_plus --flavour=flavour_name

or

dart run package_rename_plus -f flavour_name

With custom config file location:

dart run package_rename_plus --flavour=flavour_name --path="path/to/package_rename_config.yaml"

Known Issues

iOS and macOS issues with PRODUCT_BUNDLE_IDENTIFIER:

The PRODUCT_BUNDLE_IDENTIFIER's in ios/Runner.xcodeproj/project.pbxproj and macos/Runner.xcodeproj/project.pbxproj have different values for different targets. Like, in my case:

DEFAULT

  • rocks.outdatedguy.packageRenameExample
  • rocks.outdatedguy.packageRenameExample.RunnerTests

EXTENSIONS

  • rocks.outdatedguy.packageRenameExample.Share-Extension
  • rocks.outdatedguy.packageRenameExample.NotificationServiceExtension
  • blah blah blah...

Hence, to properly change the PRODUCT_BUNDLE_IDENTIFIER without removing the Extension name, make sure all PRODUCT_BUNDLE_IDENTIFIER's except the DEFAULT ones are enclosed in double quotes ("").

- PRODUCT_BUNDLE_IDENTIFIER = rocks.outdatedguy.packageRenameExample.Share-Extension;
+ PRODUCT_BUNDLE_IDENTIFIER = "rocks.outdatedguy.packageRenameExample.Share-Extension";

And that's it! 🎉

Now you can deploy your production ready app to change the WORLD!

If you liked the package, then please give it a Like 👍🏼 and Star ⭐

所属分类

依赖

依赖清单 3 项

源码仓库

使用此插件的项目

暂无相关数据。