Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get application version number setup in the *-app.xml #926

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion starling/src/starling/utils/SystemUtil.as
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ package starling.utils
private static var sPlatform:String;
private static var sDesktop:Boolean;
private static var sVersion:String;
private static var sApplicationVersion:String;
private static var sAIR:Boolean;
private static var sEmbeddedFonts:Array = null;
private static var sSupportsDepthAndStencil:Boolean = true;
Expand Down Expand Up @@ -60,6 +61,7 @@ package starling.utils
var ds:String = appDescriptor.ns::initialWindow.ns::depthAndStencil.toString().toLowerCase();

sSupportsDepthAndStencil = (ds == "true");
sApplicationVersion = appDescriptor.ns::versionNumber;
sAIR = true;
}
catch (e:Error)
Expand Down Expand Up @@ -141,6 +143,13 @@ package starling.utils
initialize();
return sVersion;
}

/** Returns the application version number setup in the <em>*-app.xml</em>. */
public static function get applicationVersion():String
{
initialize();
return sApplicationVersion;
}

/** Returns the value of the 'initialWindow.depthAndStencil' node of the application
* descriptor, if this in an AIR app; otherwise always <code>true</code>. */
Expand Down Expand Up @@ -194,4 +203,4 @@ package starling.utils
return false;
}
}
}
}