mono / sharpen

Sharpen is an Eclipse plugin created by db4o that allows you to convert your Java project into c#
GNU General Public License v2.0
381 stars 141 forks source link

Does not build #62

Open steveww opened 9 years ago

steveww commented 9 years ago

Lots of errors about annotations and missing ;

lilith commented 9 years ago

Could you provide more detail? We have automated CI running on https://github.com/imazen/sharpen

steveww commented 9 years ago

OK fixed the build by configuring the mvn compiler plugin and now I have a successful build.

Alas trying to run it fails as it can't find its properties file. No mention of the properties file in the README?

steveww commented 9 years ago

OK now hacked the class path with an empty properties file and successfully ran the command line with just the -help switch. Just got a load of null output :-(

I would say that this is currently a totally broken release. Is this still maintained? May be I am in the wrong repo here?

lilith commented 9 years ago

That's quite strange; it worked out of the box on several platforms and CIs. We're actively using it and improving different features. My suspicion is that you are, somehow, looking at the wrong branch or codebase.

steveww commented 9 years ago

No idea if/how that happened, I just did the usual

git clone mvn clean test BANG! It blew up it my face.

lilith commented 9 years ago

What version of maven and the jvm are you using?

steveww commented 9 years ago

java version "1.7.0_67" Java(TM) SE Runtime Environment (build 1.7.0_67-b01) Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

Apache Maven 3.0.5 Maven home: /usr/share/maven Java version: 1.7.0_67, vendor: Oracle Corporation Java home: /opt/jdk1.7.0_67/jre Default locale: en_GB, platform encoding: UTF-8 OS name: "linux", version: "3.13.0-53-generic", arch: "amd64", family: "unix"

steveww commented 9 years ago

The pom.xml is wrong, it does not specify source for the compiler and it does not package sharpen.properties in to the jar file. The compiler plugin must be specified:

http://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html

Currently not sure how to get the properties file included, I am more of an ant guy.

kaby76 commented 8 years ago

Same here: pom.xml is wrong because it does not specify maven-compiler-plugin, so when typing "mvn clean test", it results in "Annotations are not supported in -source 1.3", i.e., java 1.3! The source for pom.xml should be this. (I am neither a maven nor ant person, but it works with a successful build and test. I added lines to use Java 1.7--as per instructions.)

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>sharpen</groupId>
  <artifactId>sharpencore</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>sharpencore</name>
  <url>https://github.com/imazen/sharpen</url>
    <organization>
        <name>Imazen</name>
        <url>http://www.imazen.io</url>
    </organization>
    <licenses>
        <license>
            <name>GPL 2 </name>
            <url>http://www.gnu.org/licenses/gpl-2.0.html</url>
            <distribution>repo</distribution>
            <comments>GPL 2 License</comments>
        </license>
    </licenses>
    <developers>
        <developer>
            <id>1</id>
            <name>Nathanael Jones</name>
            <email>nathanael.jones@gmail.com</email>
            <organization>Imazen</organization>
            <organizationUrl>http://www.imazen.io</organizationUrl>
            <roles>
                <role>Architect</role>
                <role>Developer</role>
            </roles>
            <timezone>-5</timezone>
        </developer>
        <developer>
            <id>2</id>
            <name>Yakov Danilov</name>
            <email>yakodani@gmail.com</email>
            <organization>imazen.io</organization>
            <organizationUrl>http://www.imazen.io</organizationUrl>
            <roles>
                <role>Developer</role>
            </roles>
            <timezone>+3</timezone>
        </developer>
    </developers>
    <issueManagement>
        <system>github</system>
        <url>https://github.com/imazen/sharpen/issues</url>
    </issueManagement>
    <ciManagement>
        <system>travis</system>
        <url>https://travis-ci.org/imazen/sharpen</url>
    </ciManagement>
    <scm>
        <connection>scm:git:github.com:imazen/sharpen.git</connection>
        <developerConnection>scm:git:github.com:imazen/sharpen.git</developerConnection>
        <url>https://github.com/imazen/sharpen</url>
    </scm>
    <!--<distributionManagement>-->
        <!--<downloadUrl>https://oss.sonatype.org/content/groups/public</downloadUrl>-->
        <!--<repository>-->
            <!--<id>oss.sonatype.org</id>-->
            <!--<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>-->
        <!--</repository>-->
        <!--<snapshotRepository>-->
            <!--<id>oss.sonatype.org</id>-->
            <!--<url>https://oss.sonatype.org/content/repositories/snapshots</url>-->
        <!--</snapshotRepository>-->
        <!--<site>-->
            <!--<id>parent.jcabi.com</id>-->
            <!--<url>http://parent.jcabi.com/</url>-->
        <!--</site>-->
    <!--</distributionManagement>-->

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   <finalName>${project.artifactId}-${project.version}</finalName>
  </properties>

  <dependencies>

    <dependency>
      <groupId>org.eclipse.jdt</groupId>
      <artifactId>org.eclipse.jdt.core</artifactId>
      <version>3.7.1</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.core</groupId>
      <artifactId>runtime</artifactId>
      <version>3.10.0-v20140318-2214</version>
    </dependency>
     <dependency>
      <groupId>org.eclipse.equinox</groupId>
      <artifactId>common</artifactId>
      <version>3.6.200-v20130402-1505</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.osgi</groupId>
      <artifactId>org.eclipse.osgi</artifactId>
      <version>3.6.0.v20100517</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.4</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <directory>src/target</directory>
    <outputDirectory>src/target/classes</outputDirectory>
    <finalName>${finalName}</finalName>
    <testOutputDirectory>src/target/testcases</testOutputDirectory>
    <sourceDirectory>src/main</sourceDirectory>
    <scriptSourceDirectory>src/main/resources</scriptSourceDirectory>
    <testSourceDirectory>src/test</testSourceDirectory>
    <resources>
      <resource>
        <directory>src/test/resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
      </testResource>
    </testResources>

    <plugins>

      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <mainClass>sharpen.core.SharpenCmd</mainClass>
            </manifest>
          </archive>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id> <!-- this is used for inheritance merges -->
            <phase>package</phase> <!-- bind to the packaging phase -->
            <goals>
            <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>

    </plugins>

  </build>

  <profiles>
    <profile>
        <!--
        Static quality analysis with Qulice and other tools.
        This profile is supposed to be activated in continuous
        integration environment, right before the final approval
        of the build. It runs a number of static code analysis
        tools to validate and approve the quality of source
        code and the SCM repository.
        @see http://www.jcabi.com/jcabi-parent/profile-qulice.html
        -->
        <id>qulice</id>
        <build>
            <plugins>
                <plugin>
                    <!--
                    Qulice-maven-plugin is a compound static analysis
                    tool that aggregates Checkstyle, PMD, FindBugs,
                    CodeNarc (for Groovy code) and a few other analyzers.
                    Qulice also configures them correctly to enable the
                    most important rules.
                    @see http://www.qulice.com/qulice-maven-plugin/
                    -->
                    <groupId>com.qulice</groupId>
                    <artifactId>qulice-maven-plugin</artifactId>
                    <version>0.12</version>
                    <executions>
                        <execution>
                            <id>sharpen-check</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                            <configuration>
                                <license>file:${basedir}/LICENSE.txt</license>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
  </profiles>
</project>
RippedWinnits commented 7 years ago

There is another error in the pom.xml causing the sharpen.properties error:

<resources>
      <resource>
        <directory>src/test/resources</directory>
      </resource>
    </resources>

should be

<resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>