| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <?xml version="1.0" encoding="UTF-8"?>
- <project basedir="../../." name="p5ant.storage"
- xmlns:p5ant="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/ant/ant.xsd"
- >
-
-
-
- <description> storage functions to protect system failures etc </description>
-
- <include file="build.p5ant.storage.PRODUCT.xml" as="PRODUCT"/>
- <include file="../system_ui_info_speech/build.system_ui_info_speech.PRODUCT.xml" as="p5suis"/>
- <include file="../apple/build_apple.xml" as="p5apl" optional="yes"/>
- <!--<include file="build_ant.xml" optional="true" as="build_ant"/>-->
- <!--<import file="build_ant.xml" optional="yes" as="p5ant"/>-->
- <extension-point name="register" depends="register.input,register.check_if_exists,update__x3A__action,update.message" description="to insert info if not exists"/>
-
- <target name="register.check_if_exists">
- <echo>[ R E G I S T E R ] checking for file in ${p5ant.repository.storage.register.property.dir}/${local.p5ant.storage.register.property.name}.property</echo>
- <condition property="register__x3A__deny_flag" value="ERROR property already registered - use update">
- <available file="${p5ant.repository.storage.register.property.dir}/${local.p5ant.storage.register.property.name}.property"/>
- </condition>
- <echo> [ R E S U L T ] ${register__x3A__deny_flag} </echo>
- </target>
-
- <extension-point name="update" depends="register.input,update__x3A__action,update.message" description="to update info about property "/>
-
- <target name="register.input">
- <input addproperty="local.p5ant.storage.register.property.name" message="local.p5ant.storage.register.property.name"/>
- <input addproperty="local.p5ant.storage.register.property.value" message="local.p5ant.storage.register.property.value"/>
- <property name="local.p5ant.storage.register.property.destfile" location="${p5ant.repository.storage.register.property.dir}/${local.p5ant.storage.register.property.name}.property"/>
- </target>
-
- <target name="update__x3A__action" unless="register__x3A__deny_flag" depends="register.input" description="to register some property globally to modules">
-
- <echo>
-
- [ S T O R A G E R E G I S T E R P R O P E R T Y ]
- input
- $local.p5ant.storage.register.property.name = ${local.p5ant.storage.register.property.name}
- $local.p5ant.storage.register.property.value = ${local.p5ant.storage.register.property.value}
-
- output
- $local.p5ant.storage.register.property.destfile = ${local.p5ant.storage.register.property.destfile}
-
- USAGE in foreign build/product type:
- condition property name = $local.p5ant.storage.register.property.name value ...
- ... or use loadproperty to override it - from standard directory concatenend:
- $${p5ant.repository.storage.register.property.dir}}/$${local.p5ant.storage.register.property.name}.property
-
- </echo>
- <echo file="${local.p5ant.storage.register.property.destfile}">#Ant properties
- #
- ${local.p5ant.storage.register.property.name}=${local.p5ant.storage.register.property.value}
- </echo>
- <condition property="register__x3A__deny_flag" value="error with creating property">
- <not><available file="${local.p5ant.storage.register.property.destfile}"/></not>
- </condition>
- </target>
-
-
- <target name="update.message" unless="register__x3A__deny_flag" >
- <property name="local.p5apl.terminal-notifier.group" value="${p5ant.storage.PRODUCT.name}"/>
- <property name="local.p5apl.terminal-notifier.message" value="zapisano plik properties"/>
- <property name="local.p5apl.terminal-notifier.title" value="plik gotowy zapisano"/>
- <property name="local.p5apl.terminal-notifier.subtitle" value="gotowy do używania"/>
-
- <ant antfile="${p5suis.build}" target="p5suis:say_to_queue.PL.drop_overflow">
- <property name="p5suis:say_text" value="zapisano plik property do override użytku"/>
- </ant>
- </target>
-
- <target name="update.message.error" if="register__x3A__deny_flag" >
- <property name="local.p5apl.terminal-notifier.group" value="${p5ant.storage.PRODUCT.name}"/>
- <property name="local.p5apl.terminal-notifier.message" value="nie zapisano plik properties"/>
- <property name="local.p5apl.terminal-notifier.title" value="plik już istnieje"/>
- <property name="local.p5apl.terminal-notifier.subtitle" value="błąd"/>
-
- <ant antfile="${p5suis.build}" target="p5suis:say_to_queue.PL.drop_overflow">
- <property name="p5suis:say_text" value="zmienna już jest ustalona - użyj metody update"/>
- </ant>
- </target>
-
-
- <!-- resolve -->
-
- <macrodef name="resolve">
- <attribute name="property" description="property name to try to resolve"/>
- <sequential>
-
- <property name="local.p5apl.terminal-notifier.group" value="${p5ant.storage.PRODUCT.name}"/>
- <property name="local.p5apl.terminal-notifier.title" value="${p5ant.storage.PRODUCT.name}"/>
- <property name="local.p5apl.terminal-notifier.subtitle" value="resolve property @{property}"/>
-
- <local name="local.p5ant.storage.resolve__x3A__exist_flag"/>
- <condition property="local.p5ant.storage.resolve__x3A__exist_flag" value="true">
- <available file="${p5ant.repository.storage.register.property.dir}/${local.p5ant.storage.register.property.name}.property" type="file"/>
- </condition>
-
- <condition property="local.p5ant.storage.resolve__x3A__filepath" value="${p5ant.repository.storage.register.property.dir}/${local.p5ant.storage.register.property.name}.property">
- <isset property="local.p5ant.storage.resolve__x3A__exist_flag"/>
- </condition>
- <property name="local.p5ant.storage.resolve__x3A__filepath" location="${p5ant.storage__x3A__blank.property}"/>
-
- <condition property="local.p5apl.terminal-notifier.message" value="wyzwolono odczyt istniejącego oczekiwanego property">
- <isset property="local.p5ant.storage.resolve__x3A__exist_flag"/>
- </condition>
- <condition property="local.p5apl.terminal-notifier.message" value="brak wcześniej zapisanego oczekiwanego property">
- <not><isset property="local.p5ant.storage.resolve__x3A__exist_flag"/></not>
- </condition>
-
- <loadproperties srcfile="${local.p5ant.storage.resolve__x3A__filepath}" />
-
- <condition property="local.p5apl.terminal-notifier.message" value="!!! pomimo istnienia property nie udało ustalić się jego wartości!!!">
- <not><isset property="@{property}"/></not>
- </condition>
-
- <property name="local.p5apl.terminal-notifier.message" value="Brak oczekiwanego pliku do otwarcia ${local.p5ant.safety.filename}"/>
- <echo>#92 [ S T O R A G E R E S O L V E ]
- $local.p5ant.storage.resolve__x3A__exist_flag = ${local.p5ant.storage.resolve__x3A__exist_flag}
- $local.p5ant.storage.resolve__x3A__filepath ${local.p5ant.storage.resolve__x3A__filepath}
- .. if ok then try eval request for $property = @{property}
- </echo>
- <antcall target="safety.p5apl.terminal-notifier.notify"/>
-
- </sequential>
- </macrodef>
-
- </project>
|