7

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

//
//  MyClass.h
//
//  Created by Redwarp on 3/25/13.
//  Copyright (c) 2013 Redwarp. All rights reserved.
//

这并不酷!我想用类似的东西代替它:

/* 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.
*/

反正。我可能会编写一个脚本,搜索我的所有文件并用更好的注释替换第一行“//”,但我确信有一个工具可以完美地做到这一点。

除了:我在任何地方都找不到那个工具。

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

4

1 回答 1

6

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

做我想做的工作,并且免除了我自己做的负担。

于 2013-04-17T09:08:36.030 回答