text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is subject to the terms and conditions defined in the
files 'LICENSE' and 'NOTICE', which are part of this source
code package.
-->
<project name="Ant - Macros"
    xmlns:ivy="antlib:org.apache.ivy.ant">

    <!-- SCIPIO: NOTE: Despite the filename, this is used for all types of definitions
        common to both main build.xml, component build.xml, and limited support for
        individual component build.xml invocation in some cases. -->

    <!-- ================================================================== -->
    <!-- Generic Ant macros (SCIPIO) -->
    <!-- ================================================================== -->

    <macrodef name="condition-ext" description="Custom emulation of ant condition task for ant-contrib var assignments, with unset support">
        <attribute name="var" default=""/>
        <attribute name="property" default=""/>
        <attribute name="noneValue" default="__NONE__"/><!-- Ant macrodef workaround -->
        <attribute name="value" default="@{noneValue}"/>
        <attribute name="unset" default="false"/>
        <attribute name="else" default="@{noneValue}"/>
        <attribute name="else-unset" default="false"/>
        <element name="if-condition" optional="false" implicit="true"/>
        <sequential>
            <if><!-- SCIPIO: 2018-05-08: backward compat for old scripts -->
                <if-condition/>
                <then>
                    <if>
                        <equals arg1="@{unset}" arg2="true"/>
                        <then>
                            <if>
                                <not><equals arg1="@{var}" arg2=""/></not>
                                <then>
                                    <!-- NOTE: must unset first, in case using this to override a property (see ant-contrib docs) -->
                                    <var name="@{var}" unset="true"/>
                                </then>
                                <else>
                                    <var name="@{property}" unset="true"/>
                                </else>
                            </if>
                        </then>
                        <elseif>
                            <not><equals arg1="@{value}" arg2="__NONE__"/></not>
                            <then>
                                <if>
                                    <not><equals arg1="@{var}" arg2=""/></not>
                                    <then>
                                        <!-- NOTE: must unset first, in case using this to override a property (see ant-contrib docs) -->
                                        <var name="@{var}" unset="true"/>
                                        <var name="@{var}" value="@{value}"/>
                                    </then>
                                    <else>
                                        <var name="@{property}" unset="true"/>
                                        <property name="@{property}" value="@{value}"/>
                                    </else>
                                </if>
                            </then>
                        </elseif>
                    </if>
                </then>
                <else>
                    <if>
                        <equals arg1="@{else-unset}" arg2="true"/>
                        <then>
                            <if>
                                <not><equals arg1="@{var}" arg2=""/></not>
                                <then>
                                    <!-- NOTE: must unset first, in case using this to override a property (see ant-contrib docs) -->
                                    <var name="@{var}" unset="true"/>
                                </then>
                                <else>
                                    <var name="@{property}" unset="true"/>
                                </else>
                            </if>
                        </then>
                        <elseif>
                            <not><equals arg1="@{else}" arg2="__NONE__"/></not>
                            <then>
                                <if>
                                    <not><equals arg1="@{var}" arg2=""/></not>
                                    <then>
                                        <!-- NOTE: must unset first, in case using this to override a property (see ant-contrib docs) -->
                                        <var name="@{var}" unset="true"/>
                                        <var name="@{var}" value="@{else}"/>
                                    </then>
                                    <else>
                                        <var name="@{property}" unset="true"/>
                                        <property name="@{property}" value="@{else}"/>
                                    </else>
                                </if>
                            </then>
                        </elseif>
                    </if>
                </else>
            </if>
        </sequential>
    </macrodef>

    <!-- ================================================================== -->
    <!-- Requirements  -->
    <!-- ================================================================== -->

    <property name="minimumantversion" value="1.9.1"/>

    <!-- FOR DEVELOPERS:
        If you are a developer using an IDE-provided Ant version and certain there are no problems,
        you can eliminate the provided ant version warning by uncommenting the following line or setting this property: -->
    <!--<property name="antlib.check.ok" value="true"/>-->

    <!-- SCIPIO: 2018-04-04: The ant and JDK version checks are now only done once with include guard
        NOTE: the macro call is further below due to ant-contrib use -->
    <macrodef name="check-reqs">
        <sequential>
            <if>
                <not><isset property="checkreqs.ran"/></not>
                <then>
                    <antversion property="antversion" atleast="${minimumantversion}"/>
                    <fail unless="antversion">ANT VERSION: Scipio build requires minimum ant version: ${minimumantversion}
You are running: ${ant.version} (${ant.core.lib})

If you are running from command line, an ant jar is provided with Scipio (framework/base/lib/ant/);
using a system ant installation is not recommended, as such configurations may not be tested.

From command line, Scipio build should be invoked using the provided ant launch scripts in project root:
* Linux, Mac, Cygwin, Windows Git Bash:    ./ant [target]
* Windows (no Bash, through ant.bat):      ant [target]</fail>

                    <condition property="antlib.check.ok">
                        <contains substring="framework${file.separator}base${file.separator}lib${file.separator}ant${file.separator}" string="${ant.core.lib}"/>
                    </condition>
                    <if>
                        <not><isset property="antlib.check.ok"/></not>
                        <then>
                            <path id="antlib.provided.jar.full">
                                <fileset dir="${ofbiz.home.dir}/framework/base/lib/ant/" includes="ant-*-ant.jar"/>
                            </path>
                            <property name="antlib.provided.jar.rel" value="${toString:antlib.provided.jar.full}" relative="true" basedir="${ofbiz.home.dir}"/>
                            <!--<antversion property="providedantversion.ok" exactly="${providedantversion}"/>-->
                            <echo level="warning">WARNING: The ant jar executing is not the one provided with Scipio (${antlib.provided.jar.rel})
You are running: ${ant.version} (${ant.core.lib})

From command line, Scipio build should be invoked using the provided ant launch scripts in project root:
* Linux, Mac, Cygwin, Windows Git Bash:    ./ant [target]
* Windows (no Bash, through ant.bat):      ant [target]
(Developers can eliminate this message for IDEs by setting the antlib.check.ok property to true)</echo>
                        </then>
                    </if>

                    <!-- SCIPIO: 2017-09-06: JDK version minimum requirement is now 1.8 -->
                    <condition property="javaatleast18">
                        <not>
                            <matches pattern="^1\.[0-7]($|\..*)" string="${ant.java.version}"/>
                        </not>
                    </condition>
                    <fail unless="javaatleast18" message="Please upgrade java to at least 1.8. Current Java version is ${ant.java.version}"/>

                    <property name="checkreqs.ran" value="true"/>
                </then>
            </if>
        </sequential>
    </macrodef>

    <target name="check-reqs">
        <check-reqs/>
    </target>

    <!-- ================================================================== -->
    <!-- Common/generic defs for all builds  -->
    <!-- ================================================================== -->

    <dirname property="ofbiz.home.dir" file="${ant.file.Ant - Macros}"/>

    <path id="local.class.path"/>

    <patternset id="src.inc.set">
        <include name="**/*.java"/>
    </patternset>
    <patternset id="src.exc.set"/>

    <!-- ================================================================== -->
    <!-- Ant extensions (taskdefs) -->
    <!-- ================================================================== -->

    <!-- ant-contrib -->
    <path id="ant-contrib.class.path">
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/ant/" includes="ant-contrib-*.jar"/>
    </path>
    <taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="ant-contrib.class.path"/>

    <!-- trigger the requirements check (requires ant-contrib) -->
    <check-reqs/>

    <!-- ivy (SCIPIO) (see ivy-init for taskdef) -->
    <property name="ivy.settings.file" value="${ofbiz.home.dir}/ivy/ivysettings.xml"/>
    <property name="lib.general.ivyfile" value="${ofbiz.home.dir}/ivy/ivy.xml"/>
    <property name="lib.comp.base.ivyfile" value="${ofbiz.home.dir}/framework/base/ivy.xml"/>
    <path id="lib.ivy.class.path">
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/ant/" includes="ivy-*.jar"/>
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/" includes="oro-*.jar"/>
    </path>

    <!-- groovy (SCIPIO: NOTE: 2018-03-20: see groovy-init for taskdef) -->
    <path id="groovy.class.path">
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/" includes="groovy-*.jar"/>
    </path>

    <!-- rhino -->
    <path id="rhino.class.path">
        <fileset dir="${ofbiz.home.dir}/extension/rhino/lib/" includes="js-*.jar"/>
    </path>

    <!-- junit -->
    <path id="junit.class.path">
        <!-- SCIPIO: 2017-02-02: The junit JAR itself should now be explicitly specified, as may miss from classpath or wrong one on classpath -->
        <fileset dir="${ofbiz.home.dir}/framework/base/lib" includes="junit-*.jar"/>
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/ant/" includes="ant-apache-bsf-*.jar"/>
        <!-- scripting (previously under base/lib/scripting) -->
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/" includes="antlr-*.jar"/>
        <!-- SCIPIO: 2018-07-06: junit should not need this
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/ant-ext" includes="asm-*.jar"/>-->
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/" includes="bsf-*.jar"/>
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/" includes="bsh-*.jar"/>
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/" includes="groovy-*.jar"/>
        <!-- SCIPIO: removed
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/" includes="jython-*.jar"/>-->
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/" includes="oro-*.jar"/>
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/" includes="hamcrest-*.jar"/><!-- SCIPIO: 2018-03-27: hamcrest-core dep for junit -->
    </path>

    <!-- cobertura -->
    <path id="cobertura.class.path">
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/ant-opt/cobertura" includes="*.jar"/>
        <!-- SCIPIO: 2018-07-06: for now, included under ant-opt/cobertura (what else would use asm?)
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/ant-ext" includes="asm-*.jar"/>-->
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/" includes="junit-*.jar"/>
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/" includes="log4j-*.jar"/>
        <!-- SCIPIO: version compability problems
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/" includes="slf4j-api-*.jar"/>-->
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/" includes="oro-*.jar"/>
    </path>

    <!-- jacoco -->
    <path id="jacoco.class.path">
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/ant-opt/jacoco" includes="*.jar"/>
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/" includes="junit-*.jar"/>
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/" includes="log4j-*.jar"/>
    </path>

    <path id="jacoco.agent.class.path">
        <fileset dir="${ofbiz.home.dir}/framework/base/lib/ant-opt/jacoco" includes="*agent*.jar"/>
    </path>

    <!-- ================================================================== -->
    <!-- Common build macros/presets -->
    <!-- ================================================================== -->

    <presetdef name="default-javac">
        <javac debug="on" deprecation="on" destdir="${build.dir}/classes" srcdir="${src.dir}" classpathref="local.class.path">
            <patternset refid="src.inc.set"/>
            <patternset refid="src.exc.set"/>
        </javac>
    </presetdef>

    <presetdef name="javac17">
        <default-javac compiler="javac1.7" target="1.7" source="1.7" encoding="UTF-8" includeantruntime="false">
            <compilerarg value="-Xlint:-path"/>
            <!--
            Please leave this line here.  It makes it easier to enable/disable it.
            <compilerarg value="-Xlint:unchecked"/>
            -->
        </default-javac>
    </presetdef>

    <!-- SCIPIO: new explicit target for java 1.8-compatibility -->
    <presetdef name="javac18">
        <default-javac compiler="javac1.8" target="1.8" source="1.8" encoding="UTF-8" includeantruntime="false">
            <compilerarg value="-Xlint:-path"/>
            <!--
            Please leave this line here.  It makes it easier to enable/disable it.
            <compilerarg value="-Xlint:unchecked"/>
            -->
        </default-javac>
    </presetdef>

    <presetdef name="default-javadoc">
        <javadoc classpathref="local.class.path"
            destdir="${build.dir}/javadocs"
            windowtitle="Apache OFBiz - ${desc}"
            useexternalfile="yes"
            maxmemory="512M"
            encoding="UTF-8"
            packagenames="org.ofbiz.*">
            <fileset dir="${basedir}" defaultexcludes="yes">
                <include name="**/*.java"/>
                <exclude name="**/ControlApplet.java"/>
                <exclude name="**/ShipmentScaleApplet.java"/>
                <exclude name="**/test/"/>
                <exclude name="**/cybersource/"/>
                <exclude name="**/PayPalServices.java"/>
                <exclude name="**/ideal/"/>
                <exclude name="**/orbital/"/>
                <exclude name="**/securepay/"/>
                <exclude name="**/verisign/"/>
                <exclude name="**/JREntityListIteratorDataSource.java"/>
                <exclude name="**/JRMapCollectionDataSource.java"/>
                <exclude name="**/openoffice/"/>
                <exclude name="**/JasperReportsXmlViewHandler.java"/>
                <exclude name="**/JasperReportsJXlsViewHandler.java"/>
                <exclude name="**/JasperReportsPoiXlsViewHandler.java"/>
            </fileset>
            <link href="http://java.sun.com/javase/7/docs/api/" offline="true" packagelistLoc="${ofbiz.home.dir}/tools/api-java17"/>
        </javadoc>
    </presetdef>

    <!-- SCIPIO: NOTE: 2018-03-20: This requires groovy-init task in main build -->
    <macrodef name="default-groovyc">
        <sequential>
            <groovyc destdir="${build.dir}/classes" srcdir="${src.dir}">
                <classpath>
                    <path refid="local.class.path"/>
                    <pathelement path="${build.dir}/classes"/>
                </classpath>
            </groovyc>
        </sequential>
    </macrodef>

    <macrodef name="main-jar">
        <attribute name="jarfile" default="${build.dir}/lib/${name}.jar"/>
        <element name="main-pattern" optional="true"/>
        <element name="main-elements" optional="true" />
        <sequential>
            <jar jarfile="@{jarfile}">
                <fileset dir="${build.dir}/classes">
                    <exclude name="**/test" />
                    <exclude name="**/test/*" />
                    <main-pattern />
                </fileset>
                <fileset dir="${src.extra.dir}">
                    <and>
                        <not>
                            <or>
                                <filename name="**/test"/>
                                <filename name="**/test/*"/>
                            </or>
                        </not>
                        <selector refid="src-extra-set"/>
                    </and>
                </fileset>
                <!-- now add the NOTICE and LICENSE files to allow the jar file to be distributed alone -->
                <zipfileset dir="${ofbiz.home.dir}" prefix="META-INF" includes="NOTICE,LICENSE"/>
                <main-elements/>
            </jar>
        </sequential>
    </macrodef>

    <macrodef name="test-jar">
        <attribute name="jarfile" default="${build.dir}/lib/${name}-test.jar"/>
        <element name="test-selector" optional="true"/>
        <element name="test-elements" optional="true"/>
        <sequential>
            <jar jarfile="@{jarfile}">
                <fileset dir="${build.dir}/classes">
                    <or>
                        <filename name="**/test"/>
                        <filename name="**/test/*"/>
                        <test-selector/>
                    </or>
                </fileset>
                <fileset dir="${src.dir}">
                    <and>
                        <filename name="**/test/*"/>
                        <or>
                            <test-selector/>
                            <selector refid="src-extra-set"/>
                        </or>
                    </and>
                </fileset>
                <zipfileset dir="${ofbiz.home.dir}" prefix="META-INF" includes="NOTICE,LICENSE"/>
                <test-elements/>
            </jar>
        </sequential>
    </macrodef>

    <!-- SCIPIO: NOTE: This macro is enhanced to supported nested implicit iterate-subant-args for the subant call -->
    <macrodef name="iterate">
        <attribute name="filelist" default="subdirs"/>
        <attribute name="target" default=""/>
        <attribute name="inheritall" default="false"/>
        <element name="iterate-subant-args" optional="yes" implicit="yes"/>
        <sequential>
            <subant target="@{target}" inheritall="@{inheritall}">
                <propertyset refid="ofbiz.subbuild.props.pass"/>
                <!-- SCIPIO: new 2017-02-01 -->
                <iterate-subant-args />
                <filelist refid="@{filelist}"/>
            </subant>
        </sequential>
    </macrodef>

    <presetdef name="externalsubant">
        <subant inheritall="false">
            <!-- SCIPIO: defined in build.xml
            <propertyset>
                <propertyref name="ofbiz.home.dir"/>
            </propertyset>-->
            <propertyset refid="ofbiz.subbuild.props.pass"/>
        </subant>
    </presetdef>

    <!-- ================================================================== -->
    <!-- SCIPIO: New common macros/presets -->
    <!-- ================================================================== -->

    <!-- SCIPIO: Build invoker with automatic dependency resolution.
        Fetches the component.build.dependencies filelist from each component within a given component directory
        and resolves the resulting dependency graph to determine a build order, mirroring the same
        algorithm now used for the scipio-component.xml/scipio-theme.xml/ofbiz-component.xml depends-on functionality (new 2017-01-17).
        See also the "get-component-build-deps" target (called by this macro). -->
    <macrodef name="dep-subant">
        <attribute name="dir" default=""/>
        <attribute name="target" default=""/>
        <attribute name="auto-build-tools" default="true"/>
        <sequential>
            <!-- Old stock code (arbitrary build order)
            <externalsubant target="@{target}">
              <fileset dir="@{dir}" casesensitive="no">
                <exclude name="disabled/**"/>
                <include name="*/build.xml"/>
              </fileset>
            </externalsubant>-->

            <if>
                <equals arg1="@{target}" arg2="" trim="true"/>
                <then>
                    <var name="depres.displaytarget" value="build"/>
                </then>
                <else>
                    <var name="depres.displaytarget" value="@{target}"/>
                </else>
            </if>

            <if>
                <equals arg1="@{auto-build-tools}" arg2="true"/>
                <then>
                    <var name="scipio.buildtools.present" unset="true"/>
                    <available file="${ofbiz.home.dir}/tools/misc/scipio-build-tools.jar" property="scipio.buildtools.present" />
                    <if>
                        <not><isset property="scipio.buildtools.present"/></not>
                        <then>
                            <echo message="scipio-build-tools.jar not found (required for sub-builds) - triggering build..."/>
                            <antcall target="build-scipio-build-tools"/>
                        </then>
                    </if>
                </then>
            </if>

            <var name="depres.depgraph" unset="true"/>
            <var name="depres.depgraph" value="" />
            <var name="depres.topdirname" unset="true"/>
            <basename file="@{dir}" property="depres.topdirname"/>

            <echo message=""/>
            <echo message="${depres.topdirname}: Starting automatic build dependency resolution for ${depres.displaytarget} task..." />

            <!-- Build depgraph: read the component.build.dependencies values out of each build files and append to depgraph -->
            <for param="depres.buildfile">
                <path>
                    <fileset dir="@{dir}" casesensitive="no">
                        <exclude name="disabled/**"/>
                        <include name="*/build.xml"/>
                    </fileset>
                </path>
                <sequential>
                    <var name="component.build.dependencies.prop" unset="true"/>
                    <var name="depres.buildfile.dir" unset="true"/>
                    <var name="depres.buildfile.name" unset="true"/>
                    <var name="depres.buildfile.relative" unset="true"/>

                    <dirname file="@{depres.buildfile}" property="depres.buildfile.dir"/>
                    <basename file="@{depres.buildfile}" property="depres.buildfile.name"/>
                    <property name="depres.buildfile.relative" value="@{depres.buildfile}" relative="true" />

                    <!-- Special call using ant-contrib to read dependency list stored in external build file -->
                    <var name="component.build.dependencies.prop" unset="true" />
                    <antcallback dir="${depres.buildfile.dir}" target="get-component-build-deps" antfile="${depres.buildfile.name}"
                        inheritall="false" return="component.build.dependencies.prop">
                        <!--<property name="basedir" value="${depres.buildfile.dir}"/>-->
                        <property name="component.build.dependencies.sep" value=","/>
                        <propertyset refid="ofbiz.subbuild.props.pass"/>
                    </antcallback>

                    <if>
                        <and>
                            <isset property="component.build.dependencies.prop" />
                            <not><equals arg1="${component.build.dependencies.prop}" arg2="" trim="true"/></not>
                        </and>
                        <then>
                            <var name="depres.depgraph" value="${depres.depgraph}#${depres.buildfile.relative}=${component.build.dependencies.prop}" />
                        </then>
                        <else>
                            <var name="depres.depgraph" value="${depres.depgraph}#${depres.buildfile.relative}" />
                        </else>
                    </if>
                </sequential>
            </for>

            <if>
                <or>
                    <not><isset property="depres.depgraph"/></not>
                    <equals arg1="${depres.depgraph}" arg2="" trim="true"/>
                </or>
                <then>
                    <echo message="${depres.topdirname}: No builds to invoke." />
                </then>
                <else>
                    <echo level="verbose" message="Dependency graph for ${depres.topdirname}:${line.separator}${depres.depgraph}" />

                    <!-- Invoke automatic dependency resolution algorithm -->
                    <var name="depres.builds" unset="true"/>
                        <var name="depres.stderr" unset="true"/>
                    <var name="depres.result" unset="true"/>
                    <java classname="com.ilscipio.scipio.ce.build.util.DependencyGraph" fork="true"
                        outputproperty="depres.builds" errorproperty="depres.stderr" resultproperty="depres.result" failonerror="false">
                        <arg value="-f=resolve-deps-dfs"/>
                        <!-- function to run -->
                        <!-- NOTE: using comma as file separator because fileset "includes" attributes uses this -->
                        <arg value="-do=,"/>
                        <!-- output delimiter -->
                        <arg value="-dn=#"/>
                        <!-- graph entry delimiter -->
                        <arg value="-de=="/>
                        <!-- graph element=deps pairs delimiter -->
                        <arg value="-dd=,"/>
                        <!-- graph deps delimiter -->
                        <arg value="-s=false"/>
                        <!-- strict mode -->
                        <arg value="-e=false"/>
                        <!-- use empty values -->
                        <arg value="-g=${depres.depgraph}"/>
                        <classpath>
                            <path location="${ofbiz.home.dir}/tools/misc/scipio-build-tools.jar"/>
                            <!-- FIXME: non-ideal location for this class -->
                        </classpath>
                    </java>
                    <if>
                        <not><equals arg1="${depres.result}" arg2="0"/></not>
                        <then>
                            <fail message="Error automatically resolving build dependencies for ${depres.topdirname} components:${line.separator}${line.separator}
