[Yanel-dev] resource-type.xml and package

simon litwan simon.litwan at wyona.com
Tue Feb 26 00:51:04 CET 2008


Michael Wechner schrieb:
> simon litwan wrote:
>
>>
>>>>> +    <!-- TODO: Figure out the directory where the resource class 
>>>>> is located in -->
>>>>> +<!--
>>>>> +    <copy file="${resource.home.dir}/resource.xml" 
>>>>> todir="${resource.classes.dir}/TODO"/>
>>>>> +-->
>>>>>     <mkdir dir="${resource.lib.dir}"/>
>>>>>
>>>>> basically one needs to "analyze" the class name.
>>>>>
>>>>> Any idea how this could be done with ant?
>>>>
>>>>
>>>> ant-contrib is your friend. something like this:
>>>> <propertyregex property="new.resource.java.class.fs.path"
>>>>              input="${new.resource.java.class.package}"
>>>>              regexp="[.]"
>>>>              replace="/"
>>>>              global="true"
>>>>              casesensitive="false" />
>>>
>>>
>>>
>>> cool :-) Do you want to provide a patch ;-)
>>
>> how do i actually get the class name?
>
>
> from the resource.xml or when you create/copy the build.xml and the 
> user types in the package name.
>
> I think it would be good if the user would see a Message:
>
> IMPORTANT: Please choose a unique package name in order to avoid 
> conflicts
>
> or something like that
with this you'll get the files copied to right place. it's not a beaty 
but it works. maybe someone knows a better way.

    <propertyregex property="new.resource.java.classname.fs.path"
             input="${resource.resource.xml.resource(class)}"
             regexp="[.]"
             replace="/"
             global="true"
             casesensitive="false" />
             <echo>${new.resource.java.classname.fs.path}</echo>
    <propertyregex property="new.resource.java.class.fs.path"
             input="${new.resource.java.classname.fs.path}"
             regexp="\/[^/]*$"
             replace=""
             global="true"
             casesensitive="false" />
             
<echo>hilfes${resource.classes.dir}/${new.resource.java.class.fs.path}</echo>
    <copy 
todir="${resource.classes.dir}/${new.resource.java.class.fs.path}">
      <fileset dir="${resource.home.dir}" 
includes="resource**,htdocs/**,yanel-htdocs/**"/>
    </copy>          

WDOT?
simon
>
> HTH
>
> Michi
>
>>
>> simon
>>
>>>
>>> Thanks
>>>
>>> Michi
>>>
>>>>
>>>> simon
>>>>
>>>>>
>>>>> Thanks
>>>>>
>>>>> Michi
>>>>>
>>>>>>
>>>>>>> is there some documentation?
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> http://yanel.wyona.org/en/documentation/resources/using-a-resource-type.html 
>>>>>>
>>>>>>
>>>>>> is this clarifying?
>>>>>>
>>>>>> Cheers
>>>>>>
>>>>>> Michi
>>>>>>
>>>>>>>
>>>>>>> <resource-type package="org.wyona.yanel.impl.resources.redirect" 
>>>>>>> src="/SOME_ABSOLUTE_PATH/contributions/resources/redirect/" 
>>>>>>> compile="true"/>
>>>>>>>
>>>>>>> cheers
>>>>>>> simon
>>>>>>> _______________________________________________
>>>>>>> Yanel-development mailing list
>>>>>>> Yanel-development at wyona.com
>>>>>>> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> Yanel-development mailing list
>>>> Yanel-development at wyona.com
>>>> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
>>>
>>>
>>>
>>>
>>
>> _______________________________________________
>> Yanel-development mailing list
>> Yanel-development at wyona.com
>> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
>
>
>



More information about the Yanel-development mailing list