Jaxx-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
April 2009
- 3 participants
- 92 discussions
[Buix-commits] r1334 - in guix/trunk/guix-maven-plugin: . src/main/java/org src/main/java/org/codelutin/guix src/main/java/org/nuiton src/main/java/org/nuiton/guix src/test/java/org src/test/java/org/nuiton
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
17 Apr '09
Author: kmorin
Date: 2009-04-17 15:44:37 +0000 (Fri, 17 Apr 2009)
New Revision: 1334
Added:
guix/trunk/guix-maven-plugin/src/main/java/org/nuiton/
guix/trunk/guix-maven-plugin/src/main/java/org/nuiton/guix/
guix/trunk/guix-maven-plugin/src/main/java/org/nuiton/guix/GuixMojo.java
guix/trunk/guix-maven-plugin/src/test/java/org/nuiton/
guix/trunk/guix-maven-plugin/src/test/java/org/nuiton/guix/
Removed:
guix/trunk/guix-maven-plugin/src/main/java/org/codelutin/guix/GuixMojo.java
Modified:
guix/trunk/guix-maven-plugin/pom.xml
Log:
Modification des packages en org.nuiton au lieu de org.codelutin
Modified: guix/trunk/guix-maven-plugin/pom.xml
===================================================================
--- guix/trunk/guix-maven-plugin/pom.xml 2009-04-17 15:42:06 UTC (rev 1333)
+++ guix/trunk/guix-maven-plugin/pom.xml 2009-04-17 15:44:37 UTC (rev 1334)
@@ -8,7 +8,7 @@
<!-- ************************************************************* -->
<parent>
- <groupId>org.codelutin.guix</groupId>
+ <groupId>org.nuiton.guix</groupId>
<artifactId>guix</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
Deleted: guix/trunk/guix-maven-plugin/src/main/java/org/codelutin/guix/GuixMojo.java
===================================================================
--- guix/trunk/guix-maven-plugin/src/main/java/org/codelutin/guix/GuixMojo.java 2009-04-17 15:42:06 UTC (rev 1333)
+++ guix/trunk/guix-maven-plugin/src/main/java/org/codelutin/guix/GuixMojo.java 2009-04-17 15:44:37 UTC (rev 1334)
@@ -1,19 +0,0 @@
-package org.codelutin.guix;
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-
-/**
- *
- * @author morin
- * @goal testMojo
- */
-public class GuixMojo extends AbstractMojo
-{
-
- @Override
- public void execute() throws MojoExecutionException, MojoFailureException {
- GuixLauncher gcl = new GuixLauncher();
- }
-}
Copied: guix/trunk/guix-maven-plugin/src/main/java/org/nuiton/guix/GuixMojo.java (from rev 1332, guix/trunk/guix-maven-plugin/src/main/java/org/codelutin/guix/GuixMojo.java)
===================================================================
--- guix/trunk/guix-maven-plugin/src/main/java/org/nuiton/guix/GuixMojo.java (rev 0)
+++ guix/trunk/guix-maven-plugin/src/main/java/org/nuiton/guix/GuixMojo.java 2009-04-17 15:44:37 UTC (rev 1334)
@@ -0,0 +1,19 @@
+package org.nuiton.guix;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+/**
+ *
+ * @author morin
+ * @goal testMojo
+ */
+public class GuixMojo extends AbstractMojo
+{
+
+ @Override
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ GuixLauncher gcl = new GuixLauncher();
+ }
+}
1
0
[Buix-commits] r1333 - in guix/trunk/guix-compiler: . src/main/java/org src/main/java/org/codelutin/guix src/main/java/org/codelutin/guix/compiler src/main/java/org/codelutin/guix/model src/main/java/org/codelutin/guix/tags src/main/java/org/nuiton src/main/java/org/nuiton/guix src/main/java/org/nuiton/guix/compiler src/main/java/org/nuiton/guix/model src/main/java/org/nuiton/guix/tags src/test/java/org src/test/java/org/nuiton
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
17 Apr '09
Author: kmorin
Date: 2009-04-17 15:42:06 +0000 (Fri, 17 Apr 2009)
New Revision: 1333
Added:
guix/trunk/guix-compiler/src/main/java/org/nuiton/
guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/
guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/GuixLauncher.java
guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/compiler/
guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/compiler/GuixCompiler.java
guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/model/
guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/model/AttributeDescriptor.java
guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/model/ClassDescriptor.java
guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/tags/
guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/tags/TagManager.java
guix/trunk/guix-compiler/src/test/java/org/nuiton/
guix/trunk/guix-compiler/src/test/java/org/nuiton/guix/
Removed:
guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/GuixLauncher.java
guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/compiler/GuixCompiler.java
guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/model/AttributeDescriptor.java
guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/model/ClassDescriptor.java
guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/tags/TagManager.java
Modified:
guix/trunk/guix-compiler/pom.xml
Log:
Modification des packages en org.nuiton au lieu de org.codelutin
Modified: guix/trunk/guix-compiler/pom.xml
===================================================================
--- guix/trunk/guix-compiler/pom.xml 2009-04-17 13:57:47 UTC (rev 1332)
+++ guix/trunk/guix-compiler/pom.xml 2009-04-17 15:42:06 UTC (rev 1333)
@@ -7,7 +7,7 @@
<!-- *** POM Relationships *************************************** -->
<!-- ************************************************************* -->
<parent>
- <groupId>org.codelutin.guix</groupId>
+ <groupId>org.nuiton.guix</groupId>
<artifactId>guix</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
Deleted: guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/GuixLauncher.java
===================================================================
--- guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/GuixLauncher.java 2009-04-17 13:57:47 UTC (rev 1332)
+++ guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/GuixLauncher.java 2009-04-17 15:42:06 UTC (rev 1333)
@@ -1,266 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.codelutin.guix;
-
-import org.codelutin.guix.compiler.GuixCompiler;
-import org.codelutin.guix.compiler.*;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.guix.model.ClassDescriptor;
-import org.codelutin.guix.model.GuixModelObject;
-
-/**
- * Launch Guix files compilation
- *
- * @author morin
- */
-public class GuixLauncher {
-
- /** log */
- /* protected static final Log log =
- LogFactory.getLog(GuixLauncher.class);*/
- /** original list of files to compile */
- protected final File[] files;
- /** original list of classes to compile */
- protected final String[] classNames;
- /** Files to be treated while compilation. */
- protected List<File> guixFiles = new ArrayList<File>();
- /** Class names corresponding to the files in the guixFiles list. */
- protected List<String> guixFileClassNames = new ArrayList<String>();
- /** Maps the names of classes being compiled to the compiler instance
- * handling the compilation. */
- protected Map<String, GuixCompiler> compilers =
- new HashMap<String, GuixCompiler>();
- /** ModelObjects which are root of files */
- protected List<GuixModelObject> rootModelObjects = new ArrayList<GuixModelObject>();
- /** CLassDescriptor met during the compilation */
- protected List<ClassDescriptor> classDescriptors =
- new ArrayList<ClassDescriptor>();
- private List<File> compiledFiles = new ArrayList<File>();
- protected int compilerCount;
- private File targetDirectory = new File("destination");
-
- public GuixLauncher() {
- files = new File[]{new File("/home/morin/NetBeansProjects/jaxx-gwt/trunk/jaxx-example/src/main/java/jaxx/demo/JAXXDemo.jaxx")};
- classNames = new String[]{"JAXXDemo"};
- compile();
- }
-
- /**
- * Compiled a set of files.
- *
- * @return <code>true</code> if compilation succeeds,
- * <code>false</code> otherwise
- */
- public synchronized boolean compile() {
- //reset(); // just to be safe...
- compilerCount = 0;
- guixFiles.addAll(Arrays.asList(files));
- guixFileClassNames.addAll(Arrays.asList(classNames));
- try {
- boolean success = true;
-
- // pass 1
- /*if (!nextStep(LifeCycle.compile_first_pass, success)) {
- return false;
- }*/
- boolean compiled;
- do {
- compiled = false;
- assert guixFiles.size() == guixFileClassNames.size();
- // clone it so it can safely be modified while we're iterating
- Iterator<File> filesIterator =
- new ArrayList<File>(guixFiles).iterator();
- Iterator<String> classNamesIterator =
- new ArrayList<String>(guixFileClassNames).iterator();
-
- while (filesIterator.hasNext()) {
-
- File file = filesIterator.next();
- String className = classNamesIterator.next();
- /*if (log.isDebugEnabled()) {
- log.debug("compile first pass for " + className);
- }*/
- if (!compiledFiles.contains(file)) {
- compiled = true;
- compiledFiles.add(file);
- }
- if (compilers.containsKey(className)) {
- //throw new CompilerException("Internal error: " + className + " is already being compiled, attempting to compile it again");
- }
-
- File destDir = targetDirectory;
- if (destDir != null) {
- int dotPos = className.lastIndexOf(".");
- if (dotPos != -1) {
- destDir = new File(destDir, className.substring(0, dotPos).replace('.', File.separatorChar));
- }
- if (!destDir.exists() && !destDir.mkdirs()) {
- //log.warn("couldn't create directory " + destDir);
- System.out.println("couldn't create directory " + destDir);
- continue;
- }
- } else {
- //destDir = file.getParentFile();
- }
- GuixCompiler compiler = new GuixCompiler(
- file.getParentFile(), file, className,this);
- //addProfileTime(compiler, currentPass.name() + "_start");
- compilers.put(className, compiler);
- GuixModelObject rootModelObject = compiler.compile();
- rootModelObjects.add(rootModelObject);
- //addProfileTime(compiler, currentPass.name() + "_end");
- //assert !symbolTables.values().contains(compiler.getSymbolTable()) : "symbolTable is already registered";
- //symbolTables.put(file, compiler.getSymbolTable());
- if (compiler.isFailed()) {
- success = false;
- }
- //}
- }
-
- } while (compiled);
-
- for(GuixModelObject mo : rootModelObjects) {
- //log.trace("class : "
- System.out.println("class : "
- + mo.getClassDescriptor().getPackageName()+ "."
- + mo.getClassDescriptor().getName()
- + " extends "
- + mo.getClassDescriptor().getSuperClass().getPackageName()
- + "." + mo.getClassDescriptor().getSuperClass().getName());
-
- }
-
- /*// pass 2
- if (!nextStep(LifeCycle.compile_second_pass, success)) {
- return false;
- }
-
- assert guixFiles.size() == guixFileClassNames.size();
- List<File> jaxxFilesClone = new ArrayList<File>(guixFiles);
- for (String className : guixFileClassNames) {
- JAXXCompiler compiler = getCompiler(className, "Internal error: could not find compiler for " + className + " during second pass");
- addProfileTime(compiler, currentPass.name() + "_start");
- if (log.isDebugEnabled()) {
- log.debug("runInitializers for " + className);
- }
- if (!compiler.isFailed()) {
- compiler.runInitializers();
- }
- if (log.isDebugEnabled()) {
- log.debug("compile second pass for " + className);
- }
- compiler.compileSecondPass();
- addProfileTime(compiler, currentPass.name() + "_end");
- if (log.isDebugEnabled()) {
- log.debug("done with result [" + !compiler.isFailed() + "] for " + className);
- }
- if (compiler.isFailed()) {
- success = false;
- }
- }
- if (!jaxxFilesClone.equals(guixFiles)) {
- throw new AssertionError("Internal error: compilation set altered during pass 2 (was " + jaxxFilesClone + ", modified to " + guixFiles + ")");
- }
-
- // stylesheet application
- if (!nextStep(LifeCycle.stylesheet_pass, success)) {
- return false;
- }
- assert guixFiles.size() == guixFileClassNames.size();
- for (String className : guixFileClassNames) {
- JAXXCompiler compiler = getCompiler(className, "Internal error: could not find compiler for " + className + " during stylesheet application");
- addProfileTime(compiler, currentPass.name() + "_start");
- compiler.applyStylesheets();
- addProfileTime(compiler, currentPass.name() + "_end");
- if (compiler.isFailed()) {
- success = false;
- }
- }
-
- // code generation
- if (!nextStep(LifeCycle.generate_pass, success)) {
- return false;
- }
- assert guixFiles.size() == guixFileClassNames.size();
- List<Generator> generators = new ArrayList<Generator>();
- for (Generator generator : ServiceLoader.load(Generator.class)) {
- generators.add(generator);
- }
- for (String className : guixFileClassNames) {
- JAXXCompiler compiler = getCompiler(className, "Internal error: could not find compiler for " + className + " during code generation");
- addProfileTime(compiler, currentPass.name() + "_start");
- compiler.generateCode(generators);
- addProfileTime(compiler, currentPass.name() + "_end");
- //compiler.generateCode();
- if (compiler.isFailed()) {
- success = false;
- }
- }
-
- if (options.isProfile()) {
- // profile pass (only if succes compile)
- if (!nextStep(LifeCycle.profile_pass, success)) {
- return false;
- }
- StringBuilder buffer = profiler.computeProfileReport();
- log.info(buffer.toString());
- }
-
- return report(success);
-
- //FIXME : deal better the exception treatment...
- } catch (CompilerException e) {
- System.err.println(e.getMessage());
- e.printStackTrace();
- return false;*/
-
- } catch (Throwable e) {
- e.printStackTrace();
- return false;
- } finally {
- compilerCount = compilers.size();
- //TC - 20081018 only reset when no error was detected
- //if (options.isResetAfterCompile() && errorCount == 0) {
- // reset();
- //}
- return false;
- }
- }
-
- public boolean registerClassDescriptor(ClassDescriptor classDescriptor) {
- int i = 0;
- while ((i < classDescriptors.size())
- && (!classDescriptors.get(i).getName().equals(classDescriptor.getName()))
- && (!classDescriptors.get(i).getPackageName().equals(classDescriptor.getPackageName()))) {
- i++;
- }
- //if the ClassDescriptor does not exist
- if (i >= classDescriptors.size()) {
- classDescriptors.add(classDescriptor);
- return true;
- }
- if (classDescriptor.getScript() != null) {
- if(classDescriptors.get(i).getScript() == null)
- classDescriptors.get(i).setScript(classDescriptor.getScript());
- else if (!classDescriptors.get(i).getScript().equals(classDescriptor.getScript()))
- return false;
- }
- if(classDescriptor.getSuperClass() != null) {
- if (classDescriptors.get(i).getSuperClass() == null)
- classDescriptors.get(i).setSuperClass(classDescriptor.getSuperClass());
- else if (!classDescriptors.get(i).getSuperClass().equals(classDescriptor.getSuperClass()))
- return false;
- }
- return true;
- }
-}
Deleted: guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/compiler/GuixCompiler.java
===================================================================
--- guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/compiler/GuixCompiler.java 2009-04-17 13:57:47 UTC (rev 1332)
+++ guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/compiler/GuixCompiler.java 2009-04-17 15:42:06 UTC (rev 1333)
@@ -1,183 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.codelutin.guix.compiler;
-
-import org.codelutin.guix.GuixLauncher;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Stack;
-import org.codelutin.guix.model.AttributeDescriptor;
-import org.codelutin.guix.model.ClassDescriptor;
-import org.codelutin.guix.model.GuixModelObject;
-import org.codelutin.guix.tags.TagManager;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-import org.xmlpull.v1.XmlPullParserFactory;
-import org.xmlpull.v1.builder.XmlPullElement;
-
-/**
- * Compiles Guix files into Java classes
- *
- * @author morin
- */
-public class GuixCompiler {
-
- /** flag to detec if an error occurs while compiling jaxx file */
- protected boolean failed;
- /** Used for error reporting purposes,
- * so we can report the right line number. */
- protected Stack<XmlPullElement> tagsBeingCompiled =
- new Stack<XmlPullElement>();
- /** Used for error reporting purposes,
- * so we can report the right source file. */
- protected Stack<File> sourceFiles = new Stack<File>();
- /** XML parser of src file. */
- private File baseDir;
- private File src;
- private String outputClassName;
- private GuixLauncher launchor;
-
- /*------------------------------------------------------------------------*/
- /*-- Constructor methods -------------------------------------------------*/
- /*------------------------------------------------------------------------*/
- /**
- * Creates a new GuixCompiler.
- *
- * @param baseDir classpath location
- * @param src location of file to compile
- * @param outputClassName the out file name
- */
- public GuixCompiler(File baseDir, File src, String outputClassName,
- GuixLauncher launchor) {
- this.baseDir = baseDir;
- this.src = src;
- sourceFiles.push(src);
- this.outputClassName = outputClassName;
- this.launchor = launchor;
- }
-
- public GuixModelObject compile()
- throws FileNotFoundException, IOException, XmlPullParserException {
- //try {
- XmlPullParserFactory factory = XmlPullParserFactory.newInstance(
- System.getProperty(XmlPullParserFactory.PROPERTY_NAME), null);
- factory.setNamespaceAware(true);
- XmlPullParser xpp = factory.newPullParser();
- xpp.setInput(new FileReader(src));
-
- if (xpp.getEventType() == XmlPullParser.START_DOCUMENT) {
- StringBuffer doc = new StringBuffer();
- do {
- xpp.nextToken();
- if(xpp.getEventType() == XmlPullParser.COMMENT)
- doc.append(xpp.getText());
- } while(xpp.getEventType() != XmlPullParser.START_TAG);
-
- String nameSpace = xpp.getNamespace();
- String localName = xpp.getName();
- System.out.println("start tag ? " + (xpp.getEventType() == XmlPullParser.START_TAG));
- String packageName =
- getPackageName(nameSpace, localName);
-
- GuixModelObject root = new GuixModelObject(
- xpp.getAttributeValue("", "id"), doc.toString());
- root.setClassDescriptor(new ClassDescriptor(
- src.getName(), src.getPath().replace('/', '.')));
- root.getClassDescriptor().setSuperClass(new ClassDescriptor(
- localName, packageName));
- root.setAttributeDescriptors(getAttributes(xpp));
-
- while(xpp.getEventType() != XmlPullParser.START_TAG)
- xpp.nextToken();
- if(xpp.getName().equals("script")) {
- xpp.nextToken();
- if(xpp.getEventType() == XmlPullParser.CDSECT)
- root.getClassDescriptor().setScript(xpp.getText());
- while((xpp.getEventType() != XmlPullParser.END_TAG)
- || (!xpp.getName().equals("script")))
- xpp.nextToken();
- }
-
- failed = launchor.registerClassDescriptor(root.getClassDescriptor());
-
- xpp.nextToken();
- if (xpp.getEventType() == XmlPullParser.START_TAG) {
- compile(xpp,root,doc.toString());
- }
-
- return root;
- }
- failed = true;
- return null;
- //}
- }
-
- /*------------------------------------------------------------------------*/
- /*-- Compile methods -----------------------------------------------------*/
- /*------------------------------------------------------------------------*/
- public void compile(final XmlPullParser xpp, GuixModelObject previousMO,
- String javaDoc) throws IOException, XmlPullParserException {
-
- String nameSpace = xpp.getNamespace();
- String localName = xpp.getName();
- String packageName = getPackageName(nameSpace, localName);
-
- nameSpace = packageName + ".*";
- GuixModelObject mo = new GuixModelObject(xpp.getAttributeValue("","id"),javaDoc);
- mo.setParent(previousMO);
- mo.setClassDescriptor(new ClassDescriptor(localName, packageName));
- previousMO.getChildren().add(mo);
-
- failed = launchor.registerClassDescriptor(mo.getClassDescriptor());
- if(!failed) {
- GuixModelObject prev = mo;
- StringBuffer doc = new StringBuffer();
- do {
- xpp.next();
- if (xpp.getEventType() == XmlPullParser.END_TAG) {
- prev = prev.getParent();
- }
- else if(xpp.getEventType() == XmlPullParser.COMMENT)
- doc.append(xpp.getText());
- } while (xpp.getEventType() != XmlPullParser.START_TAG
- && xpp.getEventType() != XmlPullParser.END_DOCUMENT);
-
- if (xpp.getEventType() == XmlPullParser.START_TAG) {
- compile(xpp, prev,doc.toString());
- }
- }
- }
-
- private String getPackageName(String nameSpace, String localName) {
- // resolve class tags into fully-qualified class name
- String packageName;
- if (nameSpace != null && nameSpace.endsWith("*")) {
- packageName = nameSpace.substring(0, nameSpace.length() - 2);
- } else {
- String fullClassName = TagManager.resolveClassName(localName);
- packageName = (fullClassName == null) ? null : fullClassName
- .substring(0, fullClassName.lastIndexOf('.'));
- }
- return packageName;
- }
-
- private List<AttributeDescriptor> getAttributes(XmlPullParser xpp) {
- List<AttributeDescriptor> result = new ArrayList<AttributeDescriptor>();
- for(int i = 0 ; i < xpp.getAttributeCount() ; i++) {
- if(!xpp.getAttributeName(i).equals("id"))
- result.add(new AttributeDescriptor(
- xpp.getAttributeName(i),xpp.getAttributeValue(i)));
- }
- return result;
- }
-
- public boolean isFailed() {
- return failed;
- }
-}
Deleted: guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/model/AttributeDescriptor.java
===================================================================
--- guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/model/AttributeDescriptor.java 2009-04-17 13:57:47 UTC (rev 1332)
+++ guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/model/AttributeDescriptor.java 2009-04-17 15:42:06 UTC (rev 1333)
@@ -1,37 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package org.codelutin.guix.model;
-
-/**
- *
- * @author morin
- */
-public class AttributeDescriptor {
- private String name;
- private String value;
-
- public AttributeDescriptor(String name, String value) {
- this.name = name;
- this.value = value;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
-}
Deleted: guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/model/ClassDescriptor.java
===================================================================
--- guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/model/ClassDescriptor.java 2009-04-17 13:57:47 UTC (rev 1332)
+++ guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/model/ClassDescriptor.java 2009-04-17 15:42:06 UTC (rev 1333)
@@ -1,55 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package org.codelutin.guix.model;
-
-/**
- *
- * @author morin
- */
-public class ClassDescriptor {
-
- private String name;
- private String packageName;
- private String script;
- private ClassDescriptor superClass;
-
- public ClassDescriptor(String name, String packageName){
- this.name = name;
- this.packageName = packageName;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getPackageName() {
- return packageName;
- }
-
- public void setPackageName(String packageName) {
- this.packageName = packageName;
- }
-
- public String getScript() {
- return script;
- }
-
- public void setScript(String script) {
- this.script = script;
- }
-
- public ClassDescriptor getSuperClass() {
- return superClass;
- }
-
- public void setSuperClass(ClassDescriptor superClass) {
- this.superClass = superClass;
- }
-}
Deleted: guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/tags/TagManager.java
===================================================================
--- guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/tags/TagManager.java 2009-04-17 13:57:47 UTC (rev 1332)
+++ guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/tags/TagManager.java 2009-04-17 15:42:06 UTC (rev 1333)
@@ -1,402 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package org.codelutin.guix.tags;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/** Manages TagHandlers, including automatically compiling .jaxx files corresponding to class tags. */
-public class TagManager {
- /** log */
- protected static final Log log = LogFactory.getLog(TagManager.class);
-
- /**
- * Namespace for JAXX's non-class tags, such as <script;>. The namespace normally does not
- * need to be specified but can be used to resolve ambiguities.
- */
- public static final String JAXX_NAMESPACE = "http://www.jaxxframework.org/";
-
- /** Maps simple tag names to their default namespaces (package names). */
- private static Map<String, String> defaultNamespaces = new HashMap<String, String>();
-
- /** Maps qualified tag names to the TagHandlers responsible for processing them. */
- //private static Map<QName, TagHandler> registeredTags = new HashMap<QName, TagHandler>();
-
- /** Keeps track of whether or not named classes exist. */
- private static Map<String, Boolean> classExistenceCache = new HashMap<String, Boolean>();
-
- /**
- * Maps bean classes to their TagHandler classes. The mapping is to TagHandler classes, rather than to
- * TagHandler instances, because subclasses of the bean class should be handled by the same TagHandler
- * (assuming no more specific mappings exist), which requires creating a new instance of the TagHandler.
- */
- //private static ClassMap<Class<? extends TagHandler>> registeredBeans = new ClassMap<Class<? extends TagHandler>>();
-
- // still targeting 1.4, so I can't use javax.xml.namespace.QName
- private static class QName {
- private String namespaceURI;
- private String localPart;
-
- public QName(String namespaceURI, String localPart) {
- if (localPart == null)
- throw new NullPointerException();
- this.namespaceURI = namespaceURI;
- this.localPart = localPart;
- }
-
-
- public String getNamespaceURI() {
- return namespaceURI;
- }
-
-
- public String getLocalPart() {
- return localPart;
- }
-
- @Override
- public boolean equals(Object o) {
- if (o == null || !(o instanceof QName))
- return false;
- QName qname = (QName) o;
- return qname.getNamespaceURI().equals(getNamespaceURI()) && qname.getLocalPart().equals(getLocalPart());
- }
-
- @Override
- public int hashCode() {
- return (namespaceURI != null ? namespaceURI.hashCode() : 0) ^ getLocalPart().hashCode();
- }
- }
-
-
- private TagManager() { /* not instantiable */ }
-
-
- /*public static void reset(boolean verbose) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
- registeredBeans.clear();
- registeredTags.clear();
- defaultNamespaces.clear();
- CompiledObjectDecorator.reset();
- JAXXCompilerLaunchor.loadLibraries(verbose);
- }*/
-
-
- /**
- * Maps a class tag to a specific <code>TagHandler</code>. When a tag representing the bean class is
- * encountered (either the class' simple name, if it is unambiguous, or its fully-qualified name), the specified
- * <code>TagHandler</code> will be invoked to compile it.
- *
- * @param beanClass the class to associate with a <code>TagHandler</code>
- * @param handler the <code>TagHandler</code> class, which must descend from <code>DefaultObjectHandler</code>
- * @throws IllegalArgumentException if the handler class does not descend from <code>DefaultObjectHandler</code>
- */
- /*public static <T extends TagHandler> void registerBean(ClassDescriptor beanClass, Class<T> handler) {
- if (!DefaultObjectHandler.class.isAssignableFrom(handler)) {
- throw new IllegalArgumentException("handler class must be a subclass of DefaultObjectHandler");
- }
- registeredBeans.put(beanClass, handler);
- if (log.isDebugEnabled()) {
- log.debug(beanClass + " : " + handler);
- }
- String name = beanClass.getName();
- int dotPos = name.lastIndexOf(".");
- String namespace = name.substring(0, dotPos + 1) + "*";
- name = name.substring(dotPos + 1);
- registerDefaultNamespace(name, namespace);
- }*/
-
-
- /**
- * Sets the default namespace for a tag. When the tag is encountered with no namespace specified,
- * the specified namespace will be assumed. Mapping the same tag to two or more default namespaces
- * removes the mapping and marks the entry as being ambiguous (by putting a <code>null</code>
- * value into the map); this causes an error to be thrown if the tag is used without a namespace being
- * specified.
- * <p/>
- * Java package names on tags are automatically converted into namespaces (e.g. <javax.swing.JButton/>
- * and <JButton xmlns="javax.swing.*"/> are equivalent), so tags with package names are considered
- * to have namespaces specified.
- *
- * @param tag tag name
- * @param namespace namespace
- */
- public static void registerDefaultNamespace(String tag, String namespace) {
- if (defaultNamespaces.containsKey(tag)
- && defaultNamespaces.get(tag) != null
- && !defaultNamespaces.get(tag).equals(namespace)) {
- defaultNamespaces.put(tag, null); // tag name is now ambiguous
- } else {
- defaultNamespaces.put(tag, namespace);
- }
- }
-
-
- /**
- * Registers a <code>TagHandler</code> for a tag. When a tag with the given name and namespace
- * is encountered, the <code>TagHandler's compileFirstPass</code> and <code>compileSecondPass</code>
- * methods will be invoked to handle it.
- * <p/>
- * It is not an error to register an already-registered tag and namespace combination. The new mapping
- * will replace the old mapping.
- *
- * @param namespace the tag's namespace
- * @param tag the simple name of the tag
- * @param handler the <code>TagHandler</code> which should process the tag
- */
- /*public static <T extends TagHandler> void registerTag(String namespace, String tag, T handler) {
- if (namespace == null) {
- namespace = "*";
- }
- //System.out.println("registerTag "+namespace+" : "+tag+" : "+handler);
- if (log.isDebugEnabled()) {
- log.debug(tag + " : " + handler);
- }
- registeredTags.put(new QName(namespace, tag), handler);
- registerDefaultNamespace(tag, namespace);
- }*/
-
-
- /**
- * Returns the <code>TagHandler</code> that should be used to process the specified tag.
- * If the tag represents the class name of an uncompiled <code>.jaxx</code> file, the
- * <code>.jaxx</code> is first compiled.
- *
- * @param namespace the tag's namespace (may be <code>null</code>)
- * @param tag the tag's simple name
- * @param compiler the current <code>JAXXCompiler</code>
- * @return the <code>TagHandler</code> for the tag
- * @throws jaxx.CompilerException ?
- */
- /*public static TagHandler getTagHandler(String namespace, String tag, JAXXCompiler compiler) throws CompilerException {
- return getTagHandler(namespace, tag, false, compiler);
- }*/
-
-
- /*private static String getNamespace(ClassDescriptor beanClass) {
- String packageName = beanClass.getPackageName();
- return packageName != null ? packageName + ".*" : "*";
-
- }*/
-
-
- /*private static String getSimpleName(ClassDescriptor beanClass) {
- String packageName = beanClass.getPackageName();
- if (packageName != null) {
- assert beanClass.getName().startsWith(packageName);
- return beanClass.getName().substring(packageName.length() + 1);
- }
- return beanClass.getName();
- }*/
-
-
- /**
- * @param beanClass the tag class
- * @return the <code>TagHandler</code> that should be used to process the specified class.
- * Only <code>TagHandlers</code> previously registered with <code>registerBean</code>
- * are considered.
- * @throws jaxx.CompilerException ?
- */
- /*public static DefaultObjectHandler getTagHandler(ClassDescriptor beanClass) throws CompilerException {
- try {
- if (beanClass == null) {
- throw new NullPointerException();
- }
- String namespace = getNamespace(beanClass);
- String tag = getSimpleName(beanClass);
- DefaultObjectHandler handler = (DefaultObjectHandler) registeredTags.get(new QName(namespace, tag));
- if (handler == null) {
- Class<? extends TagHandler> handlerClass = registeredBeans.get(beanClass);
- if (handlerClass == null) {
- throw new CompilerException("unable to find handler for " + beanClass);
- }
- Constructor<? extends TagHandler> constructor = handlerClass.getConstructor(ClassDescriptor.class);
- handler = (DefaultObjectHandler) constructor.newInstance(beanClass);
- registerTag(namespace, tag, handler);
- }
- return handler;
- }
- catch (InstantiationException e) {
- throw new RuntimeException(e);
- }
- catch (NoSuchMethodException e) {
- throw new RuntimeException(e);
- }
- catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- }
- catch (InvocationTargetException e) {
- throw new RuntimeException(e);
- }
- }*/
-
-
- private static boolean classExists(String className) {
- if (classExistenceCache.containsKey(className)) {
- return classExistenceCache.get(className);
- }
-
- boolean found = false;
-
- try {
- Class.forName(className);
- found = true;
- }catch (ClassNotFoundException e) {
- // ignore ?
- }
- catch (NoClassDefFoundError e) { // we get this instead of ClassNotFoundException on case-insensitive file systems when
- // looking up a class with the wrong case
- }
-
- classExistenceCache.put(className, found);
-
- return found;
- }
-
-
- /*private static String determinePackage(String simpleClassName, String defaultPackage) {
- String namespace = null;
- Set<String> classes = compiler.getImportedClasses();
- for (String className : classes) { // search class imports (e.g. import java.util.Date;)
- if (className.equals(simpleClassName) || className.endsWith("." + simpleClassName)) {
- namespace = className.substring(0, className.lastIndexOf(".") + 1) + "*";
- }
- }
- if (namespace == null) { // search package imports (e.g. import java.util.*;)
- Set<String> searchList = compiler.getImportedPackages();
- if (defaultPackage != null) {
- if (!defaultPackage.endsWith("*")) {
- throw new IllegalArgumentException("defaultPackage must end in '*', found '" + defaultPackage + "'");
- }
- if (classExists(defaultPackage.substring(0, defaultPackage.length() - 1) + simpleClassName)) {
- return defaultPackage;
- }
- }
- for (String currentPackage : searchList) {
- String className = currentPackage + simpleClassName;
- if (classExists(className)) {
- if (namespace != null) { // we've already found the same name in another package
- //compiler.reportError("symbol '" + simpleClassName + "' is ambiguous, found matching classes " + namespace.substring(0, namespace.length() - 1) + simpleClassName + " and " + currentPackage + simpleClassName + ". Use fully-qualified name to disambiguate.");
- return null;
- }
- namespace = currentPackage + "*";
- }
- }
- }
-
- return namespace;
- }*/
-
- /**
- * Resolves a simple class name (like <code>Object</code> or <code>String</code>) to its fully-qualified name. Inner
- * classes should be represented as they would appear in Java source code (e.g. JPopupMenu.Separator). Fully-qualified names,
- * such as <code>java.lang.Object</code> are legal and will be returned unmodified (and in fact it is generally impossible to
- * even know whether a given reference is fully qualified until it has been resolved). Returns <code>null</code> if no matching
- * class could be found.
- *
- * @param name name to resolve
- * @param compiler compile to use
- * @return the resolved fqn class name
- */
- public static String resolveClassName(String name) {
- if (name.endsWith("[]"))
- return resolveClassName(name.substring(0, name.length() - 2)) + "[]";
- if (name.indexOf("<") != -1)
- name = name.substring(0, name.indexOf("<")); // strip off generic types
-
- name = name.intern();
- if (name.equals("boolean") || name.equals("byte") || name.equals("short") || name.equals("int") ||
- name.equals("long") || name.equals("float") || name.equals("double") || name.equals("char"))
- return name;
-
- String result = null;
- String originalName = name;
- String defaultNamespace = null;
- if (defaultNamespaces.containsKey(name)) {
- defaultNamespace = defaultNamespaces.get(name);
- if (defaultNamespace == null) { // defaultNamespaces map contains a null value, which is put there to indicate ambiguity
- //compiler.reportError("class '" + name + "' is ambiguous; specify fully-qualified name (package and class) to disambiguate");
- return null;
- }
- }
- if (defaultNamespace != null && defaultNamespace.endsWith("*")) {
- result = defaultNamespace.substring(0, defaultNamespace.length() - 1) + name;
- }
-
- /*if (result == null) {
- // Inner class names (like JPopupMenu.Separator) present a special challenge. The name before the dot might be
- // a package name, or it might be a class name. If it's a class name, it might be fully qualified, or it might
- // not. And it's also not actually the correct name of the class, as far as the JVM is concerned -- the correct
- // name uses a dollar sign instead of a dot (javax.swing.JPopupMenu$Separator). And there could be more than
- // one inner class -- it's possible to have com.mycompany.Outer$Inner$Innerer$Innerest.
- //
- // The basic strategy is to start by treating the part before the last dot as a package name, as that is by far
- // the most likely case. If we don't find the class there, change the last dot to a dollar sign and try again.
- // Suppose we have the tag <com.mycompany.Outer.Inner.Innerer.Innerest/>, matching the class above. Resolution
- // proceeds like this:
- // com.mycompany.Outer.Inner.Innerer.* : Innerest
- // com.mycompany.Outer.Inner.* : Innerer$Innerest
- // com.mycompany.Outer.* : Inner$Innerer$Innerest
- // com.mycompany.* : Outer$Inner$Innerer$Innerest
- // And at this point we have a match with the class Outer$Inner$Innerer$Innerest in package com.mycompany.
- int dotPos = originalName.lastIndexOf('.');
- for (; ;) {
- String namespace = dotPos != -1 ? originalName.substring(0, dotPos) + ".*" : "*";
- name = originalName.substring(dotPos + 1).replace('.', '$');
- String packageName = determinePackage(name, namespace);
- if (packageName != null) {
- assert packageName.endsWith("*");
- if (packageName.equals(namespace) || namespace.equals("*")) {
- // check for an alias (like javax.swing.JComboBox actually being jaxx.runtime.swing.JAXXComboBox)
- TagHandler handler = registeredTags.get(new QName(namespace, name));
- if (handler != null) { // determine alias by looking at handler
- ClassDescriptor alias = ((DefaultObjectHandler) handler).getBeanClass();
- // make sure the same handler is used for both the aliased and non-aliased names, in order to avoid "no CompiledObject has been registered" error
- // the line below doesn't bother to handle the case where the aliased class name doesn't have a package, since it's a pretty safe assumption that
- // that will never happen
- assert alias.getPackageName() != null && alias.getPackageName().length() > 0 : "aliasing with no package name has not been implemented";
- registeredTags.put(new QName(alias.getPackageName() + ".*", alias.getName().substring(alias.getPackageName().length() + 1)), handler);
- result = alias.getName();
- break;
- } else { // no alias
- result = packageName.substring(0, packageName.length() - 1) + name;
- break;
- }
- }
- // else we found a class by the same name, but in the wrong package
- }
-
- if (dotPos <= 0)
- break;
- dotPos = originalName.lastIndexOf('.', dotPos - 1);
- }
- }*/
-
- if (result != null && !result.equals(originalName))
- result = resolveClassName(result); // check for aliases against the new name as well
-
- return result;
- }
-
-
- /*public static ClassDescriptor resolveClass(String className, JAXXCompiler compiler) {
- try {
- className = resolveClassName(className, compiler);
- if (className == null)
- return null;
- return ClassDescriptorLoader.getClassDescriptor(className, compiler.getClassLoader());
- }
- catch (ClassNotFoundException e) {
- return null;
- }
- }*/
-}
\ No newline at end of file
Copied: guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/GuixLauncher.java (from rev 1332, guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/GuixLauncher.java)
===================================================================
--- guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/GuixLauncher.java (rev 0)
+++ guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/GuixLauncher.java 2009-04-17 15:42:06 UTC (rev 1333)
@@ -0,0 +1,266 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.nuiton.guix;
+
+import org.nuiton.guix.compiler.GuixCompiler;
+import org.codelutin.guix.compiler.*;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.guix.model.ClassDescriptor;
+import org.codelutin.guix.model.GuixModelObject;
+
+/**
+ * Launch Guix files compilation
+ *
+ * @author morin
+ */
+public class GuixLauncher {
+
+ /** log */
+ /* protected static final Log log =
+ LogFactory.getLog(GuixLauncher.class);*/
+ /** original list of files to compile */
+ protected final File[] files;
+ /** original list of classes to compile */
+ protected final String[] classNames;
+ /** Files to be treated while compilation. */
+ protected List<File> guixFiles = new ArrayList<File>();
+ /** Class names corresponding to the files in the guixFiles list. */
+ protected List<String> guixFileClassNames = new ArrayList<String>();
+ /** Maps the names of classes being compiled to the compiler instance
+ * handling the compilation. */
+ protected Map<String, GuixCompiler> compilers =
+ new HashMap<String, GuixCompiler>();
+ /** ModelObjects which are root of files */
+ protected List<GuixModelObject> rootModelObjects = new ArrayList<GuixModelObject>();
+ /** CLassDescriptor met during the compilation */
+ protected List<ClassDescriptor> classDescriptors =
+ new ArrayList<ClassDescriptor>();
+ private List<File> compiledFiles = new ArrayList<File>();
+ protected int compilerCount;
+ private File targetDirectory = new File("destination");
+
+ public GuixLauncher() {
+ files = new File[]{new File("/home/morin/NetBeansProjects/jaxx-gwt/trunk/jaxx-example/src/main/java/jaxx/demo/JAXXDemo.jaxx")};
+ classNames = new String[]{"JAXXDemo"};
+ compile();
+ }
+
+ /**
+ * Compiled a set of files.
+ *
+ * @return <code>true</code> if compilation succeeds,
+ * <code>false</code> otherwise
+ */
+ public synchronized boolean compile() {
+ //reset(); // just to be safe...
+ compilerCount = 0;
+ guixFiles.addAll(Arrays.asList(files));
+ guixFileClassNames.addAll(Arrays.asList(classNames));
+ try {
+ boolean success = true;
+
+ // pass 1
+ /*if (!nextStep(LifeCycle.compile_first_pass, success)) {
+ return false;
+ }*/
+ boolean compiled;
+ do {
+ compiled = false;
+ assert guixFiles.size() == guixFileClassNames.size();
+ // clone it so it can safely be modified while we're iterating
+ Iterator<File> filesIterator =
+ new ArrayList<File>(guixFiles).iterator();
+ Iterator<String> classNamesIterator =
+ new ArrayList<String>(guixFileClassNames).iterator();
+
+ while (filesIterator.hasNext()) {
+
+ File file = filesIterator.next();
+ String className = classNamesIterator.next();
+ /*if (log.isDebugEnabled()) {
+ log.debug("compile first pass for " + className);
+ }*/
+ if (!compiledFiles.contains(file)) {
+ compiled = true;
+ compiledFiles.add(file);
+ }
+ if (compilers.containsKey(className)) {
+ //throw new CompilerException("Internal error: " + className + " is already being compiled, attempting to compile it again");
+ }
+
+ File destDir = targetDirectory;
+ if (destDir != null) {
+ int dotPos = className.lastIndexOf(".");
+ if (dotPos != -1) {
+ destDir = new File(destDir, className.substring(0, dotPos).replace('.', File.separatorChar));
+ }
+ if (!destDir.exists() && !destDir.mkdirs()) {
+ //log.warn("couldn't create directory " + destDir);
+ System.out.println("couldn't create directory " + destDir);
+ continue;
+ }
+ } else {
+ //destDir = file.getParentFile();
+ }
+ GuixCompiler compiler = new GuixCompiler(
+ file.getParentFile(), file, className,this);
+ //addProfileTime(compiler, currentPass.name() + "_start");
+ compilers.put(className, compiler);
+ GuixModelObject rootModelObject = compiler.compile();
+ rootModelObjects.add(rootModelObject);
+ //addProfileTime(compiler, currentPass.name() + "_end");
+ //assert !symbolTables.values().contains(compiler.getSymbolTable()) : "symbolTable is already registered";
+ //symbolTables.put(file, compiler.getSymbolTable());
+ if (compiler.isFailed()) {
+ success = false;
+ }
+ //}
+ }
+
+ } while (compiled);
+
+ for(GuixModelObject mo : rootModelObjects) {
+ //log.trace("class : "
+ System.out.println("class : "
+ + mo.getClassDescriptor().getPackageName()+ "."
+ + mo.getClassDescriptor().getName()
+ + " extends "
+ + mo.getClassDescriptor().getSuperClass().getPackageName()
+ + "." + mo.getClassDescriptor().getSuperClass().getName());
+
+ }
+
+ /*// pass 2
+ if (!nextStep(LifeCycle.compile_second_pass, success)) {
+ return false;
+ }
+
+ assert guixFiles.size() == guixFileClassNames.size();
+ List<File> jaxxFilesClone = new ArrayList<File>(guixFiles);
+ for (String className : guixFileClassNames) {
+ JAXXCompiler compiler = getCompiler(className, "Internal error: could not find compiler for " + className + " during second pass");
+ addProfileTime(compiler, currentPass.name() + "_start");
+ if (log.isDebugEnabled()) {
+ log.debug("runInitializers for " + className);
+ }
+ if (!compiler.isFailed()) {
+ compiler.runInitializers();
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("compile second pass for " + className);
+ }
+ compiler.compileSecondPass();
+ addProfileTime(compiler, currentPass.name() + "_end");
+ if (log.isDebugEnabled()) {
+ log.debug("done with result [" + !compiler.isFailed() + "] for " + className);
+ }
+ if (compiler.isFailed()) {
+ success = false;
+ }
+ }
+ if (!jaxxFilesClone.equals(guixFiles)) {
+ throw new AssertionError("Internal error: compilation set altered during pass 2 (was " + jaxxFilesClone + ", modified to " + guixFiles + ")");
+ }
+
+ // stylesheet application
+ if (!nextStep(LifeCycle.stylesheet_pass, success)) {
+ return false;
+ }
+ assert guixFiles.size() == guixFileClassNames.size();
+ for (String className : guixFileClassNames) {
+ JAXXCompiler compiler = getCompiler(className, "Internal error: could not find compiler for " + className + " during stylesheet application");
+ addProfileTime(compiler, currentPass.name() + "_start");
+ compiler.applyStylesheets();
+ addProfileTime(compiler, currentPass.name() + "_end");
+ if (compiler.isFailed()) {
+ success = false;
+ }
+ }
+
+ // code generation
+ if (!nextStep(LifeCycle.generate_pass, success)) {
+ return false;
+ }
+ assert guixFiles.size() == guixFileClassNames.size();
+ List<Generator> generators = new ArrayList<Generator>();
+ for (Generator generator : ServiceLoader.load(Generator.class)) {
+ generators.add(generator);
+ }
+ for (String className : guixFileClassNames) {
+ JAXXCompiler compiler = getCompiler(className, "Internal error: could not find compiler for " + className + " during code generation");
+ addProfileTime(compiler, currentPass.name() + "_start");
+ compiler.generateCode(generators);
+ addProfileTime(compiler, currentPass.name() + "_end");
+ //compiler.generateCode();
+ if (compiler.isFailed()) {
+ success = false;
+ }
+ }
+
+ if (options.isProfile()) {
+ // profile pass (only if succes compile)
+ if (!nextStep(LifeCycle.profile_pass, success)) {
+ return false;
+ }
+ StringBuilder buffer = profiler.computeProfileReport();
+ log.info(buffer.toString());
+ }
+
+ return report(success);
+
+ //FIXME : deal better the exception treatment...
+ } catch (CompilerException e) {
+ System.err.println(e.getMessage());
+ e.printStackTrace();
+ return false;*/
+
+ } catch (Throwable e) {
+ e.printStackTrace();
+ return false;
+ } finally {
+ compilerCount = compilers.size();
+ //TC - 20081018 only reset when no error was detected
+ //if (options.isResetAfterCompile() && errorCount == 0) {
+ // reset();
+ //}
+ return false;
+ }
+ }
+
+ public boolean registerClassDescriptor(ClassDescriptor classDescriptor) {
+ int i = 0;
+ while ((i < classDescriptors.size())
+ && (!classDescriptors.get(i).getName().equals(classDescriptor.getName()))
+ && (!classDescriptors.get(i).getPackageName().equals(classDescriptor.getPackageName()))) {
+ i++;
+ }
+ //if the ClassDescriptor does not exist
+ if (i >= classDescriptors.size()) {
+ classDescriptors.add(classDescriptor);
+ return true;
+ }
+ if (classDescriptor.getScript() != null) {
+ if(classDescriptors.get(i).getScript() == null)
+ classDescriptors.get(i).setScript(classDescriptor.getScript());
+ else if (!classDescriptors.get(i).getScript().equals(classDescriptor.getScript()))
+ return false;
+ }
+ if(classDescriptor.getSuperClass() != null) {
+ if (classDescriptors.get(i).getSuperClass() == null)
+ classDescriptors.get(i).setSuperClass(classDescriptor.getSuperClass());
+ else if (!classDescriptors.get(i).getSuperClass().equals(classDescriptor.getSuperClass()))
+ return false;
+ }
+ return true;
+ }
+}
Copied: guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/compiler/GuixCompiler.java (from rev 1332, guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/compiler/GuixCompiler.java)
===================================================================
--- guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/compiler/GuixCompiler.java (rev 0)
+++ guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/compiler/GuixCompiler.java 2009-04-17 15:42:06 UTC (rev 1333)
@@ -0,0 +1,185 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.nuiton.guix.compiler;
+
+import org.nuiton.guix.GuixLauncher;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Stack;
+import org.nuiton.guix.model.AttributeDescriptor;
+import org.nuiton.guix.model.ClassDescriptor;
+import org.nuiton.guix.model.GuixModelObject;
+import org.nuiton.guix.tags.TagManager;
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlPullParserFactory;
+import org.xmlpull.v1.builder.XmlPullElement;
+
+/**
+ * Compiles Guix files into Java classes
+ *
+ * @author morin
+ */
+public class GuixCompiler {
+
+ /** flag to detec if an error occurs while compiling jaxx file */
+ protected boolean failed;
+ /** Used for error reporting purposes,
+ * so we can report the right line number. */
+ protected Stack<XmlPullElement> tagsBeingCompiled =
+ new Stack<XmlPullElement>();
+ /** Used for error reporting purposes,
+ * so we can report the right source file. */
+ protected Stack<File> sourceFiles = new Stack<File>();
+ /** XML parser of src file. */
+ private File baseDir;
+ private File src;
+ private String outputClassName;
+ private GuixLauncher launchor;
+
+ /*------------------------------------------------------------------------*/
+ /*-- Constructor methods -------------------------------------------------*/
+ /*------------------------------------------------------------------------*/
+ /**
+ * Creates a new GuixCompiler.
+ *
+ * @param baseDir classpath location
+ * @param src location of file to compile
+ * @param outputClassName the out file name
+ */
+ public GuixCompiler(File baseDir, File src, String outputClassName,
+ GuixLauncher launchor) {
+ this.baseDir = baseDir;
+ this.src = src;
+ sourceFiles.push(src);
+ this.outputClassName = outputClassName;
+ this.launchor = launchor;
+ }
+
+ public GuixModelObject compile()
+ throws FileNotFoundException, IOException, XmlPullParserException {
+ //try {
+ XmlPullParserFactory factory = XmlPullParserFactory.newInstance(
+ System.getProperty(XmlPullParserFactory.PROPERTY_NAME), null);
+ factory.setNamespaceAware(true);
+ XmlPullParser xpp = factory.newPullParser();
+ xpp.setInput(new FileReader(src));
+
+ if (xpp.getEventType() == XmlPullParser.START_DOCUMENT) {
+ StringBuffer doc = new StringBuffer();
+ do {
+ xpp.nextToken();
+ if(xpp.getEventType() == XmlPullParser.COMMENT)
+ doc.append(xpp.getText());
+ } while(xpp.getEventType() != XmlPullParser.START_TAG);
+
+ String nameSpace = xpp.getNamespace();
+ String localName = xpp.getName();
+ String packageName =
+ getPackageName(nameSpace, localName);
+
+ GuixModelObject root = new GuixModelObject(
+ xpp.getAttributeValue("", "id"), doc.toString());
+ String className = src.getName().substring(0, src.getName().lastIndexOf('.'));
+ String classPackageName = src.getPath().replace('/', '.')
+ .substring(src.getPath().lastIndexOf("src/main/java/") + 14,
+ src.getPath().lastIndexOf('/'));
+ root.setClassDescriptor(new ClassDescriptor(className,classPackageName));
+ root.getClassDescriptor().setSuperClass(new ClassDescriptor(
+ localName, packageName));
+ root.setAttributeDescriptors(getAttributes(xpp));
+
+ while(xpp.getEventType() != XmlPullParser.START_TAG)
+ xpp.nextToken();
+ if(xpp.getName().equals("script")) {
+ xpp.nextToken();
+ if(xpp.getEventType() == XmlPullParser.CDSECT)
+ root.getClassDescriptor().setScript(xpp.getText());
+ while((xpp.getEventType() != XmlPullParser.END_TAG)
+ || (!xpp.getName().equals("script")))
+ xpp.nextToken();
+ }
+
+ failed = launchor.registerClassDescriptor(root.getClassDescriptor());
+
+ xpp.nextToken();
+ if (xpp.getEventType() == XmlPullParser.START_TAG) {
+ compile(xpp,root,doc.toString());
+ }
+
+ return root;
+ }
+ failed = true;
+ return null;
+ //}
+ }
+
+ /*------------------------------------------------------------------------*/
+ /*-- Compile methods -----------------------------------------------------*/
+ /*------------------------------------------------------------------------*/
+ public void compile(final XmlPullParser xpp, GuixModelObject previousMO,
+ String javaDoc) throws IOException, XmlPullParserException {
+
+ String nameSpace = xpp.getNamespace();
+ String localName = xpp.getName();
+ String packageName = getPackageName(nameSpace, localName);
+
+ nameSpace = packageName + ".*";
+ GuixModelObject mo = new GuixModelObject(xpp.getAttributeValue("","id"),javaDoc);
+ mo.setParent(previousMO);
+ mo.setClassDescriptor(new ClassDescriptor(localName, packageName));
+ previousMO.getChildren().add(mo);
+
+ failed = launchor.registerClassDescriptor(mo.getClassDescriptor());
+ if(!failed) {
+ GuixModelObject prev = mo;
+ StringBuffer doc = new StringBuffer();
+ do {
+ xpp.next();
+ if (xpp.getEventType() == XmlPullParser.END_TAG) {
+ prev = prev.getParent();
+ }
+ else if(xpp.getEventType() == XmlPullParser.COMMENT)
+ doc.append(xpp.getText());
+ } while (xpp.getEventType() != XmlPullParser.START_TAG
+ && xpp.getEventType() != XmlPullParser.END_DOCUMENT);
+
+ if (xpp.getEventType() == XmlPullParser.START_TAG) {
+ compile(xpp, prev,doc.toString());
+ }
+ }
+ }
+
+ private String getPackageName(String nameSpace, String localName) {
+ // resolve class tags into fully-qualified class name
+ String packageName;
+ if (nameSpace != null && nameSpace.endsWith("*")) {
+ packageName = nameSpace.substring(0, nameSpace.length() - 2);
+ } else {
+ String fullClassName = TagManager.resolveClassName(localName);
+ packageName = (fullClassName == null) ? null : fullClassName
+ .substring(0, fullClassName.lastIndexOf('.'));
+ }
+ return packageName;
+ }
+
+ private List<AttributeDescriptor> getAttributes(XmlPullParser xpp) {
+ List<AttributeDescriptor> result = new ArrayList<AttributeDescriptor>();
+ for(int i = 0 ; i < xpp.getAttributeCount() ; i++) {
+ if(!xpp.getAttributeName(i).equals("id"))
+ result.add(new AttributeDescriptor(
+ xpp.getAttributeName(i),xpp.getAttributeValue(i)));
+ }
+ return result;
+ }
+
+ public boolean isFailed() {
+ return failed;
+ }
+}
Copied: guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/model/AttributeDescriptor.java (from rev 1332, guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/model/AttributeDescriptor.java)
===================================================================
--- guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/model/AttributeDescriptor.java (rev 0)
+++ guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/model/AttributeDescriptor.java 2009-04-17 15:42:06 UTC (rev 1333)
@@ -0,0 +1,37 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package org.nuiton.guix.model;
+
+/**
+ *
+ * @author morin
+ */
+public class AttributeDescriptor {
+ private String name;
+ private String value;
+
+ public AttributeDescriptor(String name, String value) {
+ this.name = name;
+ this.value = value;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+}
Copied: guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/model/ClassDescriptor.java (from rev 1332, guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/model/ClassDescriptor.java)
===================================================================
--- guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/model/ClassDescriptor.java (rev 0)
+++ guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/model/ClassDescriptor.java 2009-04-17 15:42:06 UTC (rev 1333)
@@ -0,0 +1,55 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package org.nuiton.guix.model;
+
+/**
+ *
+ * @author morin
+ */
+public class ClassDescriptor {
+
+ private String name;
+ private String packageName;
+ private String script;
+ private ClassDescriptor superClass;
+
+ public ClassDescriptor(String name, String packageName){
+ this.name = name;
+ this.packageName = packageName;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPackageName() {
+ return packageName;
+ }
+
+ public void setPackageName(String packageName) {
+ this.packageName = packageName;
+ }
+
+ public String getScript() {
+ return script;
+ }
+
+ public void setScript(String script) {
+ this.script = script;
+ }
+
+ public ClassDescriptor getSuperClass() {
+ return superClass;
+ }
+
+ public void setSuperClass(ClassDescriptor superClass) {
+ this.superClass = superClass;
+ }
+}
Copied: guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/tags/TagManager.java (from rev 1332, guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/tags/TagManager.java)
===================================================================
--- guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/tags/TagManager.java (rev 0)
+++ guix/trunk/guix-compiler/src/main/java/org/nuiton/guix/tags/TagManager.java 2009-04-17 15:42:06 UTC (rev 1333)
@@ -0,0 +1,402 @@
+/*
+ * Copyright 2006 Ethan Nicholas. All rights reserved.
+ * Use is subject to license terms.
+ */
+package org.nuiton.guix.tags;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.IOException;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+/** Manages TagHandlers, including automatically compiling .jaxx files corresponding to class tags. */
+public class TagManager {
+ /** log */
+ protected static final Log log = LogFactory.getLog(TagManager.class);
+
+ /**
+ * Namespace for JAXX's non-class tags, such as <script;>. The namespace normally does not
+ * need to be specified but can be used to resolve ambiguities.
+ */
+ public static final String JAXX_NAMESPACE = "http://www.jaxxframework.org/";
+
+ /** Maps simple tag names to their default namespaces (package names). */
+ private static Map<String, String> defaultNamespaces = new HashMap<String, String>();
+
+ /** Maps qualified tag names to the TagHandlers responsible for processing them. */
+ //private static Map<QName, TagHandler> registeredTags = new HashMap<QName, TagHandler>();
+
+ /** Keeps track of whether or not named classes exist. */
+ private static Map<String, Boolean> classExistenceCache = new HashMap<String, Boolean>();
+
+ /**
+ * Maps bean classes to their TagHandler classes. The mapping is to TagHandler classes, rather than to
+ * TagHandler instances, because subclasses of the bean class should be handled by the same TagHandler
+ * (assuming no more specific mappings exist), which requires creating a new instance of the TagHandler.
+ */
+ //private static ClassMap<Class<? extends TagHandler>> registeredBeans = new ClassMap<Class<? extends TagHandler>>();
+
+ // still targeting 1.4, so I can't use javax.xml.namespace.QName
+ private static class QName {
+ private String namespaceURI;
+ private String localPart;
+
+ public QName(String namespaceURI, String localPart) {
+ if (localPart == null)
+ throw new NullPointerException();
+ this.namespaceURI = namespaceURI;
+ this.localPart = localPart;
+ }
+
+
+ public String getNamespaceURI() {
+ return namespaceURI;
+ }
+
+
+ public String getLocalPart() {
+ return localPart;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == null || !(o instanceof QName))
+ return false;
+ QName qname = (QName) o;
+ return qname.getNamespaceURI().equals(getNamespaceURI()) && qname.getLocalPart().equals(getLocalPart());
+ }
+
+ @Override
+ public int hashCode() {
+ return (namespaceURI != null ? namespaceURI.hashCode() : 0) ^ getLocalPart().hashCode();
+ }
+ }
+
+
+ private TagManager() { /* not instantiable */ }
+
+
+ /*public static void reset(boolean verbose) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
+ registeredBeans.clear();
+ registeredTags.clear();
+ defaultNamespaces.clear();
+ CompiledObjectDecorator.reset();
+ JAXXCompilerLaunchor.loadLibraries(verbose);
+ }*/
+
+
+ /**
+ * Maps a class tag to a specific <code>TagHandler</code>. When a tag representing the bean class is
+ * encountered (either the class' simple name, if it is unambiguous, or its fully-qualified name), the specified
+ * <code>TagHandler</code> will be invoked to compile it.
+ *
+ * @param beanClass the class to associate with a <code>TagHandler</code>
+ * @param handler the <code>TagHandler</code> class, which must descend from <code>DefaultObjectHandler</code>
+ * @throws IllegalArgumentException if the handler class does not descend from <code>DefaultObjectHandler</code>
+ */
+ /*public static <T extends TagHandler> void registerBean(ClassDescriptor beanClass, Class<T> handler) {
+ if (!DefaultObjectHandler.class.isAssignableFrom(handler)) {
+ throw new IllegalArgumentException("handler class must be a subclass of DefaultObjectHandler");
+ }
+ registeredBeans.put(beanClass, handler);
+ if (log.isDebugEnabled()) {
+ log.debug(beanClass + " : " + handler);
+ }
+ String name = beanClass.getName();
+ int dotPos = name.lastIndexOf(".");
+ String namespace = name.substring(0, dotPos + 1) + "*";
+ name = name.substring(dotPos + 1);
+ registerDefaultNamespace(name, namespace);
+ }*/
+
+
+ /**
+ * Sets the default namespace for a tag. When the tag is encountered with no namespace specified,
+ * the specified namespace will be assumed. Mapping the same tag to two or more default namespaces
+ * removes the mapping and marks the entry as being ambiguous (by putting a <code>null</code>
+ * value into the map); this causes an error to be thrown if the tag is used without a namespace being
+ * specified.
+ * <p/>
+ * Java package names on tags are automatically converted into namespaces (e.g. <javax.swing.JButton/>
+ * and <JButton xmlns="javax.swing.*"/> are equivalent), so tags with package names are considered
+ * to have namespaces specified.
+ *
+ * @param tag tag name
+ * @param namespace namespace
+ */
+ public static void registerDefaultNamespace(String tag, String namespace) {
+ if (defaultNamespaces.containsKey(tag)
+ && defaultNamespaces.get(tag) != null
+ && !defaultNamespaces.get(tag).equals(namespace)) {
+ defaultNamespaces.put(tag, null); // tag name is now ambiguous
+ } else {
+ defaultNamespaces.put(tag, namespace);
+ }
+ }
+
+
+ /**
+ * Registers a <code>TagHandler</code> for a tag. When a tag with the given name and namespace
+ * is encountered, the <code>TagHandler's compileFirstPass</code> and <code>compileSecondPass</code>
+ * methods will be invoked to handle it.
+ * <p/>
+ * It is not an error to register an already-registered tag and namespace combination. The new mapping
+ * will replace the old mapping.
+ *
+ * @param namespace the tag's namespace
+ * @param tag the simple name of the tag
+ * @param handler the <code>TagHandler</code> which should process the tag
+ */
+ /*public static <T extends TagHandler> void registerTag(String namespace, String tag, T handler) {
+ if (namespace == null) {
+ namespace = "*";
+ }
+ //System.out.println("registerTag "+namespace+" : "+tag+" : "+handler);
+ if (log.isDebugEnabled()) {
+ log.debug(tag + " : " + handler);
+ }
+ registeredTags.put(new QName(namespace, tag), handler);
+ registerDefaultNamespace(tag, namespace);
+ }*/
+
+
+ /**
+ * Returns the <code>TagHandler</code> that should be used to process the specified tag.
+ * If the tag represents the class name of an uncompiled <code>.jaxx</code> file, the
+ * <code>.jaxx</code> is first compiled.
+ *
+ * @param namespace the tag's namespace (may be <code>null</code>)
+ * @param tag the tag's simple name
+ * @param compiler the current <code>JAXXCompiler</code>
+ * @return the <code>TagHandler</code> for the tag
+ * @throws jaxx.CompilerException ?
+ */
+ /*public static TagHandler getTagHandler(String namespace, String tag, JAXXCompiler compiler) throws CompilerException {
+ return getTagHandler(namespace, tag, false, compiler);
+ }*/
+
+
+ /*private static String getNamespace(ClassDescriptor beanClass) {
+ String packageName = beanClass.getPackageName();
+ return packageName != null ? packageName + ".*" : "*";
+
+ }*/
+
+
+ /*private static String getSimpleName(ClassDescriptor beanClass) {
+ String packageName = beanClass.getPackageName();
+ if (packageName != null) {
+ assert beanClass.getName().startsWith(packageName);
+ return beanClass.getName().substring(packageName.length() + 1);
+ }
+ return beanClass.getName();
+ }*/
+
+
+ /**
+ * @param beanClass the tag class
+ * @return the <code>TagHandler</code> that should be used to process the specified class.
+ * Only <code>TagHandlers</code> previously registered with <code>registerBean</code>
+ * are considered.
+ * @throws jaxx.CompilerException ?
+ */
+ /*public static DefaultObjectHandler getTagHandler(ClassDescriptor beanClass) throws CompilerException {
+ try {
+ if (beanClass == null) {
+ throw new NullPointerException();
+ }
+ String namespace = getNamespace(beanClass);
+ String tag = getSimpleName(beanClass);
+ DefaultObjectHandler handler = (DefaultObjectHandler) registeredTags.get(new QName(namespace, tag));
+ if (handler == null) {
+ Class<? extends TagHandler> handlerClass = registeredBeans.get(beanClass);
+ if (handlerClass == null) {
+ throw new CompilerException("unable to find handler for " + beanClass);
+ }
+ Constructor<? extends TagHandler> constructor = handlerClass.getConstructor(ClassDescriptor.class);
+ handler = (DefaultObjectHandler) constructor.newInstance(beanClass);
+ registerTag(namespace, tag, handler);
+ }
+ return handler;
+ }
+ catch (InstantiationException e) {
+ throw new RuntimeException(e);
+ }
+ catch (NoSuchMethodException e) {
+ throw new RuntimeException(e);
+ }
+ catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ catch (InvocationTargetException e) {
+ throw new RuntimeException(e);
+ }
+ }*/
+
+
+ private static boolean classExists(String className) {
+ if (classExistenceCache.containsKey(className)) {
+ return classExistenceCache.get(className);
+ }
+
+ boolean found = false;
+
+ try {
+ Class.forName(className);
+ found = true;
+ }catch (ClassNotFoundException e) {
+ // ignore ?
+ }
+ catch (NoClassDefFoundError e) { // we get this instead of ClassNotFoundException on case-insensitive file systems when
+ // looking up a class with the wrong case
+ }
+
+ classExistenceCache.put(className, found);
+
+ return found;
+ }
+
+
+ /*private static String determinePackage(String simpleClassName, String defaultPackage) {
+ String namespace = null;
+ Set<String> classes = compiler.getImportedClasses();
+ for (String className : classes) { // search class imports (e.g. import java.util.Date;)
+ if (className.equals(simpleClassName) || className.endsWith("." + simpleClassName)) {
+ namespace = className.substring(0, className.lastIndexOf(".") + 1) + "*";
+ }
+ }
+ if (namespace == null) { // search package imports (e.g. import java.util.*;)
+ Set<String> searchList = compiler.getImportedPackages();
+ if (defaultPackage != null) {
+ if (!defaultPackage.endsWith("*")) {
+ throw new IllegalArgumentException("defaultPackage must end in '*', found '" + defaultPackage + "'");
+ }
+ if (classExists(defaultPackage.substring(0, defaultPackage.length() - 1) + simpleClassName)) {
+ return defaultPackage;
+ }
+ }
+ for (String currentPackage : searchList) {
+ String className = currentPackage + simpleClassName;
+ if (classExists(className)) {
+ if (namespace != null) { // we've already found the same name in another package
+ //compiler.reportError("symbol '" + simpleClassName + "' is ambiguous, found matching classes " + namespace.substring(0, namespace.length() - 1) + simpleClassName + " and " + currentPackage + simpleClassName + ". Use fully-qualified name to disambiguate.");
+ return null;
+ }
+ namespace = currentPackage + "*";
+ }
+ }
+ }
+
+ return namespace;
+ }*/
+
+ /**
+ * Resolves a simple class name (like <code>Object</code> or <code>String</code>) to its fully-qualified name. Inner
+ * classes should be represented as they would appear in Java source code (e.g. JPopupMenu.Separator). Fully-qualified names,
+ * such as <code>java.lang.Object</code> are legal and will be returned unmodified (and in fact it is generally impossible to
+ * even know whether a given reference is fully qualified until it has been resolved). Returns <code>null</code> if no matching
+ * class could be found.
+ *
+ * @param name name to resolve
+ * @param compiler compile to use
+ * @return the resolved fqn class name
+ */
+ public static String resolveClassName(String name) {
+ if (name.endsWith("[]"))
+ return resolveClassName(name.substring(0, name.length() - 2)) + "[]";
+ if (name.indexOf("<") != -1)
+ name = name.substring(0, name.indexOf("<")); // strip off generic types
+
+ name = name.intern();
+ if (name.equals("boolean") || name.equals("byte") || name.equals("short") || name.equals("int") ||
+ name.equals("long") || name.equals("float") || name.equals("double") || name.equals("char"))
+ return name;
+
+ String result = null;
+ String originalName = name;
+ String defaultNamespace = null;
+ if (defaultNamespaces.containsKey(name)) {
+ defaultNamespace = defaultNamespaces.get(name);
+ if (defaultNamespace == null) { // defaultNamespaces map contains a null value, which is put there to indicate ambiguity
+ //compiler.reportError("class '" + name + "' is ambiguous; specify fully-qualified name (package and class) to disambiguate");
+ return null;
+ }
+ }
+ if (defaultNamespace != null && defaultNamespace.endsWith("*")) {
+ result = defaultNamespace.substring(0, defaultNamespace.length() - 1) + name;
+ }
+
+ /*if (result == null) {
+ // Inner class names (like JPopupMenu.Separator) present a special challenge. The name before the dot might be
+ // a package name, or it might be a class name. If it's a class name, it might be fully qualified, or it might
+ // not. And it's also not actually the correct name of the class, as far as the JVM is concerned -- the correct
+ // name uses a dollar sign instead of a dot (javax.swing.JPopupMenu$Separator). And there could be more than
+ // one inner class -- it's possible to have com.mycompany.Outer$Inner$Innerer$Innerest.
+ //
+ // The basic strategy is to start by treating the part before the last dot as a package name, as that is by far
+ // the most likely case. If we don't find the class there, change the last dot to a dollar sign and try again.
+ // Suppose we have the tag <com.mycompany.Outer.Inner.Innerer.Innerest/>, matching the class above. Resolution
+ // proceeds like this:
+ // com.mycompany.Outer.Inner.Innerer.* : Innerest
+ // com.mycompany.Outer.Inner.* : Innerer$Innerest
+ // com.mycompany.Outer.* : Inner$Innerer$Innerest
+ // com.mycompany.* : Outer$Inner$Innerer$Innerest
+ // And at this point we have a match with the class Outer$Inner$Innerer$Innerest in package com.mycompany.
+ int dotPos = originalName.lastIndexOf('.');
+ for (; ;) {
+ String namespace = dotPos != -1 ? originalName.substring(0, dotPos) + ".*" : "*";
+ name = originalName.substring(dotPos + 1).replace('.', '$');
+ String packageName = determinePackage(name, namespace);
+ if (packageName != null) {
+ assert packageName.endsWith("*");
+ if (packageName.equals(namespace) || namespace.equals("*")) {
+ // check for an alias (like javax.swing.JComboBox actually being jaxx.runtime.swing.JAXXComboBox)
+ TagHandler handler = registeredTags.get(new QName(namespace, name));
+ if (handler != null) { // determine alias by looking at handler
+ ClassDescriptor alias = ((DefaultObjectHandler) handler).getBeanClass();
+ // make sure the same handler is used for both the aliased and non-aliased names, in order to avoid "no CompiledObject has been registered" error
+ // the line below doesn't bother to handle the case where the aliased class name doesn't have a package, since it's a pretty safe assumption that
+ // that will never happen
+ assert alias.getPackageName() != null && alias.getPackageName().length() > 0 : "aliasing with no package name has not been implemented";
+ registeredTags.put(new QName(alias.getPackageName() + ".*", alias.getName().substring(alias.getPackageName().length() + 1)), handler);
+ result = alias.getName();
+ break;
+ } else { // no alias
+ result = packageName.substring(0, packageName.length() - 1) + name;
+ break;
+ }
+ }
+ // else we found a class by the same name, but in the wrong package
+ }
+
+ if (dotPos <= 0)
+ break;
+ dotPos = originalName.lastIndexOf('.', dotPos - 1);
+ }
+ }*/
+
+ if (result != null && !result.equals(originalName))
+ result = resolveClassName(result); // check for aliases against the new name as well
+
+ return result;
+ }
+
+
+ /*public static ClassDescriptor resolveClass(String className, JAXXCompiler compiler) {
+ try {
+ className = resolveClassName(className, compiler);
+ if (className == null)
+ return null;
+ return ClassDescriptorLoader.getClassDescriptor(className, compiler.getClassLoader());
+ }
+ catch (ClassNotFoundException e) {
+ return null;
+ }
+ }*/
+}
\ No newline at end of file
1
0
[Buix-commits] r1332 - in guix/trunk/guix-test/src/main/java/org: . codelutin codelutin/guix
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
17 Apr '09
Author: kmorin
Date: 2009-04-17 13:57:47 +0000 (Fri, 17 Apr 2009)
New Revision: 1332
Added:
guix/trunk/guix-test/src/main/java/org/codelutin/
guix/trunk/guix-test/src/main/java/org/codelutin/guix/
guix/trunk/guix-test/src/main/java/org/codelutin/guix/App.java
Log:
Added: guix/trunk/guix-test/src/main/java/org/codelutin/guix/App.java
===================================================================
--- guix/trunk/guix-test/src/main/java/org/codelutin/guix/App.java (rev 0)
+++ guix/trunk/guix-test/src/main/java/org/codelutin/guix/App.java 2009-04-17 13:57:47 UTC (rev 1332)
@@ -0,0 +1,13 @@
+package org.codelutin.guix;
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
1
0
[Buix-commits] r1331 - in guix/trunk: . src/test/java/org/codelutin/guix
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
17 Apr '09
Author: kmorin
Date: 2009-04-17 13:57:30 +0000 (Fri, 17 Apr 2009)
New Revision: 1331
Removed:
guix/trunk/src/test/java/org/codelutin/guix/AppTest.java
Modified:
guix/trunk/pom.xml
Log:
Modified: guix/trunk/pom.xml
===================================================================
--- guix/trunk/pom.xml 2009-04-17 13:57:12 UTC (rev 1330)
+++ guix/trunk/pom.xml 2009-04-17 13:57:30 UTC (rev 1331)
@@ -20,7 +20,8 @@
<modules>
<module>guix-compiler</module>
<module>guix-maven-plugin</module>
- </modules>
+ <module>guix-test</module>
+ </modules>
<dependencies>
<dependency>
@@ -164,11 +165,11 @@
<plugins>
- <plugin>
+ <!--plugin>
<groupId>org.codelutin.guix</groupId>
<artifactId>guix-maven-plugin</artifactId>
<version>${project.version}</version>
- </plugin>
+ </plugin-->
<!-- Always process jrst files, but only called on pre-site phase -->
<plugin>
@@ -257,4 +258,4 @@
</profile>
</profiles>
-</project>
+</project>
\ No newline at end of file
Deleted: guix/trunk/src/test/java/org/codelutin/guix/AppTest.java
===================================================================
--- guix/trunk/src/test/java/org/codelutin/guix/AppTest.java 2009-04-17 13:57:12 UTC (rev 1330)
+++ guix/trunk/src/test/java/org/codelutin/guix/AppTest.java 2009-04-17 13:57:30 UTC (rev 1331)
@@ -1,38 +0,0 @@
-package org.codelutin.guix;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Unit test for simple App.
- */
-public class AppTest
- extends TestCase
-{
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public AppTest( String testName )
- {
- super( testName );
- }
-
- /**
- * @return the suite of tests being tested
- */
- public static Test suite()
- {
- return new TestSuite( AppTest.class );
- }
-
- /**
- * Rigourous Test :-)
- */
- public void testApp()
- {
- assertTrue( true );
- }
-}
1
0
[Buix-commits] r1330 - in guix/trunk/guix-compiler/src: main/java/org/codelutin/guix main/java/org/codelutin/guix/compiler test/java/org/codelutin/guix
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
17 Apr '09
Author: kmorin
Date: 2009-04-17 13:57:12 +0000 (Fri, 17 Apr 2009)
New Revision: 1330
Removed:
guix/trunk/guix-compiler/src/test/java/org/codelutin/guix/AppTest.java
Modified:
guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/GuixLauncher.java
guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/compiler/GuixCompiler.java
Log:
Modified: guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/GuixLauncher.java
===================================================================
--- guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/GuixLauncher.java 2009-04-17 13:56:07 UTC (rev 1329)
+++ guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/GuixLauncher.java 2009-04-17 13:57:12 UTC (rev 1330)
@@ -26,7 +26,7 @@
public class GuixLauncher {
/** log */
- /*protected static final Log log =
+ /* protected static final Log log =
LogFactory.getLog(GuixLauncher.class);*/
/** original list of files to compile */
protected final File[] files;
@@ -45,6 +45,7 @@
/** CLassDescriptor met during the compilation */
protected List<ClassDescriptor> classDescriptors =
new ArrayList<ClassDescriptor>();
+ private List<File> compiledFiles = new ArrayList<File>();
protected int compilerCount;
private File targetDirectory = new File("destination");
@@ -89,8 +90,10 @@
/*if (log.isDebugEnabled()) {
log.debug("compile first pass for " + className);
}*/
- //if (symbolTables.get(file) == null) {
- compiled = true;
+ if (!compiledFiles.contains(file)) {
+ compiled = true;
+ compiledFiles.add(file);
+ }
if (compilers.containsKey(className)) {
//throw new CompilerException("Internal error: " + className + " is already being compiled, attempting to compile it again");
}
@@ -242,7 +245,7 @@
i++;
}
//if the ClassDescriptor does not exist
- if (i < classDescriptors.size()) {
+ if (i >= classDescriptors.size()) {
classDescriptors.add(classDescriptor);
return true;
}
Modified: guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/compiler/GuixCompiler.java
===================================================================
--- guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/compiler/GuixCompiler.java 2009-04-17 13:56:07 UTC (rev 1329)
+++ guix/trunk/guix-compiler/src/main/java/org/codelutin/guix/compiler/GuixCompiler.java 2009-04-17 13:57:12 UTC (rev 1330)
@@ -77,10 +77,11 @@
xpp.nextToken();
if(xpp.getEventType() == XmlPullParser.COMMENT)
doc.append(xpp.getText());
- } while(xpp.getEventType() == XmlPullParser.START_TAG);
+ } while(xpp.getEventType() != XmlPullParser.START_TAG);
String nameSpace = xpp.getNamespace();
String localName = xpp.getName();
+ System.out.println("start tag ? " + (xpp.getEventType() == XmlPullParser.START_TAG));
String packageName =
getPackageName(nameSpace, localName);
@@ -160,7 +161,7 @@
packageName = nameSpace.substring(0, nameSpace.length() - 2);
} else {
String fullClassName = TagManager.resolveClassName(localName);
- packageName = fullClassName
+ packageName = (fullClassName == null) ? null : fullClassName
.substring(0, fullClassName.lastIndexOf('.'));
}
return packageName;
Deleted: guix/trunk/guix-compiler/src/test/java/org/codelutin/guix/AppTest.java
===================================================================
--- guix/trunk/guix-compiler/src/test/java/org/codelutin/guix/AppTest.java 2009-04-17 13:56:07 UTC (rev 1329)
+++ guix/trunk/guix-compiler/src/test/java/org/codelutin/guix/AppTest.java 2009-04-17 13:57:12 UTC (rev 1330)
@@ -1,38 +0,0 @@
-package org.codelutin.guix;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Unit test for simple App.
- */
-public class AppTest
- extends TestCase
-{
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public AppTest( String testName )
- {
- super( testName );
- }
-
- /**
- * @return the suite of tests being tested
- */
- public static Test suite()
- {
- return new TestSuite( AppTest.class );
- }
-
- /**
- * Rigourous Test :-)
- */
- public void testApp()
- {
- assertTrue( true );
- }
-}
1
0
[Buix-commits] r1329 - in guix/trunk/guix-test/src/main: java resources/i18n
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
17 Apr '09
Author: kmorin
Date: 2009-04-17 13:56:07 +0000 (Fri, 17 Apr 2009)
New Revision: 1329
Added:
guix/trunk/guix-test/src/main/java/org/
guix/trunk/guix-test/src/main/resources/i18n/guix-test-fr_FR.properties
Log:
Added: guix/trunk/guix-test/src/main/resources/i18n/guix-test-fr_FR.properties
===================================================================
1
0
[Buix-commits] r1328 - guix/trunk/guix-maven-plugin/src/main/java/org/codelutin/guix
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
17 Apr '09
Author: kmorin
Date: 2009-04-17 13:55:54 +0000 (Fri, 17 Apr 2009)
New Revision: 1328
Modified:
guix/trunk/guix-maven-plugin/src/main/java/org/codelutin/guix/GuixMojo.java
Log:
Modified: guix/trunk/guix-maven-plugin/src/main/java/org/codelutin/guix/GuixMojo.java
===================================================================
--- guix/trunk/guix-maven-plugin/src/main/java/org/codelutin/guix/GuixMojo.java 2009-04-17 13:55:40 UTC (rev 1327)
+++ guix/trunk/guix-maven-plugin/src/main/java/org/codelutin/guix/GuixMojo.java 2009-04-17 13:55:54 UTC (rev 1328)
@@ -7,6 +7,7 @@
/**
*
* @author morin
+ * @goal testMojo
*/
public class GuixMojo extends AbstractMojo
{
1
0
[Buix-commits] r1327 - in guix/trunk: . guix-test guix-test/src guix-test/src/main guix-test/src/main/resources guix-test/src/test guix-test/src/test/java guix-test/src/test/java/org guix-test/src/test/java/org/codelutin
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
17 Apr '09
Author: kmorin
Date: 2009-04-17 13:55:40 +0000 (Fri, 17 Apr 2009)
New Revision: 1327
Added:
guix/trunk/guix-test/
guix/trunk/guix-test/pom.xml
guix/trunk/guix-test/src/
guix/trunk/guix-test/src/main/
guix/trunk/guix-test/src/main/java/
guix/trunk/guix-test/src/main/resources/
guix/trunk/guix-test/src/main/resources/i18n/
guix/trunk/guix-test/src/test/
guix/trunk/guix-test/src/test/java/
guix/trunk/guix-test/src/test/java/org/
guix/trunk/guix-test/src/test/java/org/codelutin/
guix/trunk/guix-test/src/test/java/org/codelutin/guix/
Log:
Property changes on: guix/trunk/guix-test
___________________________________________________________________
Name: svn:ignore
+ target
Added: guix/trunk/guix-test/pom.xml
===================================================================
--- guix/trunk/guix-test/pom.xml (rev 0)
+++ guix/trunk/guix-test/pom.xml 2009-04-17 13:55:40 UTC (rev 1327)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+ <parent>
+ <groupId>org.codelutin.guix</groupId>
+ <artifactId>guix</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>guix-test</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>xpp3</groupId>
+ <artifactId>xpp3</artifactId>
+ <version>1.1.3.3</version>
+ </dependency>
+ </dependencies>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+ <name>guix-test</name>
+ <description>Guix test</description>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+
+ <packaging>jar</packaging>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Environment ************************************** -->
+ <!-- ************************************************************* -->
+ <scm>
+ <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/buix/guix/trunk/guix-test</connection>
+ <!--developerConnection>scm:svn:svn+ssh://sletellier@labs.libre-entreprise.org/svnroot/buix/guix/trunk</developerConnection-->
+ <!--url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/guix/trunk/?roo…</url-->
+ </scm>
+
+ <build>
+
+ <plugins>
+
+ <plugin>
+ <groupId>org.codelutin.guix</groupId>
+ <artifactId>guix-maven-plugin</artifactId>
+ <version>${project.version}</version>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>testMojo</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <configuration>
+ <outputDirectory>${project.build.directory}/lib</outputDirectory>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+
+</project>
1
0
Author: kmorin
Date: 2009-04-17 12:58:01 +0000 (Fri, 17 Apr 2009)
New Revision: 1326
Modified:
guix/trunk/pom.xml
Log:
Modified: guix/trunk/pom.xml
===================================================================
--- guix/trunk/pom.xml 2009-04-17 12:57:31 UTC (rev 1325)
+++ guix/trunk/pom.xml 2009-04-17 12:58:01 UTC (rev 1326)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -19,7 +20,6 @@
<modules>
<module>guix-compiler</module>
<module>guix-maven-plugin</module>
- <module>jaxx-my-example</module>
</modules>
<dependencies>
@@ -163,6 +163,13 @@
</pluginManagement>
<plugins>
+
+ <plugin>
+ <groupId>org.codelutin.guix</groupId>
+ <artifactId>guix-maven-plugin</artifactId>
+ <version>${project.version}</version>
+ </plugin>
+
<!-- Always process jrst files, but only called on pre-site phase -->
<plugin>
<groupId>org.codelutin</groupId>
@@ -207,11 +214,9 @@
<name>CodeLutinRepository</name>
<url>http://lutinbuilder.labs.libre-entreprise.org/maven2</url>
<snapshots>
- <enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
<releases>
- <enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</releases>
</repository>
1
0
[Buix-commits] r1325 - guix/trunk/guix-maven-plugin
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
by kmorin@users.labs.libre-entreprise.org 17 Apr '09
17 Apr '09
Author: kmorin
Date: 2009-04-17 12:57:31 +0000 (Fri, 17 Apr 2009)
New Revision: 1325
Added:
guix/trunk/guix-maven-plugin/pom.xml
Log:
Added: guix/trunk/guix-maven-plugin/pom.xml
===================================================================
--- guix/trunk/guix-maven-plugin/pom.xml (rev 0)
+++ guix/trunk/guix-maven-plugin/pom.xml 2009-04-17 12:57:31 UTC (rev 1325)
@@ -0,0 +1,134 @@
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+
+ <parent>
+ <groupId>org.codelutin.guix</groupId>
+ <artifactId>guix</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>guix-maven-plugin</artifactId>
+
+ <dependencies>
+
+ <!-- sibling dependencies -->
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>guix-compiler</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!-- maven plugin project dependencies -->
+
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ </dependency>
+
+ <!-- other dependencies -->
+
+ <dependency>
+ <groupId>org.codelutin</groupId>
+ <artifactId>lutinpluginutil</artifactId>
+ </dependency>
+
+ <!-- pour acceder aux BeansInfos swing via Introspector -->
+ <dependency>
+ <groupId>com.sun</groupId>
+ <artifactId>dt</artifactId>
+ <!--version>${java.version}</version-->
+ <scope>system</scope>
+ <systemPath>/${java.home}/../lib/dt.jar</systemPath>
+ </dependency>
+
+ <!-- tests dependencies -->
+
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-plugin-testing-harness</artifactId>
+ <version>1.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-verifier</artifactId>
+ <version>1.0</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity</artifactId>
+ <version>1.5</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.1</version>
+ </dependency>
+
+ </dependencies>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+
+ <name>${project.artifactId}</name>
+ <description>
+ Maven 2 plugin to generate java source from ui interface definitions
+ in guix format.
+ </description>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+
+ <packaging>maven-plugin</packaging>
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>helpmojo</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-plugin-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Environment ************************************** -->
+ <!-- ************************************************************* -->
+ <scm>
+ <connection>${maven.scm.connection.child}</connection>
+ <!--developerConnection>${maven.scm.developerConnection.child}</developerConnection>
+ <url>${maven.scm.url.child}</url-->
+ </scm>
+
+</project>
1
0