Created
May 5, 2016 21:12
-
-
Save JohannMG/1416a59faff1b903650f7877c6d7d9b0 to your computer and use it in GitHub Desktop.
Python script to add header file to all files in a library. (This may be the worst thing I've done in a while... But it got the build working!)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def appendWithImport(filename): | |
with open (filename, "r+") as file: | |
original = file.read() | |
file.seek(0,0) | |
file.write("@import Foundation; \n" + original) | |
files = [ | |
"ZXingObjC-modified/aztec/decoder/ZXAztecDecoder.h", | |
"ZXingObjC-modified/aztec/detector/ZXAztecDetector.h", | |
"ZXingObjC-modified/aztec/encoder/ZXAztecBinaryShiftToken.h", | |
"ZXingObjC-modified/aztec/encoder/ZXAztecCode.h", | |
"ZXingObjC-modified/aztec/encoder/ZXAztecEncoder.h", | |
"ZXingObjC-modified/aztec/encoder/ZXAztecHighLevelEncoder.h", | |
"ZXingObjC-modified/aztec/encoder/ZXAztecSimpleToken.h", | |
"ZXingObjC-modified/aztec/encoder/ZXAztecState.h", | |
] | |
for filename in files: | |
appendWithImport(filename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment