java - In ant, how do I create a path that works on multiple platforms? -


i'm creating ant script parses androidmanifest.xml file.

there class, xpathtask, want create taskdef. this, need specify path ant-tasks.jar file in user's filesystem. example, taskdef:

 <taskdef name="xpath" classname="com.android.ant.xpathtask">      <classpath>          <pathelement location="${sdk.dir}/tools/lib/ant-tasks.jar" />      </classpath>  </taskdef> 

i ${sdk.dir} property android build.xml, that's not problem. additional path jar file need (./tools/lib/ant-tasks.jar) needs tacked onto end of it.

what i'm doing here works on macos , i'm guessing work on linux. haven't tested on windows yet have hunch fail because file path separators / instead of \.

does ant provide mechanism creating platform-agnostic file paths? or can use have here , ant smart enough know mean? (haha!)


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -