1 28 29 30 package org.objectweb.ecm.taskdefs; 31 32 35 public class JacORBIDLtoJavaTask 36 extends IDLtoJavaTask 37 { 38 40 public 42 JacORBIDLtoJavaTask() 43 { 44 } 46 47 51 final protected void 52 compileIDL(java.io.File idlfile, java.io.File compileto, 53 java.io.File [] includedirs, String prefix) 54 { 55 org.apache.tools.ant.Task task = getProject().createTask("java"); 57 org.apache.tools.ant.taskdefs.Java java = (org.apache.tools.ant.taskdefs.Java)task; 58 java.setClassname("org.jacorb.idl.parser"); 59 java.setFork(true); 60 java.setFailonerror(true); 61 62 org.apache.tools.ant.types.Path cp = java.createClasspath(); 64 cp.setRefid(new org.apache.tools.ant.types.Reference("JacORB.class.path")); 67 org.apache.tools.ant.types.Commandline.Argument args = java.createArg(); 68 69 OSHelper.pathConvert(getProject(), "os.JacORB.idl.dir", "JacORB.idl.dir"); 72 OSHelper.pathConvert(getProject(), "os.JacORB.idl.omg.dir", "JacORB.idl.omg.dir"); 73 String argline = "-D__JACORB__"+ 74 " -I"+getProject().getProperty("os.JacORB.idl.dir")+ 75 " -I"+getProject().getProperty("os.JacORB.idl.omg.dir"); 76 77 for (int i=0;i<includedirs.length;i++) { 79 argline = argline+" -I"+includedirs[i].getPath(); 80 } 81 82 86 String i2jline = " -i2jpackage CORBA:org.omg.CORBA "+ 88 " -i2jpackage CosNaming:org.omg.CosNaming "+ 89 " -i2jpackage CosTransactions:org.omg.CosTransactions "+ 90 " -i2jpackage CosPersistentState:org.omg.CosPersistentState "+ 91 " -i2jpackage CosTrading:org.omg.CosTrading "+ 92 " -i2jpackage CosTradingRepos:org.omg.CosTradingRepos "+ 93 " -i2jpackage CosTradingDynamic:org.omg.CosTradingDynamic "+ 94 " -i2jpackage Components:org.omg.Components "+ 95 " -i2jpackage objectweb:org.objectweb "+ 97 " -i2jpackage ECA:org.coach.ECA "+ 98 " -i2jpackage ECM:org.coach.ECM "; 99 100 argline = argline+i2jline+" -W 1 -d "+compileto.getPath()+" "+idlfile.getPath(); 101 args.setLine(argline); 103 104 java.execute(); 106 } 107 } 108 | Popular Tags |