Redwarp
Redwarp

Reputation: 3231

Batch replace copyright comment in XCode

I've been working on an iOS project for some time now, creating hundreds of source files, and now that's it's good and done, I realize something sad : I edit the copyright file template before getting to work, and all of my files have this lame format :

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

And that's not cool ! I would like to replace it with something more like that :

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

Copyright 2013 Redwarp <[email protected]>
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.
*/

Anyway. I could probably write a script, that searches all my files and replace the first "//" lines with a better comment, but I'm sure there is a tool out there that does that perfectly.

Except : I can't find that tool anywhere.

Would anyone know of such a tool ? (Or might it be that I'm a fool ?)

Upvotes: 7

Views: 1726

Answers (1)

Redwarp
Redwarp

Reputation: 3231

I ended up using the script I found here : http://gergap.wordpress.com/2009/06/03/howto-recursively-replace-file-headers-of-source-files/

Does exactly the job I wanted to do, and spared me the burden of doing it myself.

Upvotes: 6

Related Questions