rimerosolutions / ant-git-tasks

Ant tasks for Git with JGit
Apache License 2.0
41 stars 39 forks source link

Fix AddTask on Windows #2

Closed fafriat closed 10 years ago

fafriat commented 10 years ago

Hi,

I fixed the AddTask to be able to add files from sub-directories on Windows (using backslash does not work with jgit).

Thanks you for your useful project.

Regards,

Frank

yveszoundi commented 10 years ago

Frank, thank you for contribution and your effort, it looks good.

I've got 2 questions:

If I recall correctly, I initially had this project setup with Maven. I moved it to Ivy just because of the primary goal of the project which is to provide Apache Ant Git tasks. I don't use Ant myself that much anymore. I don't mind integrating again a Maven POM though, is it mainly about convenience, IDE integration?

Yves

fafriat commented 10 years ago

Hi Yves,

Thanks for your reply.

1) I tried to build it using the provided scripts but it was not working for me. Also I am using maven and wanted to use the maven-antrun-plugin with the git tasks. 2) For the tests, I agree it was not complete but my change was small and as the build was not working for me, I was counting on you for running them all :-), perhaps you may avoid ivy/ant by using the maven-antrun-plugin to run the tests ?

Regards,

Frank

2014-02-02 Yves Zoundi notifications@github.com:

Frank, thank you for contribution and your effort, it looks good.

I've got 2 questions:

  • Is there a specific reason for the Maven pom.xml to exist?
  • I see that only one AntUnit test gets executed. Run into classpath issues? I can give it another try.

If I recall correctly, I initially had this project setup with Maven. I moved it to Ivy just because of the primary goal of the project which is to provide Apache Ant Git tasks. I don't use Ant myself that much anymore. I don't mind integrating again a Maven POM though, is it mainly about convenience, IDE integration?

Yves

Reply to this email directly or view it on GitHubhttps://github.com/rimerosolutions/ant-git-tasks/pull/2#issuecomment-33906258 .

fafriat commented 10 years ago

Hi,

Just one remark: the pull request was on the commit:Fix AddTask on Windowshttps://github.com/rimerosolutions/ant-git-tasks/pull/2

which is not including the addition of the pom.

Regards,

Frank

2014-02-02 Yves Zoundi notifications@github.com:

Frank, thank you for contribution and your effort, it looks good.

I've got 2 questions:

  • Is there a specific reason for the Maven pom.xml to exist?
  • I see that only one AntUnit test gets executed. Run into classpath issues? I can give it another try.

If I recall correctly, I initially had this project setup with Maven. I moved it to Ivy just because of the primary goal of the project which is to provide Apache Ant Git tasks. I don't use Ant myself that much anymore. I don't mind integrating again a Maven POM though, is it mainly about convenience, IDE integration?

Yves

Reply to this email directly or view it on GitHubhttps://github.com/rimerosolutions/ant-git-tasks/pull/2#issuecomment-33906258 .

yveszoundi commented 10 years ago

Hello Frank, thanks for the details.

I think it's worth integrating the POM, as it showcases well Maven integration and related issues.

I managed to get it to work for the tests after about one hour :-) Let me know what you think about this relevant portion of the Maven POM. Tests run as part of surefire tests in the test phase. Adding your execution phase back is also better to illustrate the use inside Maven vs the testing aspect of the project as show below.

<plugin>
 <artifactId>maven-antrun-plugin</artifactId>
 <version>1.6</version>

 <dependencies>
  <dependency>
   <groupId>org.eclipse.jgit</groupId>
   <artifactId>org.eclipse.jgit</artifactId>
   <version>3.2.0.201312181205-r</version>
  </dependency>
  <dependency>
   <groupId>com.jcraft</groupId>
   <artifactId>jsch</artifactId>
   <version>0.1.50</version>
  </dependency>
  <dependency>
   <groupId>com.rimerosolutions.ant</groupId>
   <artifactId>ant-git-tasks</artifactId>
   <version>${project.version}</version>
  </dependency>
  <dependency>
   <groupId>org.apache.ant</groupId>
   <artifactId>ant-antunit</artifactId>
   <version>1.2</version>
  </dependency>
  <dependency>
   <groupId>org.apache.ant</groupId>
   <artifactId>ant-launcher</artifactId>
   <version>1.8.2</version>
  </dependency>
  <dependency>
   <groupId>org.apache.ant</groupId>
   <artifactId>ant</artifactId>
   <version>1.8.2</version>
  </dependency>
 </dependencies>

 <executions>
  <execution>
   <id>test ant tasks in maven</id>
   <phase>test</phase>
   <goals>
    <goal>run</goal>
   </goals>
   <configuration>
    <target xmlns:git="antlib:com.rimerosolutions.ant.git" 
            xmlns:au="antlib:org.apache.ant.antunit"
            unless="maven.test.skip">

     <copy todir="${java.io.tmpdir}/ant-git-tasks" overwrite="true">
      <fileset dir="${project.basedir}/src/test/resources" includes="*.txt"/>
     </copy>

     <taskdef uri="antlib:com.rimerosolutions.ant.git"
              resource="com/rimerosolutions/ant/git/jgit-ant-lib.xml"
              classpath="${plugin_classpath}"/>

     <path id="testData.location">
      <pathelement location="${java.io.tmpdir}/ant-git-tasks"/>
     </path>

     <path id="test.classpath">
      <path refid="maven.test.classpath"/>
     </path>

     <path id="compile.classpath">
      <path refid="maven.compile.classpath"/>
     </path>

     <path id="classes.location">
      <pathelement location="${project.build.outputDirectory}"/>
     </path>

     <au:antunit failonerror="false" errorproperty="antunit.failed">
      <referenceset>
       <reference refid="compile.classpath"/>
       <reference refid="classes.location"/>
       <reference refid="test.classpath"/>
       <reference refid="testData.location"/>
      </referenceset>

      <fileset dir="${project.basedir}/src/test/resources" includes="*.xml"/>

      <au:plainlistener/>
     </au:antunit>

     <delete dir="${java.io.tmpdir}/ant-git-tasks" quiet="true"/>

    </target>
   </configuration>
  </execution>
 </executions>
</plugin>
fafriat commented 10 years ago

Hi,

Thank you very much for giving access to maven for building the project (when building with ivy is not working).

Your pom.xml works fine for building the project and running the tests.

I saw you renamed the pom to example-pom.xml and I suppose that you need to keep the old build mechanism for now because of other tasks you didn't port to maven.

What about releasing your version 1.0 ?

Regards,

Frank

yveszoundi commented 10 years ago

Hello Frank,

You're welcome. Thanks for validating the build and behaviour on your side.

Ivy should work all the time. In Apache Ant Git tasks, Ant is bootstrapped via Ant-wrapper(https://github.com/rimerosolutions/ant-wrapper). There's an antw script at the root of the project.

Ideally either ant-wrapper or Ant 1.8.0+ should be used. I suspect that you might have been using Ant < 1.8.0 either standalone or within the IDE? I also build with JDK6 only for compatibility reasons, I haven't tested JDK7 a lot.

I renamed the pom.xml to example-pom.xml as Maven is not really meant to be the main build tool of this Apache Ant "based" project. Maven would be an alternative for integration mainly. That said, it should be possible to port all the build aspects to Maven without much pain (findbugs, cobertura, etc.).

I am planning on releasing a new version soon, version is 0.0.1 on Maven Central. I guess there was enough iterations to jump to a 1.0.0 release, as hinted in the properties/release.properties file of the project.

Thanks, Yves