From a8fa58e5852e43669e31c3c56e37c6bdb5c63276 Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Wed, 1 Aug 2007 04:52:09 +0000 Subject: switched common generate script over to jython git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@561657 13f79535-47bb-0310-9956-ffa450edef68 --- java/common/generate | 6 +-- java/common/pom.xml | 33 +++++++++++-- java/plugins/pom.xml | 29 ++++++++++++ .../java/org/apache/qpid/plugins/JythonMojo.java | 54 ++++++++++++++++++++++ java/pom.xml | 49 ++++++++++---------- 5 files changed, 137 insertions(+), 34 deletions(-) create mode 100644 java/plugins/pom.xml create mode 100644 java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java (limited to 'java') diff --git a/java/common/generate b/java/common/generate index 87ddf53868..d9ea47aeca 100755 --- a/java/common/generate +++ b/java/common/generate @@ -2,13 +2,9 @@ # 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] spec_file = sys.argv[3] diff --git a/java/common/pom.xml b/java/common/pom.xml index 792a7f38f4..69a68461c0 100644 --- a/java/common/pom.xml +++ b/java/common/pom.xml @@ -41,11 +41,12 @@ org/apache/qpid/framing ${generated.path}/${generated.package} ${generated.dir}/timestamp - ${topDirectoryLocation}/../specs + ${basedir}/../../specs + ${basedir}/../../python - + org.apache.maven.plugins maven-antrun-plugin @@ -57,12 +58,12 @@ "${generated.path}" - + ${generated.path} @@ -73,6 +74,30 @@ + + org.apache.qpid + jython-plugin + + + jython + generate-sources + + + -Dpython.cachedir.skip=true + -Dpython.path=${basedir}/jython-lib.jar/Lib:${mllib.dir} + ${basedir}/generate + ${generated.path} + org.apache.qpidity + ${specs.dir}/amqp-transitional.0-10.xml + + + + jython + + + + + org.codehaus.mojo diff --git a/java/plugins/pom.xml b/java/plugins/pom.xml new file mode 100644 index 0000000000..f913f0b2c3 --- /dev/null +++ b/java/plugins/pom.xml @@ -0,0 +1,29 @@ + + 4.0.0 + org.apache.qpid + jython-plugin + maven-plugin + 1.0-incubating-M2-SNAPSHOT + Jython Launcher + + + org.apache.qpid + qpid + 1.0-incubating-M2-SNAPSHOT + ../pom.xml + + + + + org.apache.maven + maven-plugin-api + 2.0 + + + + org.python + jython + 2.2-rc1 + + + diff --git a/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java b/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java new file mode 100644 index 0000000000..1788f471d7 --- /dev/null +++ b/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java @@ -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); + } + +} diff --git a/java/pom.xml b/java/pom.xml index 87ed34846f..ede9ee553f 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -147,6 +147,7 @@ under the License. + plugins common broker client @@ -155,9 +156,8 @@ under the License. perftests integrationtests management/eclipse-plugin - client/example - client-java14 - + client/example + client-java14 @@ -391,28 +391,27 @@ under the License. 0.5 - - maven-remote-resources-plugin - 1.0-alpha-5 - - - - process - - - - org.apache:apache-incubator-disclaimer-resource-bundle:1.1 - org.apache:apache-jar-resource-bundle:1.2 - - - true - Apache Qpid - - - - - - + + maven-remote-resources-plugin + 1.0-alpha-5 + + + + process + + + + org.apache:apache-incubator-disclaimer-resource-bundle:1.1 + org.apache:apache-jar-resource-bundle:1.2 + + + true + Apache Qpid + + + + + -- cgit v1.2.1