4 Replies Latest reply on Dec 7, 2011 8:33 PM by Eric Cobb

    SVNAnt and CFBuilder 2

    Eric Cobb Level 1

      Can someone out there please tell me how to get svnant installed in CFBuilder 2?  I'm already using ant for some stuff within CFB with no problems, and I need to be able to connect it to subversion.  But, no matter what I do, I keep getting the below error:

       

      BUILD FAILED

      Problem: failed to create task or type svn

      Cause: The name is undefined.

       

      It's throwing that error as soon as it hits my <svn> tag in my build.xml file.  Everything I can find online about this says that I do not have svnant installed correctly. 

       

      I've gone into properties and added the jars to my Ant Home Entries, but that doesn't seem to do anything.  I've added them to every directory in program files/CFBuilder that looks like it can hold a jar, and that hasn't helped.  I've moved the jars around and restarted CFBuilder about a dozen times and still get the error.

       

      So I really don't know what else to do.  Anyone know how to get svnant up and running in CFB 2?

       

      Thanks,

       

      Eric

        • 1. Re: SVNAnt and CFBuilder 2
          Eric Cobb Level 1

          I think I'm making some progress, but I stil can't get it to work.  Here's my build file for those interested:

           

          <?xml version="1.0" encoding="utf-8"?>
          <project name="svn-test" default="tag" basedir="."> 
              
              <target name="init">
                  
                  <tstamp>
                      <format property="curDate" pattern="MM.dd.yy-HH.mm"/>    
                  </tstamp>
          
                  <property name="svn.base.url" value="http://myUrl:8080/svn/branches/test"/>                
                  <property name="svn.tag.url" value="http://myUrl:8080/svn/tags/${curDate}"/>    
            
                  <path id="path.svnant">
                      <fileset dir="lib">
                          <include name="**/*.jar" />
                      </fileset>
                  </path>            
              </target> 
          
              <target name="tag" depends="init">        
                  <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="path.svnant"/>    
                  <svn username="usr" password="pwd" javahl="true" svnkit="false" failonerror="true">            
                      <copy srcurl="${svn.base.url}" desturl="${svn.tag.url}" message=" [Build Script] created tag: ${curDate}" />        
                  </svn>            
              </target> 
          </project>
          

           

          Here's what's interesting, the first time I ran this I got the error "BUILD FAILED  C:\inetpub\wwwroot\AntScripts\svn-test\lib not found."  So, I created the lib directory where CFBuilder wanted it, and put the jars in there.  Now when I run it, I get this error:

           

          Buildfile: C:\inetpub\wwwroot\AntScripts\svn-test\build.xml

          init:

          tag:

            [typedef] Could not load definitions from resource org/tigris/subversion/svnant/svnantlib.xml. It could not be found.

           

          BUILD FAILED

          C:\inetpub\wwwroot\AntScripts\svn-test\build.xml:21: Problem: failed to create task or type svn

          Cause: The name is undefined.

          Action: Check the spelling.

          Action: Check that any custom tasks/types have been declared.

          Action: Check that any <presetdef>/<macrodef> declarations have taken place.

           

           

          I'm thinking that it's finding the jar files, there's just something about them that it doesn't like?  I'm not sure, does anyone have any suggestions?

          • 2. Re: SVNAnt and CFBuilder 2
            Eric Cobb Level 1

            Well, I think I'm getting closer.  I'm getting different error messages at least!  After looking through Marc Esher's SVNAnt example (here: https://github.com/marcesher/svnantexample), my build file now looks like this:

             

            <?xml version="1.0" encoding="utf-8"?>
            <project name="svn-test" default="svn.tag" basedir=".">
                <target name="init"> 
                    <tstamp>
                        <format property="curDate" pattern="MM.dd.yy-HH.mm"/>    
                    </tstamp>
                    <property name="svn.base.url" value="http://myurl:8080/svn/branches/staging"/>        
                    <property name="svn.tag.url" value="http://myurl:8080/svn/tags/${curDate}"/>    
            
                    <path id="project.classpath">
                        <fileset dir="lib">
                            <include name="**/*.jar" />
                        </fileset>
                    </path>
            
                    <echo message="Classpath includes: ${toString:project.classpath}" />
            
                </target>
            
            
                <target name="svn.tag" depends="init">
                    <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="project.classpath" />
                    <echo message="copying ${svn.base.url}" />
                    <svn svnkit="true" username="usr" password="pwd">
                        <copy srcurl="${svn.base.url}" desturl="${svn.tag.url}" message=" [Build Script] created tag: ${curDate}" />
                    </svn>
                </target>
            
            </project>
            

             

            I also have all of the .jar files from the example in my lib directory, and they show up correctly in the classpath "echo" message.  This time when I try to run my Ant script, I get the following message:

             

            Buildfile: C:\inetpub\wwwroot\AntScripts\svn-test\build.xml

            init:

                 [echo] Classpath includes: C:\inetpub\wwwroot\AntScripts\svn-test\lib\svnClientAdapter.jar;C:\inetpub\wwwroot\AntScr ipts\svn-test\lib\svnant.jar;C:\inetpub\wwwroot\AntScripts\svn-test\lib\svnjavahl.jar;C:\i netpub\wwwroot\AntScripts\svn-test\lib\svnkit.jar

            svn.tag:

                 [echo] copying http://myurl:8080/svn/branches/staging

             

            BUILD FAILED

            C:\inetpub\wwwroot\AntScripts\svn-test\build.xml:21: svn doesn't support the "svnkit" attribute

            Google is not much help when searching for "svn doesn't support the "svnkit" attribute".  So, I replaced svnkit="true" with javahl="true" and pretty much get the same thing, execpt the error says "Cannot use javahl nor command line svn client".  I've installed all of the svnkit components into CFBuilder, so I'm not sure why it doesn't see it. 

             

            Any ideas?

            • 3. Re: SVNAnt and CFBuilder 2
              Eric Cobb Level 1

              Can anyone at Adobe offer some guidance, or at least an explanation of why this doesn't work?  I was really hoping to find some help here…

              • 4. Re: SVNAnt and CFBuilder 2
                Eric Cobb Level 1

                Nevermind, I tried it in CFEclipse and it worked perfectly.  I guess I'll just switch to it for all of my Ant scritps.