${depres.stderr}${line.separator}${line.separator}
Please verify the ${depres.topdirname} component build.xml files
for possible errors in the component.build.dependencies build file references."/>
                        </then>
                    </if>
                    <echo message="${depres.topdirname}: Auto-determined build order from dependencies (component.build.dependencies):" />
                    <echo message="${depres.builds}" />

                    <!-- Sanity check -->
                    <if>
                        <or>
                            <not><isset property="depres.builds"/></not>
                            <equals arg1="${depres.builds}" arg2="" trim="true"/>
                        </or>
                        <then>
                            <fail message="Error automatically resolving build dependencies for ${depres.topdirname} components:${line.separator}${line.separator}
${depres.stderr}${line.separator}${line.separator}
Unexpectedly received empty list of builds to iterate."/>
                        </then>
                    </if>

                    <!-- Invoke build files with requested target, in the resolved order (after re-expand comma-separated deresbuilds names to file list) -->
                    <externalsubant target="@{target}">
                        <filelist dir="${ofbiz.home.dir}" files="${depres.builds}"/>
                    </externalsubant>
                </else>
            </if>
        </sequential>
    </macrodef>

    <!-- SCIPIO: Reads and partly validates the component's component.build.dependencies and returns them
        to caller (dep-subant) for automatic dependency resolution.
        A component build.xml file may define a build list of dependencies on other components, using the following format:
          <filelist dir="." id="component.build.dependencies"> <!- NOTE: MUST be filelist, not fileset ->
            <file name="../other1/build.xml" /> <!- explicit build file form: the referenced component build file must exist ->
            <file name="../other2" /> <!- abstracted component dependency: component may or may not have a build ->
          </filelist>
        The component.build.dependencies are file paths which must specify either a component directory
        or the project build file within it - you MUST use filelist and NOT fileset to express these.
        The second form requires the dependency to have a build, while the first is more abstracted
        and will work even if the component has no build project or it is removed (e.g., themes).
        Currently (2017-01-18), only dependencies on components within the same component directory (addons, hot-deploy, themes)
        have any tangible effect on dependency resolution; reordering is within given component directory only.
        Dependencies on components from other, lower-layer components directories which load first are
        allowed to appear and may be verified, but will have no functional effect.
        NOTE: These build-time dependencies are managed independently from the load-time
            dependencies (component loader), and are designated using filesystem paths as opposed
            to component names. However, it is recommended to keep the same order for
            build-time and load-time dependencies as much as possible.
            Currently (2017-01-18), Scipio supports this same directory-focused automatic
            dependency resolution for both build-time and load-time resolution; see the description
            for the "depends-on" xml element in the following file for the load-time mechanism:
              component://base/dtd/ofbiz-component.xsd
        FIXME?: get-component-build-deps must currently be defined in macros.xml due to theme patterns... -->
    <macrodef name="read-component-build-deps">
        <!--
            NOTE: Caller must specify:
            * component.build.dependencies.sep (context-dependent)
            * ofbiz.home.dir
        -->
        <sequential>
            <if>
                <isreference refid="component.build.dependencies"/>
                <then>
                    <var name="component.build.dependencies.prop" unset="true" />
                    <pathconvert property="component.build.dependencies.prop" refid="component.build.dependencies"
                        pathsep="${component.build.dependencies.sep}" setonempty="true">
                        <!-- DEV NOTE: see https://ant.apache.org/manual/Tasks/script.html for language details -->
                        <scriptmapper language="javascript"><![CDATA[
                            var proj = self.getProject();

                            var doFail = function(msg) {
                                var failTask = proj.createTask("fail");
                                failTask.setMessage("Project " + proj.getName() + ": component.build.dependencies: " + msg);
                                failTask.perform();
                            };
                            var echoMsg = function(msg) {
                                var echoTask = proj.createTask("echo");
                                echoTask.setMessage("Project " + proj.getName() + ": component.build.dependencies: " + msg);
                                echoTask.perform();
                            };
                            var stringEndsWith = function(str, suffix) { // old JS support
                                return str.indexOf(suffix, str.length - str.length) !== -1;
                            };

                            // NOTE: here source is the full path to file
                            var sourceFile = new java.io.File(source);
                            if (!sourceFile.exists()) {
                                doFail("missing or invalid build dependency: path does not exist: " + source);
                            } else {
                                var isDepAlreadyHandled = function(targetDep) {
                                    // SPECIAL: 2017-01-18: if the dependency is from a different top component directory
                                    // than the current one, and it is from one already loaded, then discard the dependency
                                    // because it is for all practical purposes already built.
                                    // (we currently do not support global dependency ordering)
                                    var homeDirPath = java.nio.file.Paths.get(proj.getProperty("ofbiz.home.dir"), []);
                                    var getCompDir = function(path) {
                                        var pathPath = java.nio.file.Paths.get(path, []);
                                        return homeDirPath.relativize(pathPath).getName(0);
                                    }

                                    var projCompDir = getCompDir(proj.getProperty("ant.file")); // NOTE: not basedir
                                    var depCompDir = getCompDir(targetDep);
                                    if (depCompDir.compareTo(projCompDir) !== 0) {
                                        var compDirsProp = proj.getProperty("ofbiz.component.dirs");
                                        if (compDirsProp) {
                                            var compDirs = compDirsProp.split(",");
                                            for(var i=0; i < compDirs.length; i++) {
                                                var compDirPath = java.nio.file.Paths.get(compDirs[i], []);
                                                if (projCompDir.compareTo(compDirPath) === 0) {
                                                    echoMsg("WARN: build dependency refers to a higher-layer component directory; build may fail: " + targetDep);
                                                    return false;
                                                } else if (depCompDir.compareTo(compDirPath) === 0) {
                                                    ; //echoMsg("build dependency ignored; already handled: " + targetDep);
                                                    return true;
                                                }
                                            }
                                        }
                                    }
                                    return false;
                                };

                                var validateCommitDep = function(targetDep) {
                                    self.addMappedName(targetDep);
                                };

                                if (stringEndsWith(source.toLowerCase(), ".xml") && sourceFile.isFile()) {
                                    // If explicit build file referenced as dependency, interpret as explicit request and don't modify.
                                    // In other words, the component must have a build file, otherwise dependency will fail.
                                    if (!isDepAlreadyHandled(source, sourceFile)) {
                                        validateCommitDep(source, sourceFile);
                                    }
                                } else if (sourceFile.isDirectory()) {
                                    if (!isDepAlreadyHandled(source, sourceFile)) {
                                        // Here, the reference is to the directory of the component, and we only
                                        // check the dependency if the component has in fact a build file.
                                        // If the component has no build file, we can ignore the build dependency,
                                        // though the component itself must exist.
                                        var dirBuildFile = new java.io.File(sourceFile, "build.xml");
                                        if (dirBuildFile.exists() && dirBuildFile.isFile()) {
                                            validateCommitDep(dirBuildFile.getPath(), dirBuildFile);
                                        } else {
                                            ; //echoMsg("build dependency ignored; has no build file: " + sourceFile.getName());
                                        }
                                    }
                                } else {
                                    doFail("missing or invalid build dependency: invalid path (must be a build.xml file or component directory): " + source);
                                }
                            }
                        ]]></scriptmapper>
                        <!-- strip the full path, make relative to ofbiz base folder (most versatile)
                            NOTE: this runs after the mapper (even if you list the map before the mapper) -->
                        <!--<globmapper from="${ofbiz.home.dir}/*" to="*" />-->
                        <map from="${ofbiz.home.dir}/" to="" />
                        <!-- this one may be safer for Windows -->

                        <!--<compositemapper>
                            <regexpmapper from="^(.*)/?(?<!\.xml)$" to="\1/build.xml" casesensitive="false" />
                            <regexpmapper from="^(.*\.xml)$" to="\1" casesensitive="false" />
                        </compositemapper>-->
                        <!--<filtermapper>
                          <scriptfilter language="beanshell">
                            self.setToken(self.getToken().toUpperCase());
                          </scriptfilter>
                        </filtermapper>-->
                    </pathconvert>
                    <!-- will be read using ant-contrib's antcallback/antfetch
                    <echo message="${component.build.dependencies.prop}"/>-->
                </then>
                <else>
                    <property name="component.build.dependencies.prop" value="" />
                </else>
            </if>
        </sequential>
    </macrodef>

    <!-- get-component-build-deps: basic form expected by dep-subant
        NOTE: We don't really want to define this here... but without it,
            a theme not using the new commontheme.xml would need to copy this into its build file
    <target name="get-component-build-deps"
        description="Reads this component's build dependencies from component.build.dependencies filelist (if any) and prepares for automatic dependency resolution (SCIPIO)">
        <read-component-build-deps/>
    </target>
    -->

    <!-- Removes all lib (jar) files from a component lib folder and its subfolders, without removing any subfolders,
        with the given exceptions as exclude-pattern -->
    <macrodef name="remove-lib-files">
        <attribute name="dir"/>
        <attribute name="excludes-refid" default=""/>
        <attribute name="include" default="**/*.jar"/>
        <!-- this takes a <selector> of <filename> elements -->
        <element name="patterns" optional="true"/>
        <sequential>
            <!-- FIXME: ugly duplication, ant kludge (but at least kind to caller) -->
            <if>
                <isreference refid="@{excludes-refid}"/>
                <then>
                    <!-- never delete empty dirs; never delete .git, .svn, .gitignore, ... -->
                    <delete includeemptydirs="false" defaultexcludes="true">
                        <fileset dir="@{dir}">
                            <include name="@{include}"/>
                            <patterns />
                            <!-- instead of taking excludes, take an include list and negate it
                            <patternset refid="@{excludes-refid}"/>-->
                            <not><selector refid="@{excludes-refid}"/></not>
                        </fileset>
                    </delete>
                </then>
                <else>
                    <delete includeemptydirs="false" defaultexcludes="true">
                        <fileset dir="@{dir}">
                            <include name="@{include}"/>
                            <patterns />
                        </fileset>
                    </delete>
                </else>
            </if>
        </sequential>
    </macrodef>

    <!-- ================================================================== -->
    <!-- SCIPIO: tasks common to main build and standalone component builds -->
    <!-- ================================================================== -->

    <target name="groovy-init" depends="ivy-init"><!-- SCIPIO: 2018-03-20: new -->
        <if>
            <resourcecount when="equal" count="0">
                <fileset file="${ofbiz.home.dir}/framework/base/lib/groovy-*.jar"/>
            </resourcecount>
            <then>
                <antcall target="download-groovy"/>
            </then>
        </if>
        <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpathref="groovy.class.path"/>
    </target>

    <target name="download-groovy" depends="ivy-init"><!-- SCIPIO: 2018-03-20: new -->
        <ivy:retrieve file="${lib.comp.base.ivyfile}" pattern="framework/base/lib/[artifact]-[revision].[ext]" conf="groovy"/>
    </target>

    <target name="ivy-init"><!-- SCIPIO: 2017-01-30: new -->
        <!-- DEV NOTE: WARN: for performance reasons, this code has to be COPIED into
            common.xml#lib-update; keep in sync -->
        <taskdef uri="antlib:org.apache.ivy.ant" resource="org/apache/ivy/ant/antlib.xml" classpathref="lib.ivy.class.path"/>
    </target>

    <target name="get-scipio-java-version" unless="scipio.java.version.major">
        <java classname="com.ilscipio.scipio.ce.build.util.BuildUtil" outputproperty="scipio.java.version.major">
            <arg value="-majorver"/>
            <classpath>
                <path location="${ofbiz.home.dir}/tools/misc/scipio-build-tools.jar"/>
            </classpath>
        </java>
        <echo level="info">scipio.java.version.major: ${scipio.java.version.major}</echo>
    </target>

    <macrodef name="get-ivy-versioned-confs">
        <attribute name="conf"/>
        <attribute name="ivyfile"/>
        <attribute name="outputproperty"/>
        <sequential>
            <var name="@{outputproperty}" unset="true"/>
            <java classname="com.ilscipio.scipio.ce.build.util.BuildUtil" outputproperty="@{outputproperty}">
                <arg value="-ivyverconf"/>
                <arg value="@{conf}"/>
                <arg value="@{ivyfile}"/>
                <classpath>
                    <path location="${ofbiz.home.dir}/tools/misc/scipio-build-tools.jar"/>
                </classpath>
            </java>
        </sequential>
    </macrodef>

