You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rh...@apache.org on 2007/08/01 06:52:13 UTC

svn commit: r561657 - in /incubator/qpid/trunk/qpid/java: ./ common/ plugins/ plugins/src/ plugins/src/main/ plugins/src/main/java/ plugins/src/main/java/org/ plugins/src/main/java/org/apache/ plugins/src/main/java/org/apache/qpid/ plugins/src/main/jav...

Author: rhs
Date: Tue Jul 31 21:52:09 2007
New Revision: 561657

URL: http://svn.apache.org/viewvc?view=rev&rev=561657
Log:
switched common generate script over to jython

Added:
    incubator/qpid/trunk/qpid/java/plugins/
    incubator/qpid/trunk/qpid/java/plugins/pom.xml   (with props)
    incubator/qpid/trunk/qpid/java/plugins/src/
    incubator/qpid/trunk/qpid/java/plugins/src/main/
    incubator/qpid/trunk/qpid/java/plugins/src/main/java/
    incubator/qpid/trunk/qpid/java/plugins/src/main/java/org/
    incubator/qpid/trunk/qpid/java/plugins/src/main/java/org/apache/
    incubator/qpid/trunk/qpid/java/plugins/src/main/java/org/apache/qpid/
    incubator/qpid/trunk/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/
    incubator/qpid/trunk/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java   (with props)
Modified:
    incubator/qpid/trunk/qpid/java/common/generate
    incubator/qpid/trunk/qpid/java/common/pom.xml
    incubator/qpid/trunk/qpid/java/pom.xml

Modified: incubator/qpid/trunk/qpid/java/common/generate
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/generate?view=diff&rev=561657&r1=561656&r2=561657
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/generate (original)
+++ incubator/qpid/trunk/qpid/java/common/generate Tue Jul 31 21:52:09 2007
@@ -2,12 +2,8 @@
 
 # Interim code generation script.
 
-import sys, os
+import sys, os, mllib
 from cStringIO import StringIO
-
-sys.path.append("../../python")
-
-import mllib
 
 out_dir=sys.argv[1]
 out_pkg = sys.argv[2]

Modified: incubator/qpid/trunk/qpid/java/common/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/pom.xml?view=diff&rev=561657&r1=561656&r2=561657
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/pom.xml (original)
+++ incubator/qpid/trunk/qpid/java/common/pom.xml Tue Jul 31 21:52:09 2007
@@ -41,11 +41,12 @@
         <generated.package>org/apache/qpid/framing</generated.package>
         <generated.dir>${generated.path}/${generated.package}</generated.dir>
         <generated.timestamp>${generated.dir}/timestamp</generated.timestamp>
-        <specs.dir>${topDirectoryLocation}/../specs</specs.dir>
+        <specs.dir>${basedir}/../../specs</specs.dir>
+        <mllib.dir>${basedir}/../../python</mllib.dir>
     </properties>
 
     <build>
-        <plugins>          
+        <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-antrun-plugin</artifactId>
@@ -57,17 +58,41 @@
                             <tasks>
                                 <echo>"${generated.path}"</echo>
                                 <ant antfile="protocol-version.xml" />
-                                <exec executable="python">
+<!--                                <exec executable="python">
                                   <arg line="generate"/>
                                   <arg line="${generated.path}"/>
                                   <arg line="org.apache.qpidity"/>
                                   <arg line="${specs.dir}/amqp-transitional.0-10.xml"/>
-                                </exec>
+                                </exec> -->
                             </tasks>
                             <sourceRoot>${generated.path}</sourceRoot>
                         </configuration>
                         <goals>
                             <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.qpid</groupId>
+                <artifactId>jython-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>jython</id>
+                        <phase>generate-sources</phase>
+                        <configuration>
+                            <params>
+                                <param>-Dpython.cachedir.skip=true</param>
+                                <param>-Dpython.path=${basedir}/jython-lib.jar/Lib:${mllib.dir}</param>
+                                <param>${basedir}/generate</param>
+                                <param>${generated.path}</param>
+                                <param>org.apache.qpidity</param>
+                                <param>${specs.dir}/amqp-transitional.0-10.xml</param>
+                            </params>
+                        </configuration>
+                        <goals>
+                          <goal>jython</goal>
                         </goals>
                     </execution>
                 </executions>

Added: incubator/qpid/trunk/qpid/java/plugins/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/plugins/pom.xml?view=auto&rev=561657
==============================================================================
--- incubator/qpid/trunk/qpid/java/plugins/pom.xml (added)
+++ incubator/qpid/trunk/qpid/java/plugins/pom.xml Tue Jul 31 21:52:09 2007
@@ -0,0 +1,29 @@
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.qpid</groupId>
+    <artifactId>jython-plugin</artifactId>
+    <packaging>maven-plugin</packaging>
+    <version>1.0-incubating-M2-SNAPSHOT</version>
+    <name>Jython Launcher</name>
+
+    <parent>
+        <groupId>org.apache.qpid</groupId>
+        <artifactId>qpid</artifactId>
+        <version>1.0-incubating-M2-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-plugin-api</artifactId>
+            <version>2.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.python</groupId>
+            <artifactId>jython</artifactId>
+            <version>2.2-rc1</version>
+        </dependency>
+    </dependencies>
+</project>

Propchange: incubator/qpid/trunk/qpid/java/plugins/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java?view=auto&rev=561657
==============================================================================
--- incubator/qpid/trunk/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java (added)
+++ incubator/qpid/trunk/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java Tue Jul 31 21:52:09 2007
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.plugins;
+
+import java.io.File;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+import org.python.util.jython;
+
+
+/**
+ * JythonMojo
+ *
+ * @author Rafael H. Schloming
+ *
+ * @goal jython
+ */
+
+public class JythonMojo extends AbstractMojo
+{
+
+    /**
+     * Arguments to jython.
+     *
+     * @parameter
+     */
+    private String[] params = new String[0];
+
+    public void execute() throws MojoExecutionException
+    {
+        jython.main(params);
+    }
+
+}

Propchange: incubator/qpid/trunk/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/qpid/trunk/qpid/java/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/pom.xml?view=diff&rev=561657&r1=561656&r2=561657
==============================================================================
--- incubator/qpid/trunk/qpid/java/pom.xml (original)
+++ incubator/qpid/trunk/qpid/java/pom.xml Tue Jul 31 21:52:09 2007
@@ -147,6 +147,7 @@
     </properties>
 
     <modules>
+        <module>plugins</module>
         <module>common</module>
         <module>broker</module>
         <module>client</module>
@@ -155,9 +156,8 @@
         <module>perftests</module>
         <module>integrationtests</module>
         <module>management/eclipse-plugin</module>
-		<module>client/example</module>
-		<module>client-java14</module>
-
+        <module>client/example</module>
+        <module>client-java14</module>
     </modules>
 
 
@@ -391,28 +391,27 @@
                     <version>0.5</version>
                 </plugin>
 
-         <plugin>
-               <artifactId>maven-remote-resources-plugin</artifactId>
-               <version>1.0-alpha-5</version>
-               <executions>
-                   <execution>
-                       <goals>
-                           <goal>process</goal>
-                       </goals>
-                       <configuration>
-                           <resourceBundles>
-                               <resourceBundle>org.apache:apache-incubator-disclaimer-resource-bundle:1.1</resourceBundle>
-                               <resourceBundle>org.apache:apache-jar-resource-bundle:1.2</resourceBundle>
-                           </resourceBundles>
-                           <properties>
-                               <addLicense>true</addLicense>
-                               <projectName>Apache Qpid</projectName>
-                           </properties>
-                       </configuration>
-                   </execution>
-               </executions>
-           </plugin>
-
+                <plugin>
+                    <artifactId>maven-remote-resources-plugin</artifactId>
+                    <version>1.0-alpha-5</version>
+                    <executions>
+                        <execution>
+                            <goals>
+                                <goal>process</goal>
+                            </goals>
+                            <configuration>
+                                <resourceBundles>
+                                    <resourceBundle>org.apache:apache-incubator-disclaimer-resource-bundle:1.1</resourceBundle>
+                                    <resourceBundle>org.apache:apache-jar-resource-bundle:1.2</resourceBundle>
+                                </resourceBundles>
+                                <properties>
+                                    <addLicense>true</addLicense>
+                                    <projectName>Apache Qpid</projectName>
+                                </properties>
+                            </configuration>
+                        </execution>
+                    </executions>
+                </plugin>
 
             </plugins>
         </pluginManagement>