This isn’t really HaxeFlixel related, but I encountered an issue when I recently upgraded my haxelibs.
Haxelib is a collection of haxe (.hx) files that expand on existing Haxe language to make life easier for the developer. OpenFL, a game framework, is a haxelib. HaxeFlixel is also a haxelib that expands on OpenFL.
The issue I faced was — I upgraded my OpenFL version from 2.2.8 to 3.0.0-beta. The framework apparently has been overhauled, and as a result, broke HaxeFlixel’s API. In fact, I couldn’t even get an empty HaxeFlixel template project to compile.
So here’s a note for awareness:
Use this command to upgrade all your existing libraries to the latest version:
1 |
haxelib upgrade |
Use this command to check the library info (which mentions the library versions):
1 2 3 4 5 |
haxelib info <library name> // examples haxelib info flixel haxelib info openfl |
Use this command to upgrade/downgrade your library:
1 |
haxelib set openfl 2.2.8 |
As such, I had to downgrade my OpenFL version to 2.2.8 in order for HaxeFlixel to work again. So, if you ever encounter a problem with compiling your code even though it was never modified, check if the haxelib upgrades broke anything. 🙂
EDIT:
Ashiq brought up an idea in the comments, which I overlooked — you can set your haxelib versions for your individual projects. This would help ensure your older projects do not risk getting broken by future haxelib upgrades.
As shown in the OpenFL XML format page, you just have to go to your Project.xml file and add a “version” property to your include code, something like this:
1 |
<haxelib name="actuate" version="1.0.0" /> |
My bad, should have googled it first. The answer is on the OpenFL XML format page: http://www.openfl.org/documentation/projects/project-files/xml-format/
You can specify a version as well. This allows you to install multiple versions on your machine, and easily switch. It also gives you consistent results when you share code with others (everyone installs the same versions).
Hi Ashiq, that’s something I didn’t think about (different haxelib versions for different projects). But it’s good to hear you found your answer. I’ll edit the post with your info, this will come in handy. Thanks! 🙂
Is there a way to specify specific library versions in your project XML/config instead of upgrading/downgrading?