In Ant, how can I dynamically build a property that references a property file?

前端 未结 3 1746
暖寄归人
暖寄归人 2021-01-13 14:37

I am using Input tasks to collect specific property values and I want to concatenate those into one property value that references my properties file.

I can generate

3条回答
  •  感动是毒
    2021-01-13 15:07

    Additional example using the Props antlib.
    Needs Ant >= 1.8.0 (works fine with latest Ant version 1.9.4) and Props antlib binaries.

    The current build.xml in official Props antlib GIT Repository (or here) doesn't work out of the box :

    BUILD FAILED
    Target "compile" does not exist in the project "props".
    

    Get the sources of props antlib and unpack in filesystem.
    Get the sources of antlibs-common and unpack contents to ../ant-antlibs-props-master/common
    Run ant antlib for building the jar :

    [jar] Building jar: c:\area51\ant-antlibs-props-master\build\lib\ant-props-1.0Alpha.jar
    

    Otherwise get the binaries from MVNRepository or here

    The examples in ../antunit are quite helpful. For nested properties look in nested-test.xml
    Put the ant-props.jar on ant classpath.

    
    
     
     
       
     
    
     
    
           
     
     
    
     
    
    
    

    output :

    Buildfile: c:\area51\ant\tryme.xml
        [input] Enter Location:
    west
        [input] Enter Sandbox:
    1
         [echo] TaPwxOsa
    
    BUILD SUCCESSFUL
    Total time: 4 seconds
    

提交回复
热议问题