我有一个 Java 库,我需要将其转换为 JS。我找到了解决方案GWT 创建实用的 javascript 库 https://stackoverflow.com/questions/3125556/gwt-to-create-utility-javascript-library使用 gwt 导出器。我以前从未使用过 GWT。我试过GWT-出口商。入门 https://code.google.com/p/gwt-exporter/wiki/GettingStarted但尚不清楚如何使用它。简单来说如何运行项目生成JS?
pom.xml
<dependencies>
<dependency>
<groupId>org.timepedia.exporter</groupId>
<artifactId>gwtexporter</artifactId>
<version>2.4.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
Java类:
import org.timepedia.exporter.client.ExporterUtil;
public class JS implements EntryPoint {
public void onModuleLoad() {
// Export all Exportable classes
ExporterUtil.exportAll();
}
}
哪里可以找到依赖项EntryPoint
?
也许有人可以分享工作示例?
https://code.google.com/p/gwt-exporter/wiki/GettingStarted https://code.google.com/p/gwt-exporter/wiki/GettingStarted很穷。
为了编译 JS 我添加了gwt-maven-plugin
.
我还创建了 .gwt.xml 文件,其中包含我的模块的描述。
以下依赖是强制性的
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<scope>provided</scope>
</dependency>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)