I have the following ant task that has embedded javascript. I'm trying to read the value of a property in my build.properties file but the followi开发者_如何学Cng doesn't seem to work.
    <target name="analyze">
        <script language="javascript">
        <![CDATA[
                importPackage(java.lang);
                var path = "${FOOBAR_HOME}";
                System.out.println(path);
        ]]>
        </script>
    </target>
Anyone know how to do this?
Assuming that your build.properties file is loaded before the script task using a loadproperties task or equivalent, then you could use something like:
var path = project.getProperty("FOOBAR_HOME");
or even just
var path = FOOBAR_HOME;
in the javascript. This is from the examples in the script task docs.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论