Results 1 to 11 of 11
  1. #1
    Xen
    Xen is offline Member
    Join Date
    Jan 2015
    Posts
    86
    Rep Power
    0

    Thumbs up My Ant experiences

    I just want to make a topic where I can post about Ant.

    I currently have these targets:

    • info
    • clean
    • test-clean
    • compile
    • test-compile
    • test


    Clean
    Recursively deletes all class files from ${build.dir}

    Test-Clean
    Recursively deletes all class files from ${test.build.dir}
    Deletes all TEST* files from ${test.report.dir}
    Deletes the generated JUnitReport site under {$test.report.dir}/html

    Compile
    Still targets a single main file (entry point of application)
    * Has includeantruntime="false" to suppress a warning.
    * Has debug="true" debuglevel="lines,vars,source" to make sure debugging output is generated and placed in the class files
    * Has failonerror="false" so that any subsequent unit tests will still try to run

    Test-Compile
    Always does Test-Clean and Compile first

    Test
    Executes unit test suites for each package by name (manually configured), each package test suite aggregates all the test files in the package (also manually configured)
    Executes JUnitReport to generate a little site in /report/html that contains the test report
    * Has format="noframes" such that it generates a single page for easy browsing rather than a mini-site



    Grep

    JUnitReport generates unsquechable output that is not necessary and not wanted. I have adjusted "ant.bat" in my project root to do

    @%ANT_HOME%\bin\ant.bat %1 %2 %3 %4 | grep -v "junitreport"

    So that these messages are suppressed.

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: My Ant experiences

    I could be wrong but I don't think it is appropriate to simply post informative information in a forum for asking questions. If you want to provide assistance to folks, then start a forum blog on the topic.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    Xen
    Xen is offline Member
    Join Date
    Jan 2015
    Posts
    86
    Rep Power
    0

    Default Re: My Ant experiences

    Well first of all this forum hasn't seen any activity for 10 months so I thought a little informational treatise would not hurt, I guess it is interesting for newcomers like myself and easy to read and comprehend and gives an overview from actual experience of using it. Second, I didn't even know there were forum blogs but they are not organized, and a real user would always come here and not go to the blog section. And the last blog was from January and the one before it was from October, so I don't think anyone will or would read it, certainly not myself. The format is less of an attractive thing and it is less certain to draw attention or to warrant being opened than this forum thread is.

    So I think the inappropriateness comes from a misappraisal of what the forum performs as, which role it takes. I think it is meant to be as much informative (initiative taking) as responding to questions (reactionary) because there is frankly not really another venue or platform within this site to do that as well.............................

    Secondly a forum thread can always be extended with new experiences but a typical blog post cannot. And you require a complete blog site for doing extending posts, or you'd have to edit and rewrite the blog post all the time. Also not a measure of convenience from what I'd like to do.

    So many words for something so simple ! ;-). Regards...

  4. #4
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: My Ant experiences

    I probably should have just said a more appropriate place to post this type of info would be a blog. But that is still just my opinion. Oh, and folks may comment on your blog if you permit it.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  5. #5
    Xen
    Xen is offline Member
    Join Date
    Jan 2015
    Posts
    86
    Rep Power
    0

    Default Re: My Ant experiences

    I have a blog and I don't have a blog. It is dysfunctional, I have no visitors whatsoever, I would get or garner no interaction from that site for a million years into the future, and these posts are not suited for it, I would need even another platform, which I don't have and can't get, etc. I am seriously writing here because it is fun, there might be a few people interested, it is informative for this site and other people perhaps (most assuredly, if I would think) and it gives a reference to myself with important and useful information, clears my head, gives me something other to do than code, and etc. etc. etc. ;-). I hope you are not offended :) ;-) :) :P.

    If I am allowed, therefore, my Ant experience simply continues:...... here :D :).



    Ivy
    Ivy was installed in its own location (as is Ant) which in my case is a custom tree on my C: drive. I have all my custom "dev" components installed in that directory. The beginners tutorials on the Ivy website are very bad or stupid or nonsencial or don't do anything useful, or become way too complex way too sudden (right away) just like it is (conveivably) with the site and documentation of Maven, although the Maven 5-minute guide was slightly better, and I haven't read the 30-minute guide there yet.

    The tutorial I quickly found that DOES provide a complete beginner's outlook on what needs to be done was at Soft Docs: Apache Ivy - Beginners Guide -- VERY outstanding!!!.

    To get started with Ivy it requires two things:

    • An Ivy xml file (ivy.xml) in your root directory (project directory) that includes a small info section and a dependencies section. That is all it is and requires. For instance, my file might look like:


    Java Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    		xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
    	<info organisation="<myname>" module="<myproject>" status="integration" />
    	<dependencies>
    		<dependency org="junit" name="junit" rev="4.12"/>
    	</dependencies>
    </ivy-module>
    To automatically install and download and all that, of the current version of JUnit, when the second part of the configuration is completed. The second part is just one target section in your Ant build.xml file:

    Java Code:
    <target name="retrieve" description="Resolve and Retrieve with ivy">
    	<ivy:resolve />
    	<ivy:retrieve sync="true" type="jar, bundle" />
    </target>
    That is seriously all it requires, apart from a line at the top that adds the namespace of Ivy to the xml file:

    Java Code:
    <project name="..." basedir="..." default="..." xmlns:ivy="antlib:org.apache.ivy.ant">
    That IS all that is required to get Ivy functional. You can then run the retrieval operation using:

    ant retrieve

    and you're done. It places (this config places) the retrieved files in the project root's "lib" directory, which you can configure, (but we won't go into that).

    I forget to mention that you need to copy the Ivy jar file to Ant's "lib" directory, but that is just a small and mediocre step to perform, no matter how essential ! ;-D. :).


    And I don't understand why half the time the Java code formatter doesn't work or produces ugly on this forum.... :(

    My apologies if my presence here is unwarranted. It does seem like the forum could use some new blood, but maybe it is not the appropriate place for me? You tell me, I can't say?.... :( :-/.
    Last edited by Xen; 08-05-2015 at 11:33 PM.

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: My Ant experiences

    There is a Blogs section to this forum.
    Not that I've used it, but it is where some people post these sorts of things.
    I seem to remember Jos saying he'd written one or two.

    Quote Originally Posted by Xen View Post
    And I don't understand why half the time the Java code formatter doesn't work or produces ugly on this forum.... :(
    Any issue in particular?
    I know it has problems with the /*...*/ style comments, and gets confused about where the end of the comment sits, frequently looking like a whole chunk of code is commented out.
    Oh, and the "helpful" google thing where it interprets certain letter combinations as a link shortcut.

    Quote Originally Posted by Xen View Post
    My apologies if my presence here is unwarranted. It does seem like the forum could use some new blood, but maybe it is not the appropriate place for me? You tell me, I can't say?.... :( :-/.
    The only people who generally aren't welcome are the "do my project for me" people, and even then, if they end up showing some effort after a bit of prompting...some just become plain rude, though.
    Oh, and people who ask a question and never return to it after people have answered the question. Is a "yes, that worked, thank you" too much to ask for? Youth of today, grumble, mutter...
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    Xen
    Xen is offline Member
    Join Date
    Jan 2015
    Posts
    86
    Rep Power
    0

    Default Re: My Ant experiences

    The Java code formatter will produce different output (at least in my browser) depending on how you save the piece of text/posting you are doing. It seems to be persistent.

    What I mean is that often the layout is wrong or other than what it is supposed to be, and then it doesn't do alternating-line-coloring, and all that. In a sense, it ceases to apply the proper layout. I don't have a screenshot at this point.

    So when I have Java code or any code block (doesn't have to be Java, I use it for different things all the time) I go into the "advanced" editor and then do a preview, and when the preview is alright, I save it.

    But then, when I edit the text (to fix a typo for instance) it might end up wrong again.

    Sometimes, when there are like 3 code blocks, it will do the first 2 right and the last one wrong. If I get a version that works I hit save, but it seems to be rather random, and I always have to use the advanced editor.

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: My Ant experiences

    Ah, there's also an occasional issue with displaying that comes and goes.
    I see it sometimes if I highlight a code block to copy into an IDE, and then the code blocks on the page will lose all colour highlighting.
    That's just the browser mucking something up, not a problem with the actual code in the code block.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  9. #9
    Xen
    Xen is offline Member
    Join Date
    Jan 2015
    Posts
    86
    Rep Power
    0

    Default Re: My Ant experiences

    I can't really say, it seems to be consistent (albeit arbitrary). I also never ever experienced such behaviour from a modern browser?

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: My Ant experiences

    Blame the forum software.
    We usually do.
    ;)
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  11. #11
    Xen
    Xen is offline Member
    Join Date
    Jan 2015
    Posts
    86
    Rep Power
    0

    Default Re: My Ant experiences

    I will, don't worry. You're walking away free ;-D.

    Netbeans
    I was quite surprised to see how well Netbeans is integrated with Ant. I just started my project as a 'provide your own buildscript' project and although it surreptitiously warns me that "future maintenance will be hard" I just went ahead and it perfectly loads my targets and even provides a fresh target of its own in a well-placed ant file for doing the debugging, if you wanted that. The debug file just includes the general file. Easy enough and you don't need to adjust anything.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •