Ant 脚本打印系统属性变量、ant内置属性
生活随笔
收集整理的這篇文章主要介紹了
Ant 脚本打印系统属性变量、ant内置属性
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Ant 腳本打印系統(tǒng)屬性變量、ant內(nèi)置屬性
作用
編寫(xiě)ant腳本的時(shí)候,經(jīng)常會(huì)引用到系統(tǒng)屬性,本腳本用于打印系統(tǒng)常用屬性(System.getProperties)與環(huán)境變量(Environment)等,供編寫(xiě)腳本的時(shí)候參考。
腳本
腳本參考了:
- Ant學(xué)習(xí)筆記
- 不會(huì)用ant打包、部署項(xiàng)目的工程師,不是一個(gè)好程序員(測(cè)試)
代碼內(nèi)容如下:
<?xml version="1.0" encoding="UTF-8"?><project name="print_properties" default="print" basedir="."><property environment="env"/><target name="print"><!-- ================== Ant's built-in properties ============================ --><echo message="|-- Ant's built-in properties:"/><echo message="|"/><!-- The absolute path of the project’s basedir. --><echo message="|basedir=${basedir}"/><!-- The absolute path of the buildfile. --><echo message="|ant.file=${ant.file}"/><!-- The version of Ant. --><echo message="|ant.version=${ant.version}"/><!-- The name of the project that is currently executing. --><echo message="|ant.project.name=${ant.project.name}"/><!-- The name of the currently executing project’s default target. --><echo message="|ant.project.default-target=${ant.project.default-target}"/><!-- A comma separated list of the targets that have been specified on the command line when invoking the current. --><echo message="|ant.project.invoked-targets=${ant.project.invoked-targets}"/><!-- The JVM version Ant detected. --><echo message="|ant.java.version=${ant.java.version}"/><!-- The absolute path of the ant.jar file. --><echo message="|ant.core.lib=${ant.core.lib}"/><!-- =============================== System properties ==================================== --><echo message="|-- System properties:"/><echo message="|"/><echo message="|sun.boot.library.path=${sun.boot.library.path}"/><echo message="|file.encoding=${file.encoding}"/><echo message="|user.language=${user.language}"/><echo message="|user.region=${user.region}"/><!-- Java Runtime Environment version --><echo message="|java.version=${java.version}"/><!-- Java Runtime Environment vendor --><echo message="|java.vendor=${java.vendor}"/><!-- Java vendor URL --><echo message="|java.vendor.url=${java.vendor.url}"/><!-- Java installation directory --><echo message="|java.home=${java.home}"/><!-- Java Virtual Machine specification version --><echo message="|java.vm.specification.version=${java.vm.specification.version}"/><!-- Java Virtual Machine specification vendor --><echo message="|java.vm.specification.vendor=${java.vm.specification.vendor}"/><!-- Java Virtual Machine specification name --><echo message="|java.vm.specification.name=${java.vm.specification.name}"/><!-- Java Virtual Machine implementation version --><echo message="|java.vm.version=${java.vm.version}"/><!-- Java Virtual Machine implementation vendor --><echo message="|java.vm.vendor=${java.vm.vendor}"/><!-- Java Virtual Machine implementation name --><echo message="|java.vm.name=${java.vm.name}"/><!-- Java Runtime Environment specification version --><echo message="|java.specification.version=${java.specification.version}"/><!-- Java Runtime Environment specification vendor --><echo message="|java.specification.vendor=${java.specification.vendor}"/><!-- Java Runtime Environment specification name --><echo message="|java.specification.name=${java.specification.name}"/><!-- Java class format version number --><echo message="|java.class.version=${java.class.version}"/><!-- Java class path --><echo message="|java.class.path=${java.class.path}"/><!-- List of paths to search when loading libraries --><echo message="|java.library.path=${java.library.path}"/><!-- Default temp file path --><echo message="|java.io.tmpdir=${java.io.tmpdir}"/><!-- Name of JIT compiler to use --><echo message="|java.compiler=${java.compiler}"/><!-- Path of extension directory or directories --><echo message="|java.ext.dirs=${java.ext.dirs}"/><!-- Operating system name --><echo message="|os.name=${os.name}"/><!-- Operating system architecture --><echo message="|os.arch=${os.arch}"/><!-- Operating system version --><echo message="|os.version=${os.version}"/><!-- File separator ("/" on UNIX) --><echo message="|file.separator=${file.separator}"/><!-- Path separator (":" on UNIX) --><echo message="|path.separator=${path.separator}"/><!-- Line separator ("\n" on UNIX) --><echo message="|line.separator=${line.separator}"/><!-- User's account name --><echo message="|user.name=${user.name}"/><!-- User's home directory --><echo message="|user.home=${user.home}"/><!-- User's current working directory --><echo message="|user.dir=${user.dir}"/><!-- =============================== Environment 環(huán)境變量 ================================== --><property environment="env"/><echo message="|-- Environment:"/><echo message="|"/><echo message="|PATH={env.PATH}"/></target></project>轉(zhuǎn)載于:https://www.cnblogs.com/danne823/p/print_systemProperties_with_ant.html
總結(jié)
以上是生活随笔為你收集整理的Ant 脚本打印系统属性变量、ant内置属性的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: SDL2源码分析6:拷贝到渲染器(SDL
- 下一篇: 第七章 移动自动化持续化集成(下)