×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: XML
Posted by: Jefferson Joel Huebla Tacuri
Added: Apr 21, 2022 5:29 PM
Views: 10
Tags: no tags
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.    Licensed to the Apache Software Foundation (ASF) under one
  5.    or more contributor license agreements.  See the NOTICE file
  6.    distributed with this work for additional information
  7.    regarding copyright ownership.  The ASF licenses this file
  8.    to you under the Apache License, Version 2.0 (the
  9.    "License"); you may not use this file except in compliance
  10.    with the License.  You may obtain a copy of the License at
  11.  
  12.      http://www.apache.org/licenses/LICENSE-2.0
  13.  
  14.    Unless required by applicable law or agreed to in writing,
  15.    software distributed under the License is distributed on an
  16.    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17.    KIND, either express or implied.  See the License for the
  18.    specific language governing permissions and limitations
  19.    under the License.
  20.  
  21. -->
  22. <project name="{0} (run)" default="run" basedir=".">
  23.     <target name="-init-paths">        
  24.         <translate-classpath classpath="${classpath}" targetProperty="classpath-translated" />
  25.         <translate-classpath classpath="${modulepath}" targetProperty="modulepath-translated" moduleOriented="true" />
  26.         <property name="run.jvmargs" value="" />
  27.         <property name="work.dir" value="${basedir}"/>
  28.         <property name="application.args" value="" />
  29.         <property name="java.failonerror" value="true"/>
  30.     </target>
  31.     <target if="named.module.internal" depends="-init-paths" name="-init-macrodef-java-with-modules">
  32.         <macrodef name="call-java">
  33.             <attribute default="${module.name}" name="modulename"/>
  34.             <attribute default="${classname}" name="classname"/>
  35.             <attribute default="${modulepath-translated}" name="modulepath"/>
  36.             <attribute default="${classpath-translated}" name="classpath"/>
  37.             <attribute default="jvm" name="jvm"/>
  38.             <element name="customize" optional="true"/>
  39.             <sequential>
  40.                 <java module="@{modulename}" classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" jvm="${platform.java}">
  41.                     <classpath>
  42.                         <path path="@{classpath}"/>
  43.                     </classpath>
  44.                     <modulepath>
  45.                         <pathelement path="@{modulepath}"/>
  46.                         <pathelement location="${module.root}"/>
  47.                     </modulepath>
  48.                     <jvmarg value="-Dfile.encoding=${encoding}"/>
  49.                     <redirector errorencoding="${encoding}" inputencoding="${encoding}" outputencoding="${encoding}"/>
  50.                     <jvmarg line="${run.jvmargs}"/>
  51.                     <syspropertyset>
  52.                         <propertyref prefix="run-sys-prop."/>
  53.                         <mapper from="run-sys-prop.*" to="*" type="glob"/>
  54.                     </syspropertyset>
  55.                     <customize/>
  56.                 </java>
  57.             </sequential>
  58.         </macrodef>
  59.     </target>
  60.     <target if="unnamed.module.internal" depends="-init-paths" name="-init-macrodef-java-with-unnamed-module">
  61.         <macrodef name="call-java">
  62.             <attribute default="${classname}" name="classname"/>
  63.             <attribute default="${modulepath-translated}" name="modulepath"/>
  64.             <attribute default="${classpath-translated}" name="classpath"/>
  65.             <attribute default="jvm" name="jvm"/>
  66.             <element name="customize" optional="true"/>
  67.             <sequential>
  68.                 <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" jvm="${platform.java}">
  69.                     <classpath>
  70.                         <path path="@{classpath}"/>
  71.                     </classpath>
  72.                     <modulepath>
  73.                         <path path="@{modulepath}"/>
  74.                     </modulepath>
  75.                     <jvmarg value="-Dfile.encoding=${encoding}"/>
  76.                     <redirector errorencoding="${encoding}" inputencoding="${encoding}" outputencoding="${encoding}"/>
  77.                     <jvmarg line="${run.jvmargs}"/>
  78.                     <syspropertyset>
  79.                         <propertyref prefix="run-sys-prop."/>
  80.                         <mapper from="run-sys-prop.*" to="*" type="glob"/>
  81.                     </syspropertyset>
  82.                     <customize/>
  83.                 </java>
  84.             </sequential>
  85.         </macrodef>
  86.     </target>
  87.     <target name="-init-macrodef-java-without-modules" depends="-init-paths" unless="modules.supported.internal">
  88.         <macrodef name="call-java">
  89.             <attribute default="${classname}" name="classname"/>
  90.             <attribute default="${classpath-translated}" name="classpath"/>
  91.             <attribute default="jvm" name="jvm"/>
  92.             <element name="customize" optional="true"/>
  93.             <sequential>
  94.                 <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" jvm="${platform.java}">
  95.                     <jvmarg value="-Dfile.encoding=${encoding}"/>
  96.                     <redirector errorencoding="${encoding}" inputencoding="${encoding}" outputencoding="${encoding}"/>
  97.                     <jvmarg line="${run.jvmargs}"/>
  98.                     <classpath>
  99.                         <path path="@{classpath}"/>
  100.                     </classpath>
  101.                     <syspropertyset>
  102.                         <propertyref prefix="run-sys-prop."/>
  103.                         <mapper from="run-sys-prop.*" to="*" type="glob"/>
  104.                     </syspropertyset>
  105.                     <customize/>
  106.                 </java>
  107.             </sequential>
  108.         </macrodef>
  109.     </target>
  110.     <target depends="-init-macrodef-java-with-modules,-init-macrodef-java-with-unnamed-module,-init-macrodef-java-without-modules" name="run">
  111.         <call-java>
  112.             <customize>
  113.                 <arg line="${application.args}"/>
  114.             </customize>
  115.         </call-java>
  116.     </target>
  117. </project>
  118.