All Projects → onevcat → Fengniao

onevcat / Fengniao

Licence: mit
A command line tool for cleaning unused resources in Xcode.

Programming Languages

swift
15916 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to Fengniao

Assetchecker
👮Sanitize your Assets.xcassets files
Stars: ✭ 167 (-94.14%)
Mutual labels:  cleanup, xcode, images, slim
Stylesync
A command line tool to extract shared styles from a Sketch document, and generate native code for any platform.
Stars: ✭ 382 (-86.61%)
Mutual labels:  command-line-tool, xcode
Bulksplash
A simple command line tool that lets you bulk download images from Unsplash
Stars: ✭ 362 (-87.31%)
Mutual labels:  command-line-tool, images
R.swift
Strong typed, autocompleted resources like images, fonts and segues in Swift projects
Stars: ✭ 8,419 (+195.2%)
Mutual labels:  xcode, resources
Localize
🏁 Automatically clean your Localizable.strings files
Stars: ✭ 311 (-89.1%)
Mutual labels:  cleanup, xcode
Ascii Art
A Node.js library for ansi codes, figlet fonts, ascii art and other ASCII graphics
Stars: ✭ 437 (-84.68%)
Mutual labels:  command-line-tool, images
Xcov
Nice code coverage reporting without hassle
Stars: ✭ 467 (-83.63%)
Mutual labels:  command-line-tool, xcode
Xcperfect
Make your xccov outputs prettier ✨
Stars: ✭ 56 (-98.04%)
Mutual labels:  command-line-tool, xcode
Suitcase
A flexible command line tool for instantly deploying user interfaces for simple commands and scripts.
Stars: ✭ 1,287 (-54.87%)
Mutual labels:  command-line-tool, xcode
Hmap
hmap is a command line tool written in Swift to work with Clang header maps produced by Xcode.
Stars: ✭ 110 (-96.14%)
Mutual labels:  command-line-tool, xcode
Xcassetpacker
A command line tool for converting a folder of images into an .xcasset package for Xcode
Stars: ✭ 150 (-94.74%)
Mutual labels:  xcode, images
Marathon
[DEPRECATED] Marathon makes it easy to write, run and manage your Swift scripts 🏃
Stars: ✭ 1,889 (-33.77%)
Mutual labels:  command-line-tool, xcode
You Dont Need Gui
Stop relying on GUI; CLI **ROCKS**
Stars: ✭ 4,766 (+67.11%)
Mutual labels:  command-line-tool, resources
Index Import
Tool to import swiftc and clang index-store files into Xcode
Stars: ✭ 240 (-91.58%)
Mutual labels:  xcode
Free Programming Resources
💎 免费的编程资源大全,持续更新!🔥 覆盖各种语言和方向(Java \ Python \ C++ \ JavaScript \ Golang \ 前端 \ 后端等)的学习路线、贴心教程、项目实战、编程书籍、面试合集、实用资源等,对程序员非常有帮助!
Stars: ✭ 225 (-92.11%)
Mutual labels:  resources
Parsr
Transforms PDF, Documents and Images into Enriched Structured Data
Stars: ✭ 2,736 (-4.07%)
Mutual labels:  images
Geeqie
claiming to be the best image viewer / photo collection browser
Stars: ✭ 239 (-91.62%)
Mutual labels:  images
Iterm Fish Fisher Osx
Complete guide and Bash script to install Command Line Tools + Homebrew + iTerm2 + Fish Shell + Fisher + Plugins for development purposes
Stars: ✭ 249 (-91.27%)
Mutual labels:  command-line-tool
Pdf Unstamper
Remove textual watermark of any font, any encoding and any language with pdf-unstamper now!
Stars: ✭ 245 (-91.41%)
Mutual labels:  command-line-tool
Dtpagercontroller
A fully customizable container view controller to display a set of ViewControllers in a horizontal scroll view. Written in Swift.
Stars: ✭ 240 (-91.58%)
Mutual labels:  xcode

FengNiao

What

FengNiao is a simple command-line util to deleting unused image resource files from your Xcode project.

How

Install

You need Swift Package Manager (as well as swift compiler) installed in your macOS; generally you are prepared if you have the latest Xcode installed.

Compile from source

> git clone https://github.com/onevcat/FengNiao.git
> cd FengNiao
> ./install.sh

FengNiao should be compiled, tested and installed into the /usr/local/bin.

Homebrew

You may want to install in from Homebrew. But for now it is not supported.

Usage

Just navigate to your project folder, then:

> fengniao

It will scan current folder and all its subfolders to find unused images, then ask you whether you want to delete them. Please make sure you have a backup or a version control system before you deleting the images; it will be an un-restorable operation.

FengNiao supports some arguments. You can find it by:

> fengniao --help

  -p, --project:
      Root path of your Xcode project. Default is current folder.
  --force:
      Delete the found unused files without asking.
  -e, --exclude:
      Exclude paths from search.
  -r, --resource-extensions:
      Resource file extensions need to be searched. Default is 'imageset jpg png gif pdf'
  -f, --file-extensions:
      In which types of files we should search for resource usage. Default is 'm mm swift xib storyboard'
  --version:
      Print version.
  -h, --help:
      Print this help message.

A more daily-work usage under a project could be:

> fengniao --project . --exclude Carthage Pods

This will search in current folder, but skip the Carthage and Pods folder, in which there might be some third party resources you do not want to touch.

Use with Xcode build phase

It is easy to integrate FengNiao into your Xcode build process. By doing so, you could ensure your project being cleaned every time you build your project.

Add a "Run Script" phase in the Build Phases tab:

Then drag it above of "Copy Bundle Resources", editing its content to something like this:

fengniao --exclude Carthage --force

It is recommended to exclude vendor's folders like Pods or Carthage. Since you do not have a chance to confirm the result, you also need to add --force option.

How it works

  1. Extract resource file names (default file type: ["imageset", "jpg", "png", "gif", "pdf"]) in these folders ["imageset", "launchimage", "appiconset", "bundle”].
  2. Use regular expression to search all string names in files (default files type: ["m", "mm", "swift", "xib", "storyboard", "plist"]).
  3. Exclude all used string names from resources files, we get all unused resources files.

License and Information

FengNiao is open-sourced as MIT license. The name of this project comes from the Chinese word 蜂鸟 (hummingbird), which is the smallest bird in the world.

Submit an issue if you find something wrong. Pull requests are warmly welcome, but I suggest to discuss first.

You can also follow and contact me on Twitter or Sina Weibo.

Learning to Create

I streamed the way I created this tool as a live-coding session in a live platform in China. You can learn how to create a project with Swift Package Manager, how to apply Protocol-Oriented Programming (POP) in the project, and how to develop in a BDD way as well as write good tests there.

It is a paid series lesson in Chinese. If you are interested in it, please check and watch the links below:

现场编程 - 用 Swift 创建命令行工具 fengniao-cli

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].