</project>


I am a Russian-speaking international tax advisor with practical knowledge of the principles of individual and corporate international taxation and cross-border business planning. I have an excellent understanding of UK and Russian tax systems, particularly in dealing with international transactions and individual tax planning, particularly connected with immigration. I have a good understanding of the major European tax systems — Austria, Cyprus, Luxembourg, Malta, Netherlands, Switzerland. I am also a specialist in Russian corporate and commercial domestic legislation.
My clients are multinational SMEs, international entrepreneurs and HNWIs. I advise on cross-border tax-efficient business and investment structures and restructuring including commercial and residential real estate transactions. I deliver international tax solutions for cross-border intellectual property rights allocation and transfer pricing. I have significant practical experience addressing international residence and beneficial ownership issues. Many of my individual clients are high-net-worth Tier 1 Investors and Entrepreneurs coming to the UK.
I have spoken at numerous international conferences and taught international tax planning at the Law Faculty of Saint-Petersburg State University (SPbGU) and Moscow State Academy of Law named after Kutafin (MGYuA).
I have an excellent network of professional contacts across the US, Europe and the CIS. I speak English and Russian and I am fluent in French.
I am qualified to practice law in Russia.
The article explains the UK tax consequences of foreign HNWIs assuming UK residence as Tier 1 (Investor) migrants. The article offers several practical planning steps and outlines problem areas.
You are about to start a video call with Dmitry Zapol. Do you want to continue?
Dmitry Zapol cannot answer at the moment. Would you like to leave a message?


