【发布时间】:2015-07-15 19:39:13
【问题描述】:
我正在 Haxe 开始我的第一个严肃项目,但我遇到了一些障碍。
问题是,如果我尝试在 Main.hx 以外的文件中编写一个类,它不会被编译。我尝试过使用 import 但这似乎不起作用。
我使用 vim 作为我的 ide,并带有一些不错的插件(Youcompleteme、syntastic 和 vaxe),唯一的 haxelib 是 openfl。
这是我使用命令 openfl create project 时创建的样板:
项目.xml
<?xml version="1.0" encoding="utf-8"?>
<project>
<meta title="ProjetSession" package="com.sample.projetsession" version="1.0.0" company="Company Name" />
<app main="Main" path="Export" file="ProjetSession" />
<source path="Source" />
<haxelib name="openfl" />
<assets path="Assets" rename="assets" exclude="openfl.svg" />
<icon path="Assets/openfl.svg" />
</project>
ProjetSession.hxproj
<?xml version="1.0" encoding="utf-8"?>
<project version="2">
<!-- Output SWF options -->
<output>
<movie outputType="CustomBuild" />
<movie input="" />
<movie path="project.xml" />
<movie fps="30" />
<movie width="800" />
<movie height="600" />
<movie version="1" />
<movie minorVersion="0" />
<movie platform="Lime" />
<movie background="#FFFFFF" />
<movie preferredSDK=";3;" />
</output>
<!-- Other classes to be compiled into your SWF -->
<classpaths>
<class path="D:\Development\Haxe\openfl" />
<class path="d:\Development\Haxe\lime" />
<class path="Source" />
<class path="Export\html5\haxe" />
</classpaths>
<!-- Build options -->
<build>
<option directives="openfl=3.0.0-beta
lime=2.1.3
tools=2.1.3
no-compilation
openfl-html5
canvas
lime-html5
html5
web
html5" />
<option flashStrict="False" />
<option noInlineOnDebug="False" />
<option mainClass="ApplicationMain" />
<option enabledebug="False" />
<option additional="--remap flash:openfl
--macro allowPackage("flash")" />
</build>
<!-- haxelib libraries -->
<haxelib>
<!-- example: <library name="..." /> -->
</haxelib>
<!-- Class files to compile (other referenced classes will automatically be included) -->
<compileTargets>
<!-- example: <compile path="..." /> -->
</compileTargets>
<!-- Paths to exclude from the Project Explorer tree -->
<hiddenPaths>
<hidden path="obj" />
</hiddenPaths>
<!-- Executed before build -->
<preBuildCommand>"$(CompilerPath)/haxelib" run lime build "$(OutputFile)" $(TargetBuild) -$(BuildConfig) -Dfdb</preBuildCommand>
<!-- Executed after build -->
<postBuildCommand alwaysRun="False" />
<!-- Other project options -->
<options>
<option showHiddenPaths="False" />
<option testMovie="Custom" />
<option testMovieCommand="" />
</options>
<!-- Plugin storage -->
<storage />
</project>
vaxe自动生成hml文件
【问题讨论】: