From: Eric P. <th...@us...> - 2010-08-22 07:16:25
|
Update of /cvsroot/sandev/sand/platform/sandbuild/src/org/sandev/sandbuild In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv27560 Modified Files: SandBuildDriver.java Log Message: replaced SAND_HOME ant property retrieval with getSandRootDirName Index: SandBuildDriver.java =================================================================== RCS file: /cvsroot/sandev/sand/platform/sandbuild/src/org/sandev/sandbuild/SandBuildDriver.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SandBuildDriver.java 30 Nov 2005 18:03:35 -0000 1.2 --- SandBuildDriver.java 22 Aug 2010 07:16:17 -0000 1.3 *************** *** 1,5 **** /* * SAND development/deployment environment ! * Copyright (C) 2004 SAND Services Inc. * * This library is free software; you can redistribute it and/or --- 1,5 ---- /* * SAND development/deployment environment ! * Copyright (C) 2004,2010 SAND Services Inc. * * This library is free software; you can redistribute it and/or *************** *** 143,147 **** /** ! * mutator for buildRoot. If buildRoot is null, and is being set * to something other than null, and buildTrigger is null, then set * buildTrigger as well. --- 143,147 ---- /** ! * Mutator for buildRoot. If buildRoot is null, and is being set * to something other than null, and buildTrigger is null, then set * buildTrigger as well. *************** *** 154,157 **** --- 154,185 ---- + /** + * A reference to the canonical name of the root sand directory. + * The default value is calculated off the current running root + * which is assumed to be xxx/sand/deploy/yyy/build + */ + protected static String sandRootDirName=null; + /** accessor for sandRootDirName */ + public static String getSandRootDirName() + { + try { + File file=new File("."); + String canpath=file.getCanonicalPath(); + canpath=canpath.substring(0,canpath.lastIndexOf(File.separator)); + canpath=canpath.substring(0,canpath.lastIndexOf(File.separator)); + canpath=canpath.substring(0,canpath.lastIndexOf(File.separator)); + sandRootDirName=canpath; + } catch(Exception e) { + e.printStackTrace(); + } + return sandRootDirName; + } + /** mutator for sandRootDirName */ + public static void setSandRootDirName(String rootDirName) + { + sandRootDirName=rootDirName; + } + + //////////////////////////////////////// // buildTrigger access *************** *** 598,603 **** ArrayList nodes=new ArrayList(); initSandDecls(root,allGens,structs,nodes); ! String declFiles=getDeclFiles(structs,nodes, ! root.getAntProject().getProperty("SAND_HOME")); String genPath=getGenPath(root); ArrayList all=new ArrayList(structs); --- 626,630 ---- ArrayList nodes=new ArrayList(); initSandDecls(root,allGens,structs,nodes); ! String declFiles=getDeclFiles(structs,nodes,getSandRootDirName()); String genPath=getGenPath(root); ArrayList all=new ArrayList(structs); *************** *** 925,944 **** /** ! * Use the given project to look up the SAND_HOME property from Ant. ! * Remove any trailing file separator character from the result. */ public static String getSandHome(SandProject proj) throws SandBuildException { ! if(proj==null) { ! throw new SandBuildException("SandBuildDriver.getSandHome: proj is null."); } ! if(proj.getAntProject()==null) { ! throw new SandBuildException("SandBuildDriver.getSandHome: proj.getAntProject() is null."); } ! String home=proj.getAntProject().getProperty("SAND_HOME"); ! if((home==null)||(home.equals(""))) { ! throw new SandBuildException("SandBuildDriver.getSandHome: unable to find SAND_HOME property."); } ! if((home.endsWith("/"))||(home.endsWith("\\"))) { ! home=home.substring(0,home.length()-1); } ! return home; } --- 952,962 ---- /** ! * This used to look up a root property from the current project, ! * now it just calls through to getSandRootDirName */ public static String getSandHome(SandProject proj) throws SandBuildException { ! return getSandRootDirName(); } |