text:
Coalminers strike against Pittston Company in Virginia, USA, 1989-1990
To convince the Pittston Company to sign a contract with the United Mine Workers Union (UMWA) returning health benefits to retired miners and their dependents.
April 5, 1989 to February 20, 1990
Virginia, West Virginia, and Kentucky
Pittston Coal Mines
007. Slogans, caricatures, and symbols
051. Walk-outs
106. Industry strike
172. Nonviolent obstruction
of coal delivery trucks
189. Selective patronage
of companies in support of the strike
179. Alternative social institutions
created Camp Solidarity in order to house and feed Wildcat Strikers
of local businesses in support of the strike
Methods in 3rd segment
used Camp Solidarity to feed and house Wildcat Strikers
182. Stay-in strike
Methods in 4th segment
Approximately 8 weeks
UMWA union members, including Richard Trumka and Cecil Roberts
Wildcat Strikers from all over the country, Freedom Fighters, Daughters of Mother Jones
Cesar Chavez, Jesse Jackson, secretary of Labor Elizabeth Dole, then-AFL-CIO President Lane Kirkland
Pittston Coal Company
Minor picketer harassment by police, but no major violence.
American coal miners
Wildcat strikers
Groups in 1st Segment
UMWA
Daughters of Mother Jones
the Freedom Fighters
Additional notes on joining/exiting order
Cesar Chavez and Jesse Jackson came to support the protesters at some point in the campaign.
The group achieved most of its original goals, but the organization suffered from the continued costs of maintaining a large-scale protest.
In 1987, in order to cut costs, the Pittston Company chose to negotiate directly with the United Mine Workers Union (UMWA) at its own coal mines instead of with the Bituminous Coal Operators (BCOA) group which had previously regulated employees' health and retirement packages. However, in 1988, the Pittston Company ceased contributing to a benefit trust it had established in 1950 for miners who had retired before 1974. This decision left between 1,500 and 1,700 retirees, widows, and disabled miners without healthcare. The company also doubled its healthcare deductibles and began to keep mines running around the clock without giving its employees overtime pay. Finally, it eliminated the successorship clauses in its employees' contracts, the implication of which was that if a mine were sold off or leased, the workers would have no way of being sure they would keep their jobs. These efforts to cut costs – especially those related to healthcare – enraged union workers, many of whom had suffered serious injuries and health problems due to the hazardous working conditions in the mines.
On April 5, 1989, after the miners had worked without a contract for 14 months, Richard Trumka, the president of the UMWA, declared that the union was going on strike until a new contract was signed which restored the cut healthcare coverage. Over 2,000 mineworkers (mostly in Virginia but some also in Kentucky and West Virginia) walked out of the mines and began picketing. The Pittston Company brought in replacement workers almost immediately, so the strikers centered their tactics on slowing production and keeping the coal from being delivered to its destination once it was mined. In order to do this, picketers sat down in the road as the trucks bearing coal came toward them. At times multiple hundreds of protestors would be jailed in a day, thus blocking the coal delivery trucks from using the roads for hours at a time.
The tactics of the UMWA were explicitly nonviolent, yet a few of the union members and the supporters who came from all over the country did not share the union's strategy. This resulted in mostly non-union-affiliated picketers (also referred to as wildcat strikers) throwing rocks at coal delivery trucks, popping tires, breaking truck windows, and more such acts that damaged opponents' property. The non-UMWA presence among the protesters was enormous: by the height of the protest in June of 1989, there were 2,000 UMWA union miners on strike along with 37,000 - 40,000 wildcat strikers. This meant that at certain points there were nearly twenty times as many non-union participants as there were union participants in the struggle.
Along with sending monetary support, these wildcat strikers came from all over the country to protest. Their presence did much to bring attention to the strike, as did visits from Jesse Jackson, Cesar Chavez, and many well-known musicians and performers. The Daughters of Mother Jones fed and gave lodging to these visitors and wildcat strikers in a campground nearby, which strikers dubbed Camp Solidarity.
Women played a very important role in the campaign: Camp Solidarity was run by the Freedom Fighters, a group of women who took it upon themselves to feed and provide for the strikers. Another important women's group was the Daughters of Mother Jones, who not only helped to feed and house strikers but also took part in the strike themselves: twice every week they would picket outside the Pittston headquarters in Lebanon, Virginia, and on April 18, 1989 a group of 39 members held a sit-down strike at the company headquarters which lasted 36 hours in total and shut down all coal production for a day and a half. Neither the Freedom Fighters nor the Daughters of Mother Jones were officially affiliated with the UMWA, yet their support was critical to the union's eventual success in bringing about an agreement.
The decisive action of the campaign took place on Sunday September 17 at Moss 3, the central processing plant for the Pittston Company. Ninety-nine union members were selected to conduct a surprise sit-down strike in the plant. They successfully ceased production for all four days that they stayed on the site, and thousands gathered outside in support of the sit-down. On September 20 all union members left, apparently tipped off to the fact that that State Troopers would arrive an hour later to force them to disperse or arrest them.
The Moss 3 action brought even further national attention to the campaign and the next month Elizabeth Dole, the United States Secretary of Labor, visited the strike site and appointed former Labor Secretary William Usery, Jr., to serve as a mediator. Three months later, on January 1, 1990, a settlement between the Pittston Company and the UMWA union was announced and was put into effect on February 20. The union won a new contract that included the reinstatement of health and retirement benefits to miners. Another major victory for coal miners followed two years after the strike had ended, but is widely attributed to the events at the Pittston mines: the Coal Act of 1992 stated that all coal mines must provide their workers with health and retirement benefits, and extended benefits from unionized companies to union workers whose employers were no longer in business.
Although the campaign ended in success for the miners, it was a mixed success at best. The UMWA had poured many of its resources into the campaign, and at the end of the strike was fined $64 million, including $200,000 for the Moss 3 action. Many of these fines were eventually dropped and replaced by 10,000 hours of community service. The Pittston Company suffered financially under the new agreement, and eventually sold many of its coal plants to a non-union company.
Despite the mixed success of the strike in the long run, it is still regarded as one of the most successful struggles of the last few decades of the 20th century, especially because it resulted in the creation of the Coal Act.
Brisbin, Richard A. A Strike Like No Other Strike: Law and Resistance during the Pittston Coal Strike of 1989-1990. Baltimore: Johns Hopkins University Press, 2002.
Sessions, Jim. "Singing across Dark Spaces: The Union/Community Takeover of Pittston's Moss 3 Plant," in Stephen L. Fisher, ed, Fighting Back in Appalachia: Traditions of Resistance and Change. Philadelphia: Temple University Press, 1993.
Birecree, Adrienne M. "The importance and implications of women's participation in the 1989–1990 Pittston coal strike". Journal of Economic Issues. Lincoln: Mar 1996. Vol. 30, Iss. 1; pg 187, 14 pgs.
Hayes, Sharon. Times News."Twenty Years Later, Impact of Bitter Dispute between Pittston, UMWA Still Felt." Kingsport Times News | Kingsport, Tennessee. 26 June 2009. Accessed 13 Feb. 2011.
Dotter, Earl. Tricities "1989 Pittston Coal Strike A Battle." Bistol Herald Courier. 6 September 2009. Accessed 13 Feb. 2011.
Although the success of the strike in the long run is dubious, its importance as a rallying-point for the American organized labor of the day is unquestionable.
Edited by Max Rennebohm (25/07/2011)
Elowyn Corby, 13/02/2011

redpajama_set_name: RedPajamaCommonCrawl


