Revision: 4175 http://vexi.svn.sourceforge.net/vexi/?rev=4175&view=rev Author: mkpg2 Date: 2011-07-06 12:21:17 +0000 (Wed, 06 Jul 2011)
Log Message: ----------- Update-fix. Generate xml .vexipath files. Modified Paths: -------------- trunk/org.vexi-build.shared/meta/module.revisions trunk/org.vexi-build.vexi.archive/meta/module.xml trunk/org.vexi-build.vexi.archive/src/main/java/org/vexi/build/vexi/archive/VexidevProject.java Modified: trunk/org.vexi-build.shared/meta/module.revisions =================================================================== --- trunk/org.vexi-build.shared/meta/module.revisions 2011-07-06 03:47:00 UTC (rev 4174) +++ trunk/org.vexi-build.shared/meta/module.revisions 2011-07-06 12:21:17 UTC (rev 4175) @@ -1 +1 @@ -{"https:\/\/svn.origo.ethz.ch\/ebuild":"451"} \ No newline at end of file +{"https:\/\/svn.origo.ethz.ch\/ebuild":"453"} \ No newline at end of file Modified: trunk/org.vexi-build.vexi.archive/meta/module.xml =================================================================== --- trunk/org.vexi-build.vexi.archive/meta/module.xml 2011-07-06 03:47:00 UTC (rev 4174) +++ trunk/org.vexi-build.vexi.archive/meta/module.xml 2011-07-06 12:21:17 UTC (rev 4175) @@ -5,7 +5,8 @@ <dependencies> <system name="jre" tag="1.5"/> - <dependency source="ibiblio" org="org.antlr" name="stringtemplate" tag="3.2.1" /> + <dependency source="local" name="vexidev.conf" /> + <dependency source="ibiblio" org="org.antlr" name="stringtemplate" tag="3.2.1" /> <dependency source="ebuild.org" name="api.plugin" /> <dependency source="ebuild.org" name="lib.ant" /> </dependencies> Modified: trunk/org.vexi-build.vexi.archive/src/main/java/org/vexi/build/vexi/archive/VexidevProject.java =================================================================== --- trunk/org.vexi-build.vexi.archive/src/main/java/org/vexi/build/vexi/archive/VexidevProject.java 2011-07-06 03:47:00 UTC (rev 4174) +++ trunk/org.vexi-build.vexi.archive/src/main/java/org/vexi/build/vexi/archive/VexidevProject.java 2011-07-06 12:21:17 UTC (rev 4175) @@ -3,12 +3,13 @@ import java.io.File; import java.io.FileWriter; import java.io.IOException; -import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.HashSet; +import java.util.Set; +import org.vexi.vexidev.conf.EntryType; +import org.vexi.vexidev.conf.Xml; + import ebuild.api.IEBuild; import ebuild.api.IGenConfArgument; import ebuild.api.IModuleProject; @@ -16,7 +17,6 @@ import ebuild.api.common.Scope; import ebuild.api.log.ILogger; import ebuild.util.Callable; -import ebuild.util.JSONUtil; public class VexidevProject { final IEBuild ebuild; @@ -42,48 +42,61 @@ } private void generateDotVexipath() throws Exception{ - final List<String> projects = new ArrayList(); - final List<String> source = new ArrayList(); - + final Xml.ProjectPath projectPath = Xml.emptyProjectPath(); + new Callable() { - private void addSrcFolder(String kind, Scope scope) throws Exception{ + Set seen = new HashSet(); + + private void addSrcFolder(String kind, Scope scope, Xml.ScopePath scopePath) { String path = module.getArtifactPath(kind, scope, "vexi"); - if(!module.getProjectFile(path).exists()) return; - source.add("F/"+module.getName()+"/"+path); + if(!module.getProjectFile(path).exists()) return; + Xml.SourceDir sourceDir = new Xml.SourceDir(); + sourceDir.path = path; + scopePath.sources.add(sourceDir); } - private void addSrcFolders(Scope scope) throws Exception{ - addSrcFolder("src", scope); - addSrcFolder("gen", scope); - } - public Object run() throws Exception { - addSrcFolders(Scope.MAIN); - addSrcFolders(Scope.POKE); - addSrcFolders(Scope.TEST); - - for(IModuleProject mod: module.getWorkspaceDependencies(Scope.POKE)){ - projects.add("P/"+mod.getName()); - } - - + + private void add(Scope scope, Xml.ScopePath scopePath){ + addSrcFolder("src", scope, scopePath); + addSrcFolder("gen", scope, scopePath); + + Collection<File> archives = module.getBuildDependencies(Scope.POKE, "vexi.vexi"); for(File archive: archives){ - // A for absolute? - source.add("A/"+archive.getAbsolutePath()); + if(seen.contains(archive)) continue; + seen.add(archive); + + /// Find workspace relative + String path = ebuild.getPathInWorkspace(archive); + Xml.PathEntry entry = new Xml.PathEntry(); + entry.path = path; + entry.type = EntryType.workspace_archive; + scopePath.dependencies.add(entry); } - - return null; + + + for(IModuleProject mod: module.getWorkspaceDependencies(scope)){ + if(seen.contains(mod)) continue; + seen.add(mod); + + Xml.PathEntry entry = new Xml.PathEntry(); + entry.name = mod.getName(); + entry.type = EntryType.project; + scopePath.dependencies.add(entry); + } } + + public Object run() throws Exception { + add(Scope.MAIN, projectPath.main); + add(Scope.POKE, projectPath.poke); + add(Scope.TEST, projectPath.test); + return null; + } }.run(); - - Map vexipathObj = new HashMap(2); - vexipathObj.put("source",source); - vexipathObj.put("projects",projects); - - logger.log("Generating:"); - logger.log(" .vexipath"); - JSONUtil.writeObject(new FileWriter(module.getProjectFile(".vexipath")), vexipathObj); + FileWriter fw = new FileWriter(module.getProjectFile(".vexipath")); + Xml.serialize(fw, projectPath); + fw.close(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn