Browse Source

Made templating example more sensible

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269249 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
cf4a207d88
3 changed files with 6 additions and 119 deletions
  1. +0
    -119
      proposal/myrmidon/src/make/sample.ati
  2. +4
    -0
      proposal/myrmidon/src/make/template-simple.ati
  3. +2
    -0
      proposal/myrmidon/src/make/template-simple.properties

+ 0
- 119
proposal/myrmidon/src/make/sample.ati View File

@@ -1,119 +0,0 @@
<?xml version="1.0"?>

<?xsl-param name="foo" value="bar"?>
<?xsl-params location="sample.properties"?>
<?xsl-stylesheet href="template-simple.xsl"?>

<!--
==============================================================================

Sample build file

Authors:
Peter Donald <donaldp@apache.org>

Legal:
Copyright (c) 2000 The Apache Software Foundation. All Rights Reserved.

==============================================================================
-->

<project name="MySample" default="main" basedir="."
xmlns:ant="http://jakarta.apache.org/2001/Ant/ant"
xmlns:doc="http://jakarta.apache.org/2001/Ant/doc"
xmlns:blee="http://jakarta.apache.org/2001/Ant/blee" >

<?xsl-params ignored="true"?>
<projectref name="prim" location="primitive-tests.ant" />
<import library="core.atl" />

<property name="year" value="2000"/>

<target name="main" depends="typedef-test, converterdef-test, datatype-test, namespace-test, ant1-tasklib-test" />

<target name="all" depends="property-test, typedef-test, converterdef-test, ant-call-test, datatype-test, namespace-test, ant1-tasklib-test, prim->main" />

<!--
<register-tasklib lib="../../dist/lib/core.atl" />
-->

<target name="property-test">
<property name="blah" value="fred" />
<property name="${blah}" value="barney" />

<echo message="Doing the funky Echo with ${blah} ${fred} Year=${year}!"/>
</target>

<target name="typedef-test">
<typedef name="echo2"
type="task"
classname="org.apache.myrmidon.libs.core.Echo"
lib="../../dist/lib/core.atl" />

<echo2 message="Luke to Echo base. Can you hear me?"/>
</target>

<target name="converterdef-test">
<converterdef classname="org.apache.myrmidon.libs.core.StringToClassConverter"
source-type="java.lang.String"
destination-type="java.lang.Class"
lib="../../dist/lib/core.atl" />
</target>

<target name="ant-call-test">
<!-- test elided until we decide scope and necessity of ant-call -->
<echo message="AntCall test elided until we decide scope and necessity of ant-call"/>
<!--
<ant-call target="ant-call-test-target">
<param name="blah" value="blah-value" />
</ant-call>
-->
</target>

<target name="ant-call-test-target">
<echo message="This should fail ...."/>
<echo message="${blah}"/>
<echo message="Whoa - it no fail. You used ant-call to call me and set param blah!"/>
</target>

<target name="datatype-test">
<property name="foo">
<pattern name="*.java"/>
</property>

<pattern id="foo2" name="*.java" if="..." />

<echo message="foo=${foo}" />
<echo message="foo2=${foo2}" />
</target>

<target name="namespace-test">

<!-- ant and doc are built in namespaces -->
<echo ant:fail-on-error="true" message="Some random message">
<doc:description>
Test case for aspects
</doc:description>
<ant:some-element some-attribute="blah"/>
</echo>

<!-- load facility for blee: namespace -->
<facility namespace="blee">
<noop/>
</facility>

<echo blee:some-param="blah" message="Blee namespace test successful!"/>

</target>

<target name="ant1-tasklib-test">

<ant1-tasklib prefix="a1-" lib="../../dist/lib/ant1-compat.jar"/>

<a1-echo message="Boo!" />
<a1-mkdir dir="../../dist/test"/>
<a1-copy file="../../tools/lib/ant.jar" tofile="../../dist/test/ant1-compat.jar" />

</target>

</project>

+ 4
- 0
proposal/myrmidon/src/make/template-simple.ati View File

@@ -1,5 +1,9 @@
<?xml version="1.0"?>

<?xsl-params location="template-simple.properties"?>
<?xsl-param name="bar" value="baz"?>
<?xsl-stylesheet href="template-simple.xsl"?>

<project default="main" basedir=".">

<target name="main">


+ 2
- 0
proposal/myrmidon/src/make/template-simple.properties View File

@@ -0,0 +1,2 @@
# Here is sample property file
foo=bar

Loading…
Cancel
Save