Himachal Pradesh is a tiny hill state whose pleasant summers make it a popular holiday resort. The Raj still lingers in Shimla, the state capital and former summer capital during British rule.
Kullu-Manali are neighbouring resorts, surrounded by pine covered hills and lush meadows. Himachal has, in addition to popular resort towns, a series of secluded hill retreats ideal for interested anglers, trekkers and those wanting a quiet getaway.
Many of these include: from Shimla - Mashobra, Kufri, Naldehra; those around Kullu-Manali include Manikaran, Naggar and Brighu Lake; the barely accessible valleys of Lahaul and Spiti are a trekker's delight.
The state of Himachal Pradesh is made up of ten districts with a total area of 56,019 sq km. The northern border of Himachal Pradesh is bounded by Tibet, in the north-west it borders Kashmir, in the south lie the plains of Punjab and the eastern border is common with the hills of Uttar Pradesh. The state is rugged and mountainous, and the valleys of Lahaul and Spiti are the dream of mountaineers.
Lahaul and Spiti is a desolate region in comparison to the lush Beas valley of Kullu, also a popular mountain area of the state. Spiti, which overlooks Tibet across the Sutlej river, is Tibetan in landscape and in the character of its few inhabitants. Kullu and Lahaul are good areas for mountaineers practising both alpine style ascents and ski-mountaineering. The jagged ice peaks of Kullu offer good routes for the 'tiger' as well as the less ambitious mountaineer. A popular peak in this area is Deo Tibba (6,001 m) which is visible from Shimla, the capital of Himachal Pradesh, and Indrasan (6,221 m), a challenging peak of steep red granite which can be climbed from four different routes.
The Menthosa snowpeak in Chamba at 6,445 m has never been totally conquered, nor has Dharmasura (6,446 m) in the Bara Shigri glacier region, though they provide opportunity for some excellent mountaineering.
A close cluster of the M&KR series in the Milang river basin has more than a dozen peaks over 6,000 m high worthy of the hardiest ridge runners. Himachal may well hold the track record for peaks that have defied a first time ascent. For example, the Chandra Bhaga watershed and the Parvati valley have several over 6,000 m peaks, most still unclimbed.
Narkanda lies forty miles north of Shimla on Kipling's famous Hindustan-Tibet road at a height of nearly 9000 ft. The nearby peak, Hathu, dominates the great watershed of India, for from here you can see both the Sultej and the Giri which flow into the Indus and Ganges systems respectively.
The skiing season in Narkanda starts in January and lasts into the first week of April. While you may have six to ten feet of snow, the motor road to Shimla usually remains open and this makes Narkanda a very convenient destination from the cities of north India.
The slopes will appeal to the cross country skier for Narkanda is set amidst fine conifer forests. A short distance to the west of a PWD bungalow are the beginners' slopes in a clearing and a tow bar (or T-bar) has also been installed. The Hathu slopes on the east delight those who want to get away from it all, and it is possible to ski down towards the famous Stokes (the apple kings of India) country at Kotgarh. The government-run classes provide their own equipment. The beauty of Narkanda is that being only an over-night's journey from Delhi one can fit in a skiing weekend at rates easily the lowest in the world and against a backdrop of the finest forest and mountain scenery. While Narkanda is quite developed, skiing at Kufri is still taking off, and has the advantage of proximity to the plains. The Manali region offers scope for both winter as well as summer skiing.
When the snows herald in winter, the area around Solang Nala attracts skiers to its extensive natural slopes. In the summer months, there are limited skiing possibilities on the slopes of the Rohtang Pass. The government-run classes provide their own centre with a natural open-air ice-skating rink. Under Scandal Point on the north side of the ridge facing the Dhauladhar are Blessington's tennis courts which become, in the months of December and January, Shimla's Ice Rink. The Shimla Club is privately run and has been instrumental in popularising all three disciplines on ice for more than twenty years: figure skating, ice hockey and speed skating. Boots are made to measure in Shimla itself. Seasonal membership is inexpensive and national championships are held annually.
It is in Garhwal Himalaya mountains that the infant holy Ganga finds its source. The Garhwal Himalayas stretch just over 290 km and are separated from the Punjab Himalayas by the river Sutlej. Garhwal was the first part of the Himalayas to be explored and surveyed, and the highest peak in these mountains is less than 8,000 metres. Garhwal is flanked by Tibet in the north, Kumaon in the east, Bijnor in the south and Tehri and Dehra Dun in the west.
Nanda Devi, also called the 'pearl of the Himalayas' is the highest peak in the Garhwal mountains. Nanda Devi has twin peaks, the main peak and the east peak. The main peak was climbed in 1936 by H.W. Tilman andN.E. Odell while the east peak was scaled in 1939 by a Polish team. Nanda Devi is revered since ancient times and worshipped as the Goddess Nanda. T.G. Longstaff, one of the earliest explorers of the Garhwal region has described the holy mountain as: "No mountain in the world is more beautiful than Nanda Devi."
Another popular peak in the Garhwal region is Kamet. Ten expeditions attempted this peak before it was finally scaled in 1931 by a team led by Frank. S. Smythe.
At the traditional source of the Ganges one can find the best mountaineering area probably in the world. A few kilometres above the ice cave from which the river takes birth are the meadows of Tapovan and Nandanvan, spread at the base of the most magnificent panorama of peaks you will ever see. The peaks are mainly over the 20,000 ft mark and still have unclimbed faces offering alpine style ascents. Mount Shivling has often been compared to the Matterhorn. All along the 30 km length of the Gangotri glacier are side glaciers, some not yet fully explored. One can also traverse to the southern face of the crest which provides steeper ice faces.


Having trouble with women's health issues? Come to our Austin acupuncture clinic to get relief.
Traditional Chinese medicine takes a fascinating approach to the female reproductive cycle, one that is guided by nature, Daoist principles and yin/yang theory. There are different aspects of the menstrual cycle which are distinctly yin and yang; however, the constant movement and flux of hormones throughout a woman's life can lead to a variety of imbalances.
Menstruation support: Menstruation should be painless and accompanied by minimal pre- and postmenstrual symptoms. Acupuncture causes blood vessels to dilate, improving ovarian and uterine blood circulation and reducing menstrual pain and cramping. Acupuncture can regulate periods by balancing hormonal communication between the brain and the ovaries. Once hormones are balanced, the body will function properly, ovulation will occur, and menses will follow suit on a regular interval.
Menopause support: During menopause, many women experience uncomfortable or even debilitating symptoms. According to Chinese medicine, imbalanced interaction between Kidney yin and yang leads to difficulties during menopause. Symptoms of yang deficiency in menopause may include tiredness, lower back pain, incontinence, and aversion to cold. Symptoms of yin deficiency (the far more common type) include hot flashes, night sweats, insomnia, and irritability.


New Rochelle, NY, Feb. 13, 2017 -- A pivotal registration trial to evaluate in-home use of the Medtronic MiniMed® 670G hybrid closed-loop insulin delivery system over 3 months showed a significant reduction in HbA1c levels for both adolescents and adults with type 1 diabetes. None of the participants experienced a severe hypoglycemic or diabetic ketoacidosis event, demonstrating the safety of system, as reported in an article published in Diabetes Technology & Therapeutics (DTT), a peer-reviewed journal from Mary Ann Liebert, Inc., publishers. The article is available free on the DTT website .
The article entitled "Glucose Outcomes with the In-home Use of a Hybrid Closed-loop Insulin Delivery System in Adolescents and Adults with Type 1 Diabetes," is coauthored by Satish Garg, MD, University of Colorado Denver (Aurora) and DTT Editor-in-Chief, and a team of researchers from Yale University (New Haven, CT), Stanford University (CA), Atlanta Diabetes Associates (GA), AMCR Institute (Escondido, CA), Rainier Clinical Research Center (Renton, WA), Sheba Medical Center (Tel Hashomer, Israel), University of Virginia (Charlottesville, VA), International Diabetes Center (Minneapolis, MN), and Medtronic (Northridge, CA).
The researchers reported a significant decrease in the time participants spent in hypoglycemia and, similarly, a significant increase in the proportion of sensor glucose readings that were in the target range (71-180 mg/dL) during the study period for both adults and adolescents. Adult subjects used the system with Auto Mode (hybrid closed-loop) enabled for a median 88% of the time (>21 hrs/day). The MiniMed® 670G hybrid closed-loop system automatically increases, decreases, and suspends insulin delivery in response to continuous glucose monitoring.


text:
The equipment aboard an EP-3E electronic surveillance plane
Since the start of the Snowden-revelations in 2013, many people got the impression that the US National Security Agency (NSA) mainly intercepts the communications of ordinary citizens. In reality, the NSA is part of the Department of Defense and as such, a large part of its job is to collect data for tactical military purposes.
A good example of the latter task comes from an internal NSA damage assessment report about the 2001 Hainan Island incident, in which an EP-3E electronic surveillance aircraft collided with a Chinese fighter jet and had to make an emergency landing on the Chinese island of Hainan.
The report was among the Snowden-documents and published by The Intercept on April 10. As will be shown here, it provides many details about both the interception and the encryption equipment aboard the EP-3E aircraft.
A Lockheed EP-3E electronic surveillance aircraft from the US Navy
(photo: US Navy - click to enlarge)
Damage assessment
The purpose of the report was to review and assess the damage to cryptologic sources and methods and the response of the US SIGINT agencies to the crisis. The second was to review and assess emergency destruction of classified material and the emergency procedures.
In general, damage to Communications Security (COMSEC) systems, like cryptographic devices, keying material and encryption methodology, was considered low, mainly because cryptographic devices are designed in anticipation of being lost or compromised.
For Signals Intelligence (SIGINT), the equipment to intercept communications and other signals as well as the results of these efforts, there was an opposite approach: the assumption had been that sensitive SIGINT material would be protected at all time, or destroyed before it was lost or compromised.
Because emergency destruction techniques didn't kept pace with technology, especially where they often no longer reside in hardware, but in software. The Hainan incident revealed that existing destruction procedures were outdated and inadequate. Also, individual and crew training appeared to be deficient and lacked realism and context.
Nevertheless, damage in the realm of tactical SIGINT was assessed to be medium, which means that the damage was recoverable with concerted effort.
The damaged EP-3E after it had landed on the Hainan island
The EP-3E aircraft
The EP-3E aircraft is a modified version of the Lockheed P-3 Orion, which is a four-engine turboprop aircraft developed for the US Navy and introduced in the 1960s. The Platform Integration division of the military contractor L-3 converted several P-3Cs into the EP-3E, which is also known as ARIES (Airborne Reconnaissance Integrated Electronic System). The Navy has 11 EP-3Es, the last of which was delivered in 1997.
The plane generally has a crew of 24, including linguists, cryptographers and technicians. The EP-3E that flew over the South China Sea carried an 18-member reconnaissance team from the Navy, Marines, and Air Force, in addition to a 6-member flight crew. The position of their workstations can be seen in this schematic from the damage assessment report:
Other tactical SIGINT spy planes are the Boeing RC-135 COBRA BALL, COMBAT SENT or RIVET JOINT of the US Air Force, the De Havilland RC-7 Airborne Reconnaissance Low (ARL) of the US Army and the Beechcraft (R)C-12 Huron, which is used by the Army, the Navy, the Air Force and the Marine Corps.
Together with other flying spying platforms like drones and satellites, these planes contribute to what is called Overhead Collection. The NSA's other primary information channels are cable access, hacking operations, joint NSA-CIA units and foreign partnerships.
COMINT equipment
COMINT stands for Communications Intelligence, which is information derived from the interception of foreign communications, either between people or between machines. Together, COMINT and ELINT (see below) are called SIGINT.
The COMINT collection system onboard the EP-3E consisted of antiquated HF, VHF, and UHF receivers, a rudimentary signal distribution network, and narrowband cassette recorders. The COMINT collection system used the ALD-9 antenna and processor package. In addition to installed equipment, six carry-on computers were onboard.
The COMINT equipment was generally unclassified with the exception of two carry-on computers, a SCARAB computer containing the LUNCHBOX PROFORMA processor and a laptop containing MARTES analysis tools. All data on these two systems was considered compromised.
Although other planes in the military's spy fleet had recently undergone a major surveillance equipment upgrade, the plane that ended up in Chinese hands was two weeks away from getting one, so the equipment was old and outdated and a lot of it didn't work properly.
SCARAB computer
The SCARAB is a portable computer device that contained the LUNCHBOX processor, which uses software to process 40 worldwide PROFORMA signals, some teleprinter and pager signals, datalink signals for the HUNTER and PREDATOR drones, and the Joint Air to Surface Stand Off Missile (JASSM) datalink. Additionally, the SCARAB computer contained the XBIT Signals Analysis software for bit manipulation and BLACKMAGIC demodulation software.
The SCARAB computer containing the LUNCHBOX processor for PROFORMA data
(photo: EP-3E incident report - click to enlarge)
PROFORMA is the codename for digital command and control data communications that relay information and instructions to and from radar systems, weapon systems (like surface-to-air missiles, anti-aircraft artillery, fighter aircraft), and control centers.
Exploitation of this information provides US and allied warfighters nearly instantaneous situational awareness data from a target country's radar systems. This information supplements US sensor systems while providing insight into the target country's decision process.
Several working aides aboard the EP-3E provided details about Russian-designed PROFORMA signals used by North Korea, Russia, Vietnam, and possibly China. This material detailed the association of signals to specific weapon systems. China was known to use two of the signals resident in the LUNCHBOX processor.
For the 2001 mission over the South China Sea, the Science and Technology (S&T) Operator aboard the EP-3E was tasked to collect and process PROFORMA signals possibly associated with Chinese SA-10 surface-to-air missiles and Chinese short-range air navigation.
MARTES laptop
Besides the SCARAB computer, there was also a Tadpole Ultrabook IIi laptop, which contained the MARTES software tools, the RASIN Manual, the RASIN Manual Working Aid and the Telegraphic Codes Manual.
RASIN stands for Radio Signals Notation and is the COMINT Signal Classification System for classifying and reporting a wide variety of signals with their associated parametrics and characteristics. Together, the RASIN manual and the aforementioned files provided a comprehensive overview of how US intelligence exploits an adversary's signal environment.
The Tadpole Ultrabook IIi laptop with MARTES software tools
MARTES is the name of a set of software tools for collecting, analyzing, and processing signals. A new version of MARTES is released approximately every six months, and it is generally divided into COMINT, FISINT and ELINT tools.
A portable, digital player/recorder used to collect the signals analyzed by MARTES contained a tape of 45 minutes of enciphered and unenciphered Chinese Navy communications. The unenciphered portions carried speech segments that identified Chinese communicants.
The compromise of the largely tactical COMINT documentation was rated medium. The most sensitive and damaging documentation contained detailed collection requirements against Chinese military datalink and microwave signals. The tasking data included frequencies, data rates, dish sizes, and target communicants.
Also compromised was the ability of the US to collect Chinese submarine signal transmissions and make subsequent vessel correlations. This compromise could prompt the Chinese to modify that particular signal.
ELINT equipment
ELINT stands for Electronic Intelligence and comprises the technical and intelligence information obtained from the intercept and analysis of noncommunication, electromagnetic radiations.
The ELINT systems onboard the EP-3E included a disparate collection of antennas, signal distribution networks, wideband and narrowband receivers, recorders, and processing and display equipment. The bulk of these systems were off-the-shelf devices that, although designed for the ELINT mission, contained no particularly sensitive technologies.
The system that were of a specific concern after the Hainan incident included the AN/ULQ-16 and the AN/ALQ-108. The AN/ULQ-16 is a computerized pulse processor used to make detailed timing measurements of radar signals. The AN/ALQ-108 is an enemy IFF (Identify Friend or Foe) interrogation system, which is used to actively and passively exploit early Soviet IFF and range extension signals.
Emergency destruction of the ELINT equipment during the Hainan incident was largely ineffective. The crew zeroized (deleted) all memories and erased all mission data, but the rugged construction of critical components and lack of destruction tools prevented adequate destruction.
For internal communications, the EP-3E uses the the Digital Communications Management System (DCMS). All operational crew positions have access to the DCMS with headsets or through their helmets, with the exception of personnel in the galley and observers in the flight station. Communication paths between crew members are divided into various audio networks.
For communications with the outside world, there are numerous radios onboard, which connect to a variety of radio networks. Short-range communications are conducted using both plain voice and secure VHF and UHF radios. When the aircraft is on a mission for Sensitive Reconnaissance Operations (SRO), long-range communications with NSA and military operation centers are conducted via HF radio and over secure UHF satellite networks.
Radio/satellite transceivers
The EP-3E was equipped with the following radio transmitter/receivers (transceivers):
- Two AN/ARC-94 HF radios for long-range communication. One (HF-1) is configured for secure modem communications and is encrypted using a KG-84C encryption device. The other (HF-2) is configured for voice communications and can be encrypted using a KYV-5 encryption device.
- Three AN/ARC-206 radios for UHF line-of-sight communications. UHF-1 and UHF-2 are controlled by the Senior Evaluator (SEVAL) and are configured for voice communications. Both can be encrypted using KY-58 encryption devices. A third AN/ARC-206 radio is configured for line-of-sight datalink operations.
- Two AN/ARC-182 radios for VHF or UHF line-of-sight communications. Both are controlled from the flight station and are configured for voice communications. Both can be encrypted using KY-58 encryption devices. The control units for these radios have a switch setting allowing an easy and immediate change to emergency frequencies.
- One LST-5 satellite radio for secure UHF voice satellite communications. The radio can only be controlled locally at its location is in an avionics bay inside the aircraft cabin. It is encrypted using a KY-58 encryption device.
- The OL-390 Digital Communications Group and its associated UHF radio are used for secure satellite modem communications. The radio is controlled by the secure communications operator and is encrypted using a KG-84A encryption device. Because this radio shares distribution and antenna equipment with the LST-5, simultaneous transmission using both radios is not possible.
Encryption devices
For securing voice and data communications, the EP-3E had 16 encryption devices onboard, of the following types:
- The KY-58, which is used for voice and data encryption at 16 Kb/sec over AM/FM, VHF and UHF radio and satellite channels. The device can be used for data up to the classification level TOP SECRET. It accepts keys from the family of Common Fill Devices and also incorporates remote keying. The production of the KY-58, which is part of the VINSON family, was completed in 1993.
A KY-58 encryption device
(photo via jproc.ca - click to enlarge)
- The KG-84, which is used for data encryption at 64 Kb/sec over radio and satellite channels. The KG-84 can be used for communications up to the level of TOP SECRET, depending on the key-set that is loaded, and is fully complient with NSA TEMPEST standards. Like similar encryption devices, the KG-84 can be controlled either locally, or remotely (for example from the cockpit) through a Remote Control Unit (RCU).
KG-84C (left) and a KG-84A (right) encryption devices
- The KYV-5, which is used for voice or data encryption over HF, VHF and UHF radio and satellite channels. The KYV-5 is a relatively small communications security module which is attached to a larger CV-3591 converter, together forming a TACTERM unit. The device is part of the Advanced Narrowband Digital Voice Terminal (ANDVT) family.
A KYV-5 encryption device attached to a CV-3591 converter
The damage assessment report isn't clear about whether the Chinese removed these encryption devices from the plane before giving it back to the US. The particular equipment had previously been compromised, though not directly to China, and the report also mentions that components of for example the KG-84 had also been available through sites like eBay.
Cryptographic materials
Beside the KY-58, KG-84 and KYV-5 encryption devices, the EP-3E also carries KYK-13 and KOI-18 electronic fill devices, a KL-43 off-line encryption device, and a Global Positioning System (GPS) unit.
The EP-3E that landed on the Hainan island also carried keying and other cryptographic materials for its various secure devices, including Top Secret keying material in canisters, entire codebooks, and call sign lists. In all, this was much more than what was needed for the mission: nearly a month's worth of keying material and codebook pages that were not scheduled to become effective until well after the scheduled landing.
Instead, the use of an electronic key loading device such as the CYZ-10 Data Transfer Device (DTD) could have eliminated the risk of hardcopy keying material compromise. These devices can hold multiple keys, load multiple devices, and are easily zeroized.
During the Hainan incident, most cryptographic keys and codebooks had been jettisoned by the plane's crew, but the remaining material was considered compromised. However, all the encryption keys (except for the worldwide GPS key) were replaced by new ones within 15 hours of the EP-3E's emergency landing.
A COMSEC Material System (CMS) box containing cryptographic keying material
(photo: EP-3E incident report)
The radio equipment onboard the EP-3E conntected to the following networks:
- The Global High Frequency System (GHFS), which is a worldwide network of highpower HF stations that provides air/ground HF command and control radio communications between ground agencies and US military aircraft. The GHFS network supports Sensitive Reconnaissance Operations aircraft by passing encoded advisory conditions (NICKELBACK), position reports and administrative traffic. As of October 1, 2002, the network was renamed into High Frequency Global Communications System (HFGCS).
- The Pacific Tributary Network (PTN), which is a UHF secure voice satellite network that provides COMINT advisory support and threat warning to deployed US and allied forces. Network participants include the Pacific Reconnaissance Operations Center (PACROC), which provides coordination and flight following to SRO aircraft, the NSA's Kunia Regional SIGINT Operations Center (KRSOC) on Hawaii and the National Security Operations Center (NSOC) at Fort Meade.
- The SENSOR PACER network, which is a UHF secure low data-rate digital satellite network that provides time-sensitive SIGINT reporting, COMINT advisory support, threat warning, and administrative traffic support to Sensitive Reconnaissance Operations platforms worldwide. Network participants include KRSOC and the Tactical SIGINT Interaction Center at Kadena AB, Okinawa (TSIC-K).
- The SIERRA ONE Early Warning network, which is a UHF secure voice satellite network utilized by 5th and 7th Fleet Orion P-3's and EP-3E's for tactical reporting and coordination. Network participants include all PACOM Tactical Support Centers (TSC) and CTF 57/72, Kami Seya, Japan.
Labels: ELINT
Robert Gilims said...
Electronic Equipment is used to create signals and capture responses from electronic devices under test (DUTs). In this way, the proper operation of the DUT can be proven or faults in the device can be traced.
Bob Firment said...
I worked on the ALQ-108 and KY-58 as an avionics tech from 83-86 in an E-2 squadron. Surprised the 108 was still in use. It was a literal black box system from the 1960s. It originally had a self destruct package but it was sometimes being set off by carrier landings so it was removed.
The equipment aboard an EP-3E electronic surveilla...


