批量替换XCode中的版权注释

Red*_*arp 7 xcode ios

我已经有一段时间在iOS项目上工作了,创建了数百个源文件,现在它已经很好用了,我意识到了一件令人伤心的事情:我在开始工作之前编辑了版权文件模板,并且我的所有文件都有这种蹩脚的格式:

//
//  MyClass.h
//
//  Created by Redwarp on 3/25/13.
//  Copyright (c) 2013 Redwarp. All rights reserved.
//
Run Code Online (Sandbox Code Playgroud)

这并不酷!我想用更像这样的东西代替它:

/* This software is licensed under the Apache 2 license, quoted below.

Copyright 2013 Redwarp <redwarp@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
*/
Run Code Online (Sandbox Code Playgroud)

无论如何.我可以编写一个脚本,搜索我的所有文件并用更好的注释替换第一行"//"行,但我确信有一个工具可以完美地完成.

除了:我无法在任何地方找到这个工具.

有人会知道这样的工具吗?(或者可能是我是个傻瓜?)

Red*_*arp 5

我最终使用了在这里找到的脚本:http : //gergap.wordpress.com/2009/06/03/howto-recursively-replace-file-headers-of-source-files/

确实完成了我想做的工作,并免除了我自己的工作负担。