Copy link to clipboard
Copied
Hi all,
I've got a simple request. All I want to do is to automate the revision number of the .aip generated.
For all samples published in the SDK, this is defined in the sdkdef.h. But this is static!
Foreach revision, this number must be changed manually.
My wish is that this number will be incremented automatically at each compilation.
Does anyone know how to do?
Best regards,
Thomas
Ok the way I achieved this is a bit clunky but it sort of works. This is also XCode specific so I'm assuming you're using a Mac.
I actually created my own Illustrator plugin XCode project template for this which includes my own version of SDKDef.h with a slightly different name. The advantage of this is that you can change your revision number without affecting any other plugins that rely on the SDK. Creating project templates is quite powerful and surprizingly easy in XCode, there are some li
...Copy link to clipboard
Copied
The only way I can think of would be to write a simple script that increments the plugin's VERSION_INFO resource and firing that off in the pre-build step in your project (on Windows). I'm not sure where the version information is kept on Mac, but in theory it'd be even easier to do since you have full Unix-type scripting available.
Copy link to clipboard
Copied
Sorry if I'm raising a dead thread here, but I have done this on a Mac with XCode and can provide some tips if anyone's interested.
-W
Copy link to clipboard
Copied
it would be great!
I would be interested in having some tips about this.
Best regards,
Thomas.
Copy link to clipboard
Copied
Ok the way I achieved this is a bit clunky but it sort of works. This is also XCode specific so I'm assuming you're using a Mac.
I actually created my own Illustrator plugin XCode project template for this which includes my own version of SDKDef.h with a slightly different name. The advantage of this is that you can change your revision number without affecting any other plugins that rely on the SDK. Creating project templates is quite powerful and surprizingly easy in XCode, there are some links at the bottom on how to do this.
Bottom line is, you need to either edit the SDKDef.h file or create your own and point your project to it. If this is just a one off then you can ignore the project template stuff.
Lets assume you've created your own SDKDef.h file, called it MYSDKDef.h and put it in the ./Source/ folder of your plugin's project folder.
In XCode, edit your project's build settings and change the Info.plist Preprocessor Prefix File to point to your new file: ./Source/MYSDKDef.h (it will have originally been something like <pathtosdk>/common/includes/SDKDef.h)
You'll also need to add a new Build Phase to your Target, so right click on your Target and choose Add->New Build Phase->New Run Script Build Phase. You'll want to add your new build phase after the Copy Headers phase and before the Compile Sources phase.
Now I created a perl script to actually change the revision number in the file, but you could just as easily use a bash script or some other scripting language. The main thing to do is to change the kSDKDefAIBuildNumber, kSDKDefAIMinorVersionNum, kSDKDefAIMajorVersionNum or kSDKDefAIRevisionVersionNum, but you already know this.
So you can either paste your script into the box in the new Run Script Build Phase Info window or you can save your script as a file and just run it from there, I chose the latter so my build phase looks something like this:
perl "$PROJECT_DIR/UpdateVersion.pl" "$PROJECT_DIR/Source/MYSDKDef.h" $AI_CONFIGURATION $PROJECTNAME
As you can see, I'm passing some parameters to my script.
$AI_CONFIGURATION = Debug/Release
$PROJECT_DIR = <Your project's root directoy>
$PROJECTNAME = The name of your project
My perl script does nothing if $AI_CONFIGURATION == "Debug"
I'm sure there are better ways to do this but this works for me.
Creating XCode project templates:
http://briksoftware.com/blog/?p=28
Copy link to clipboard
Copied
thank a lot for the quick reply!
I'll try and let you know if I've got some issues.
Best regards,
Thomas.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now