as well as sculpture. He has old favourites such as branch walking as well as new works with interesting biomorphic pieces of human form as well as landscape.
There was also an interesting exhibition from local artists in St Pedrog church hall as part of the Gwyl Gelf arts festival.


text:
Dick and Joan
Retired NFL
On November 19, 2015, Dick and Joan Flutie, the parents of former NFL quarterback Doug Flutie, died within an hour of each other, both from heart attacks.
In the 60s, my dad played organ in a 12-piece big band group, so growing up there was always a keyboard of some kind in our house. Right away, my brothers and I got into music. I play the drums now, but also played the trumpet as a kid and can fool around a little on the piano. Not that they loved the music we played, but when my younger brother Darren and I put a band together, it gave dad a lot of satisfaction. He'd sit with mom, getting blown out in the back of the house because it was too loud … but he loved it.
In the 90s, dad decided to recruit some of the top high school musicians around Melbourne Beach, Florida, and form another big band. They went out and played a bunch of gigs, and even recorded a CD. One time, Darren and I told him we'd come down and play with the group. He couldn't do enough coordinating and publicity for the event. He wanted everything to be just right.
For us, this was a nice moment. Something fun we could do for him. But for dad, it was really special — one of his all-time favorite days. You could see it in his face.
Dad may have enjoyed seeing us play music even more than sports. Music was one of his true passions. So much more personal for him. In the back of his mind, I think dad's dream when we were young was to have a family band.
But growing up in Florida, being outdoors all the time, sports was our interest. And whatever our interest was, he and my mom were going to dive in full bore with us.
In the spring of 1976, my family moved from Melbourne Beach to Natick, Massachusetts, just outside Boston. They had already held tryouts for Babe Ruth Baseball. Still, dad wanted a spot for his boys to play. They said no, because teams are already set, and blah, blah, blah. So dad said to give him all the kids that were cut. He would put them on a team with me and my older brother Bill, and he'd coach. Basically, he was granting the opportunity to 15 kids who otherwise wouldn't have had a chance to play.
We almost won a championship.
The following fall, we wanted a chance to play football, but Natick had no Pop Warner program. So dad teamed up with a friend and started one.
He had no real background in sports. He played on the golf team in high school, but his athleticism was practically nothing. So dad read up and taught himself about the sports we loved. I remember him studying "The Science of Hitting," by Ted Williams. How to hit. How to throw. When it came time to coach, he made himself more knowledgeable than the other guys in the league. Dad had this amazing ability to be obsessive about one thing at a time. To get locked in, poring over the smallest details to try and master them, whether with music, photography, or learning a sport inside-out.
I get my drive from him. My athleticism, however, comes from mom.
The only organized thing she played when she was young was high school basketball, back when they made the girls play 6-on-6, you were only allowed two dribbles before passing, and half the team couldn't cross halfcourt. (The first time she described it to me, I didn't believe her.) But she was nonetheless an amazing athlete.
Let me put it to you this way: Our house was towards the bottom of a hill. About three-fourths of the way up, one of our friends had a half-court basketball blacktop. We were playing 3-on-3, right around dinnertime. Mom came up the street to get us. This is in high school — I was probably a freshman or sophomore, and Bill a year older. She challenged us to a race back down the hill to our house. She's got her jeans on, and is barefoot.
She kicked our asses.
Mom's athleticism and strength transcended sports. They were part of an energy and determination that were amazing. When she was in her mid-50s, mom and dad lived on a big lot with a steep downhill slope towards the lake in back. It was all brush, with big pine trees. You couldn't even walk through it. She cleared the entire hill. She chopped up the trees, cleared it out for firewood, then planted grass seed. Mom bought railroad ties and made a winding pathway to the water. After the landscapers she hired said they wouldn't cut the grass anymore because the grade was too steep, mom was out there in her golf spikes, lowering the lawn mower, then pulling in back up.
I think it was for her 68th birthday that we bought her a new chainsaw.
Mom was as instrumental in our sports as dad. She coached my sister Denise's softball team, and started a cheerleading program at Pop Warner. For years, she was in charge of the concession stand at the ball field, always running across town to pick up ice, or candy to sell. She would be the first one there and the last one to leave at night, closing everything out. It was like a full-time job.
As a kid, you take for granted the sacrifices your parents make to be so involved. Looking back, it wasn't until college that I realized that what they did was not typical. The battles they fought for our opportunities. How they arranged their lives around our interests. How during my junior year of high school, dad was offered a promotion that would have moved us back to Florida, away from my town and teammates. He left the decision up to me, and I wanted to stay in Natick. So we did. Growing up, we didn't have a lot of money. Where we were living in Melbourne Beach, you had to pay for trash collection. Mom used to go and spread out our trash amongst the neighbors', then come back with a broken chair and fix it. We didn't have a dime and bills were sometimes paid late, but we always had a new baseball glove or bat if we needed it.
But it wasn't just about me and my siblings. My parents always advocated for other kids to have their chance. Beyond starting up and then managing different leagues (most of which still exist today), if kids needed a ride to the field, they'd go get them make sure the team had enough players to play. As a coach, dad loved and appreciated the kids who weren't stars. He didn't need to spend hours with the top hitters on the team, like some coaches do. Every little league team has three or four guys who just aren't ballplayers, just going up to the plate hoping for the walk. Dad spent more time with those kids so they could just get the bat on the ball and be part of the team.
When those kids had success, he celebrated like they were his own.
It's a quality they helped pass to my children.
My son Dougie has autism. He is low functioning and different. When my daughter Alexa would bring friends to the house, she would bring them straight to Dougie, make them introduce themselves and interact with him. Her teachers always said that when Alexa went to class, she would go out of her way to make the kids who were outcasts feel part of the group. It's something I've tried to do all my life. First with kids on teams I played on, and then with my son.
As you get older, you understand who taught you those lessons.
Dad could never have gone on without my mom, if she had passed before him. He adored her. Even at 70 years old, he thought she was sexier than any woman alive. He's always been that way with mom. But while dad's health was failing from diabetes and kidney issues, mom was healthy. She was strong, still playing tennis three times a week, still hitting a golf ball, still cutting down trees in the yard. We saw how hard she worked to take care of him — 24-hours a day, wrapping his legs, helping him get in and out of the car — so we thought maybe when dad's time came, she'd have a better quality of life on her own.
But that's not what mom wanted. The way things happened, it was pretty obvious that she couldn't have gone on without him, either. Even though it's hard for me to wrap my head around, you've got to go with the philosophy that she wanted to be with dad, taking care of him.
But it's still something that I'm struggling with.
More than a little bit.
Bill and I are in our 50s, still playing baseball just for fun. Mom and dad would show up to every game. I would always joke, "You guys got your season tickets early this year. You got the good seats, sitting right up front!"
There was nobody else in the stands.
Dad wasn't as mobile as he used to be, so he'd bring an electric scooter right to the edge of the bleachers. Mom would set her folding chair next to him, and they'd just watch. It could be a cold, drizzly night, it could be a warm sunny morning. They were always there. They'd been there, really, all the way back to the 70s. In that spot, always together, as they had been since high school, and through 56 years of marriage.
I remember a game where Bill was hit by a pitch. The ball was going maybe 50 miles an hour. He could have caught it and thrown it back. Still, mom got upset. Dad let out a scream and was yelling at the pitcher. Another time, one of the guys wanted to play second base. My position. In these adult leagues — "old man baseball," we call it — guys substitute freely and rotate positions. Really, it's just about everyone getting out and playing. So I jumped to the outfield.
Then I heard it.
"Doug is not an outfielder! He's a second baseman!"
"Mom," I yelled, "Relax! We're 50 years old, for crying out loud!"
It didn't matter how old we were. Our parents never stopped fighting for us or protecting us.
And we will never stop missing them.