2013-02-13 12 views
7

मान लें कि मेरे पास build_dev_linux.xml नाम की एक फ़ाइल है।चींटी को xml फ़ाइल का अपना नाम कैसे प्राप्त करें?

मेरा प्रश्न

मैं चींटी स्क्रिप्ट एक्सएमएल फ़ाइल के स्वयं के नाम कैसे मिल सकती है, build_dev_linux.xml तो मैं यह चर या संपत्ति पर है कि XML फ़ाइल में डाल सकता है।?

+0

basename कार्य का उपयोग कर सकते क्यों आप सीधे निपटने अंक कम करने के लिए – Shurmajee

+0

युक्त सेट नहीं कर सकते। मुझे नहीं पता था कि कहां से शुरू करना है, और अब मुझे लगता है कि मेरे पास एक है। :) –

उत्तर

13

चींटी निर्मित संपत्तियों की एक उपयोगी सूची परिभाषित करता है:

basedir    the absolute path of the project's basedir (as set 
        with the basedir attribute of <project>). 
ant.file   the absolute path of the buildfile. 
ant.version   the version of Ant 
ant.project.name the name of the project that is currently executing; 
        it is set in the name attribute of <project>. 
ant.project.default-target 
        the name of the currently executing project's 
        default target; it is set via the default 
        attribute of <project>. 
ant.project.invoked-targets 
        a comma separated list of the targets that have 
        been specified on the command line (the IDE, 
        an <ant> task ...) when invoking the current 
        project. 
ant.java.version the JVM version Ant detected; currently it can hold 
        the values "1.2", "1.3", 
        "1.4", "1.5" and "1.6". 
ant.core.lib  the absolute path of the ant.jar file. 

ant.file संपत्ति तुम क्या जरूरत है। आप पथ के बिना सिर्फ फ़ाइल नाम चाहते हैं तो आपको तरह

<basename file="${ant.file}" property="buildfile"/> 
+0

धन्यवाद एक संपत्ति नाम –

संबंधित मुद्दे