使用Sharpen时遇到问题。 我一步一步地跟着this link。
这里有一个与Sharpen无关的愚蠢的事情,但我认为是Ant。
它给了我:
Buildfile: C:\Users\Peyman\Workspace\MyZoneCore\src\run-sharpen.xml
clean:
sharpen-docs:
[exec] Error: Could not find or load main class org.eclipse.equinox.launcher.Main
BUILD FAILED
C:\Users\Peyman\Workspace\MyZoneCore\src\run-sharpen.xml:59: The following error occurred while executing this line:
C:\Users\Peyman\Workspace\MyZoneCore\src\run-sharpen.xml:20: exec returned: 1
Total time: 780 milliseconds
构建文件:
<?xml version="1.0"?>
<project name="Db4objects.Db4odoc" default="sharpen-docs">
<property file="sharpen.properties" />
<macrodef name="reset-dir">
<attribute name="dir" />
<sequential>
<delete dir="@{dir}" />
<mkdir dir="@{dir}" />
</sequential>
</macrodef>
<echo message="${eclipse.startup.jar}"></echo>
<macrodef name="sharpen">
<attribute name="workspace" />
<attribute name="resource" />
<element name="args" optional="yes" />
<sequential>
<exec executable="C:\Program Files\Java\jdk1.6.0_31\bin\java.exe" failonerror="true" timeout="1800000">
<arg value="-Xms256m" />
<arg value="-Xmx512m" />
<arg value="-cp" />
<arg value="${eclipse.startup.jar}" />
<arg value="org.eclipse.equinox.launcher.Main" />
<arg value="-data" />
<arg file="@{workspace}" />
<arg value="-application" />
<arg value="sharpen.core.application" />
<arg value="-header" />
<arg file="header.txt" />
<arg value="@{resource}" />
<args />
</exec>
</sequential>
</macrodef>
<!-- Main target -->
<target name="sharpen-docs" depends="clean">
<property name="target.dir" location="sharpen" />
<!-- Copy java files to the resource folder -->
<copy todir="${target.dir}/sharpened/src">
<!-- CHECK THIS SETTING
Make sure that the fileset dir below points to the root folder
containing the Java source code files you want to convert to C#
-->
<fileset dir="src">
<include name="**/*.java" />
</fileset>
</copy>
<!-- Sharpen java files -->
<sharpen workspace="${target.dir}" resource="sharpened/src">
<args>
<!-- CHECK THIS SETTING
Make sure that you have an arg value/path element for
EVERY external jar file that your Java project references.
You can get the list of these by right clicking on the project,
choosing Build Path -> Configure Build Path, and then checking the Libraries tab.
-->
<!-- classpath needed for java sources compilation -->
<arg value="-cp" />
<arg path="C:/eclipse/workspace/myproject/libs/kxml2-2.3.0.jar" />
<arg value="-cp" />
<arg path="C:/eclipse/workspace/myproject/libs/regexp-me.jar" />
<!-- Sharpen options are defined in a separate file -->
<arg value="@sharpen-all-options" />
</args>
</sharpen>