GWT: 2.6 -> 2.8 System.getProperty("line.separator") 不再受支持



我正在更新我的libgdx游戏以使用GWT 2.8而不是2.6。但是,我遇到了编译器不接受我对System.getProperty("line.separator"(的几次调用的问题:

[ERROR] Errors in 'com/hgames/core/dm/grid/TextMapParser.java'
[ERROR] Line 138: Property 'line.separator' is not defined.

我很困惑,因为它之前被接受过,我找不到有关系统属性模拟的信息。我正在使用gradle构建并使用"gwtVersion='2.8.0'"指定gwt的版本。

这是自 2.8.0-beta1 (http://www.gwtproject.org/release-notes.html#Release_Notes_2_8_0_BETA1( 以来的新功能。您可以使用 System.getProperty 在 gwt 中获取用户定义的属性.xml也可以使用命令行 (-setProperty( 获取用户定义的属性。

使用命令行:

在您的模块中

<define-configuration-property name="project.version" is-multi-valued="false"/>

在你的 gwt 编译器/开发模式命令行中

-setProperty project.version=1.2.3

示例 https://github.com/ibaca/gwt-dagger2-coffee

仅使用模块:

在您的模块中

<define-configuration-property name="someConfigurationProperty" is-multi-valued='false'/>
<set-configuration-property name="someConfigurationProperty" value="conf"/>

示例 https://github.com/gwtproject/gwt/blob/a90832fec9a56f4cb83ed009c7048e0a8d196fe8/user/test/com/google/gwt/emultest/java/lang/SystemTest.java#L320

最新更新