Jump to content

[Guide] Log errors on ant


oceeman
 Share

Recommended Posts

If you are using TortoiseSVN + Ant build and you get errors it is a pain to resolve them without having logs. Here is a patch that will solve the problem:

Index: build.xml
===================================================================
--- build.xml	(revision 1475)
+++ build.xml	(working copy)
@@ -43,7 +43,6 @@
        	<include name="trove-2.1.0.jar"/>
        </fileset>
    </path>
-
	<target name="verifyRequirements" 
		description="Checks if the necessary requirements for building L2J are fulfilled">

@@ -56,6 +55,16 @@
    	depends="clean, verifyRequirements"
        description="Create the output directories.">

+	<tstamp>
+	    <format property="timestamp" pattern="yyyy-MM-dd_HH-mm-ss"/>
+	  </tstamp>
+	  <property name="build.log.dir" location="${basedir}/buildlogs"/>
+	  <mkdir dir="${build.log.dir}"/>
+	  <property name="build.log.filename" value="build_${timestamp}.log"/>
+	  <record name="${build.log.dir}/${build.log.filename}"
+	    loglevel="verbose" append="false"/>
+	  <echo message="Build logged to ${build.log.filename}"/>
+
        <mkdir dir="${build}"/>
        <mkdir dir="${build.classes}"/>
        <mkdir dir="${build.dist}" />

 

You can also open your build.xml with an editor (like Notepad), find <target name="init" and insert the following lines after description="Create the output directories.">:

	<tstamp>
    <format property="timestamp" pattern="yyyy-MM-dd_HH-mm-ss"/>
  </tstamp>
  <property name="build.log.dir" location="${basedir}/buildlogs"/>
  <mkdir dir="${build.log.dir}"/>
  <property name="build.log.filename" value="build_${timestamp}.log"/>
  <record name="${build.log.dir}/${build.log.filename}"
    loglevel="verbose" append="false"/>
  <echo message="Build logged to ${build.log.filename}"/>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock