Print an error message if the HXP project class doesn't match the file name.
This is required but not obvious, so we should spell it out.
This commit is contained in:
@@ -104,6 +104,11 @@ class HXProject extends Script
|
||||
initialize();
|
||||
|
||||
var classRef = Type.resolveClass(inputData.name);
|
||||
if (classRef == null)
|
||||
{
|
||||
Log.error('Unable to find class ${ inputData.name } in ${ inputData.projectFile }');
|
||||
return;
|
||||
}
|
||||
var instance = Type.createInstance(classRef, []);
|
||||
|
||||
var serializer = new Serializer();
|
||||
@@ -372,7 +377,7 @@ class HXProject extends Script
|
||||
|
||||
var path = FileSystem.fullPath(Path.withoutDirectory(projectFile));
|
||||
var name = Path.withoutDirectory(Path.withoutExtension(projectFile));
|
||||
name = name.substr(0, 1).toUpperCase() + name.substr(1);
|
||||
name = name.charAt(0).toUpperCase() + name.substr(1);
|
||||
|
||||
var tempDirectory = System.getTemporaryDirectory();
|
||||
var classFile = Path.combine(tempDirectory, name + ".hx");
|
||||
@@ -419,6 +424,7 @@ class HXProject extends Script
|
||||
name: name,
|
||||
target: HXProject._target,
|
||||
debug: HXProject._debug,
|
||||
projectFile: projectFile,
|
||||
targetFlags: HXProject._targetFlags,
|
||||
templatePaths: HXProject._templatePaths,
|
||||
userDefines: HXProject._userDefines,
|
||||
|
||||
Reference in New Issue
Block a user