Index: trunk/src/robotbuilder/exporters/GenericExporter.java =================================================================== --- trunk/src/robotbuilder/exporters/GenericExporter.java (revision 614) +++ trunk/src/robotbuilder/exporters/GenericExporter.java (working copy) @@ -99,6 +99,10 @@ rootContext.put("version", RobotBuilder.VERSION); rootContext.put("version-indicator", "RobotBuilder Version: "+RobotBuilder.VERSION); rootContext.put("robot", robot); + String filePath = robotTree.getFilePath(); + String rootDir = filePath == null ? + "" : filePath.substring(0,filePath.lastIndexOf("/")); + rootContext.put("robot-root", rootDir); rootContext.put("helper", this); rootContext.put("Collections", Collections.class); rootContext.put("file-separator", File.separator); Index: trunk/resources/export/wiring/ExportDescription.yaml =================================================================== --- trunk/resources/export/wiring/ExportDescription.yaml (revision 614) +++ trunk/resources/export/wiring/ExportDescription.yaml (working copy) @@ -4,8 +4,10 @@ Files: files.yaml Required Properties: - Wiring File -Vars: - export-path: ${robot.getProperty('Wiring File').getValue()} +Vars: + export-path-dir: ${robot.getProperty('Wiring File').getValue()} + export-path-dir-head: "#if($export-path-dir.contains('/'))$export-path-dir.substring(0,$export-path-dir.lastIndexOf('/'))#else$export-path-dir#end" + export-path: "#if(${export-path-dir-head}=='.' || ${export-path-dir-head}=='..')${robot-root}${file-separator}#end${export-path-dir}" Macros: macros.vm ## Else deals with the hell that is windows. Post Export Action: "#if(${export-path.startsWith(\"/\")})#Browse:file://${export-path}#else#Browse:file:///${export-path.replace(\"\\\", \"/\").replace(\" \", \"%20\")}#end" Index: trunk/resources/export/java/ExportDescription.yaml =================================================================== --- trunk/resources/export/java/ExportDescription.yaml (revision 614) +++ trunk/resources/export/java/ExportDescription.yaml (working copy) @@ -57,7 +57,9 @@ Vars: team-number: ${robot.getProperty('Team Number').getValue()} robot-name: ${robot.getName().replace(' ', '')} - project: ${robot.getProperty('Java Project Directory').getValue()}$file-separator$robot-name + project-dir: ${robot.getProperty('Java Project Directory').getValue()} + project-dir-head: "#if($project-dir.contains('/'))$project-dir.substring(0,$project-dir.lastIndexOf('/'))#else$project-dir#end" + project: "#if(${project-dir-head}=='.' || ${project-dir-head}=='..')${robot-root}${file-separator}#end${project-dir}${file-separator}${robot-name}" use-default-package-p: ${robot.getProperty('Use Default Java Package').getValue()} package: "#if($use-default-package-p==true)org.usfirst.frc${team-number}.${robot-name}#else${robot.getProperty('Java Package').getValue()}#end" package-path: ${project}/src/${package.replace('.', '/')} Index: trunk/resources/export/cpp/ExportDescription.yaml =================================================================== --- trunk/resources/export/cpp/ExportDescription.yaml (revision 614) +++ trunk/resources/export/cpp/ExportDescription.yaml (working copy) @@ -55,8 +55,10 @@ Vars: team-number: ${robot.getProperty('Team Number').getValue()} - robot-name: ${robot.getName()} - project: ${robot.getProperty('C++ Windriver Workspace').getValue()}/$robot-name + robot-name: ${robot.getName()}i + project-dir: ${robot.getProperty('C++ Windriver Workspace').getValue()} + project-dir-head: "#if($project-dir.contains('/'))$project-dir.substring(0,$project-dir.lastIndexOf('/'))#else$project-dir#end" + project: "#if(${project-dir-head}=='.' || ${project-dir-head}=='..')${robot-root}${file-separator}#end${project-dir}${file-separator}${robot-name}" Macros: macros.vm