[apache-commons-jci] Initial import (#820341)
gil
gil at fedoraproject.org
Fri Jun 15 13:18:40 UTC 2012
commit 69490cab99e9b2b284509bbc61fb63c4973af761
Author: gil <puntogil at libero.it>
Date: Fri Jun 15 13:20:42 2012 +0200
Initial import (#820341)
.gitignore | 1 +
apache-commons-jci-1.0-ExtendedDump.patch | 11 ++
apache-commons-jci-1.0-SimpleDump.patch | 11 ++
apache-commons-jci-1.0-examples-pom.patch | 34 ++++
apache-commons-jci-1.0-fixbuild.patch | 105 +++++++++++++
apache-commons-jci-1.0-janino26.patch | 62 ++++++++
apache-commons-jci.spec | 241 +++++++++++++++++++++++++++++
sources | 1 +
8 files changed, 466 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..520cdda 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/commons-jci-1.0-src.tar.gz
diff --git a/apache-commons-jci-1.0-ExtendedDump.patch b/apache-commons-jci-1.0-ExtendedDump.patch
new file mode 100644
index 0000000..9bb8dcb
--- /dev/null
+++ b/apache-commons-jci-1.0-ExtendedDump.patch
@@ -0,0 +1,11 @@
+--- core/src/test/java/org/apache/commons/jci/classes/ExtendedDump.java 2007-06-14 22:23:11.000000000 +0200
++++ core/src/test/java/org/apache/commons/jci/classes/ExtendedDump.java-gil 2009-01-18 19:13:48.000000000 +0100
+@@ -27,7 +27,7 @@
+
+ public static byte[] dump() throws Exception {
+
+- ClassWriter cw = new ClassWriter(true);
++ ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
+ MethodVisitor mv;
+
+ cw.visit(V1_4, ACC_PUBLIC + ACC_SUPER, "jci/Extended", null, "jci/Simple", null);
diff --git a/apache-commons-jci-1.0-SimpleDump.patch b/apache-commons-jci-1.0-SimpleDump.patch
new file mode 100644
index 0000000..7891bf4
--- /dev/null
+++ b/apache-commons-jci-1.0-SimpleDump.patch
@@ -0,0 +1,11 @@
+--- core/src/test/java/org/apache/commons/jci/classes/SimpleDump.java 2007-06-14 22:23:11.000000000 +0200
++++ core/src/test/java/org/apache/commons/jci/classes/SimpleDump.java-gil 2012-04-06 22:07:38.417795033 +0200
+@@ -26,7 +26,7 @@
+
+ public static byte[] dump( final String to ) throws Exception {
+
+- ClassWriter cw = new ClassWriter(true);
++ ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
+ MethodVisitor mv;
+
+ cw.visit(V1_4, ACC_PUBLIC + ACC_SUPER, "jci/Simple", null, "java/lang/Object", null);
diff --git a/apache-commons-jci-1.0-examples-pom.patch b/apache-commons-jci-1.0-examples-pom.patch
new file mode 100644
index 0000000..e26aa87
--- /dev/null
+++ b/apache-commons-jci-1.0-examples-pom.patch
@@ -0,0 +1,34 @@
+--- examples/pom.xml 2007-06-14 22:23:18.000000000 +0200
++++ examples/pom.xml-gil 2012-06-13 10:59:43.508262627 +0200
+@@ -22,6 +22,7 @@
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-jci</artifactId>
+ <version>1.0</version>
++ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <packaging>jar</packaging>
+ <artifactId>commons-jci-examples</artifactId>
+@@ -50,12 +51,12 @@
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+- <groupId>javax.servlet</groupId>
+- <artifactId>servlet-api</artifactId>
+- <version>2.4</version>
++ <groupId>org.apache.tomcat</groupId>
++ <artifactId>tomcat-servlet-api</artifactId>
++ <version>7.0.27</version>
+ </dependency>
+ </dependencies>
+- <build>
++ <!--build>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+@@ -70,5 +71,5 @@
+ </configuration>
+ </plugin>
+ </plugins>
+- </build>
++ </build-->
+ </project>
diff --git a/apache-commons-jci-1.0-fixbuild.patch b/apache-commons-jci-1.0-fixbuild.patch
new file mode 100644
index 0000000..134954c
--- /dev/null
+++ b/apache-commons-jci-1.0-fixbuild.patch
@@ -0,0 +1,105 @@
+diff -Nru commons-jci-1.0-src/compilers/eclipse/pom.xml commons-jci-1.0-src-gil/compilers/eclipse/pom.xml
+--- commons-jci-1.0-src/compilers/eclipse/pom.xml 2007-06-14 22:23:17.000000000 +0200
++++ commons-jci-1.0-src-gil/compilers/eclipse/pom.xml 2012-04-06 21:32:41.304745296 +0200
+@@ -22,6 +22,7 @@
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-jci</artifactId>
+ <version>1.0</version>
++ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <packaging>jar</packaging>
+ <artifactId>commons-jci-eclipse</artifactId>
+diff -Nru commons-jci-1.0-src/compilers/groovy/pom.xml commons-jci-1.0-src-gil/compilers/groovy/pom.xml
+--- commons-jci-1.0-src/compilers/groovy/pom.xml 2007-06-14 22:23:17.000000000 +0200
++++ commons-jci-1.0-src-gil/compilers/groovy/pom.xml 2012-04-06 21:34:35.059747993 +0200
+@@ -22,6 +22,7 @@
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-jci</artifactId>
+ <version>1.0</version>
++ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <packaging>jar</packaging>
+ <artifactId>commons-jci-groovy</artifactId>
+@@ -50,9 +51,9 @@
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+- <groupId>groovy</groupId>
+- <artifactId>groovy-all</artifactId>
+- <version>1.0-jsr-03</version>
++ <groupId>org.codehaus.groovy</groupId>
++ <artifactId>groovy</artifactId>
++ <version>1.8.6</version>
+ </dependency>
+ </dependencies>
+ </project>
+diff -Nru commons-jci-1.0-src/compilers/janino/pom.xml commons-jci-1.0-src-gil/compilers/janino/pom.xml
+--- commons-jci-1.0-src/compilers/janino/pom.xml 2007-06-14 22:23:18.000000000 +0200
++++ commons-jci-1.0-src-gil/compilers/janino/pom.xml 2012-04-06 21:35:48.373749732 +0200
+@@ -22,6 +22,7 @@
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-jci</artifactId>
+ <version>1.0</version>
++ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <packaging>jar</packaging>
+ <artifactId>commons-jci-janino</artifactId>
+@@ -50,9 +51,14 @@
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+- <groupId>janino</groupId>
++ <groupId>org.codehaus.janino</groupId>
+ <artifactId>janino</artifactId>
+ <version>2.4.3</version>
+ </dependency>
++ <dependency>
++ <groupId>org.codehaus.janino</groupId>
++ <artifactId>commons-compiler</artifactId>
++ <version>2.4.3</version>
++ </dependency>
+ </dependencies>
+ </project>
+diff -Nru commons-jci-1.0-src/compilers/javac/pom.xml commons-jci-1.0-src-gil/compilers/javac/pom.xml
+--- commons-jci-1.0-src/compilers/javac/pom.xml 2007-06-14 22:23:17.000000000 +0200
++++ commons-jci-1.0-src-gil/compilers/javac/pom.xml 2012-04-06 21:36:21.952750528 +0200
+@@ -22,6 +22,7 @@
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-jci</artifactId>
+ <version>1.0</version>
++ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <packaging>jar</packaging>
+ <artifactId>commons-jci-javac</artifactId>
+diff -Nru commons-jci-1.0-src/compilers/rhino/pom.xml commons-jci-1.0-src-gil/compilers/rhino/pom.xml
+--- commons-jci-1.0-src/compilers/rhino/pom.xml 2007-06-14 22:23:16.000000000 +0200
++++ commons-jci-1.0-src-gil/compilers/rhino/pom.xml 2012-04-06 21:37:22.780751971 +0200
+@@ -22,6 +22,7 @@
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-jci</artifactId>
+ <version>1.0</version>
++ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <packaging>jar</packaging>
+ <artifactId>commons-jci-rhino</artifactId>
+diff -Nru commons-jci-1.0-src/pom.xml commons-jci-1.0-src-gil/pom.xml
+--- commons-jci-1.0-src/pom.xml 2007-06-14 22:23:18.000000000 +0200
++++ commons-jci-1.0-src-gil/pom.xml 2012-04-06 21:40:11.741755978 +0200
+@@ -128,7 +128,7 @@
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.0</version>
+ </plugin>
+- <plugin>
++ <!--plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <version>1.0.0</version>
+@@ -146,7 +146,7 @@
+ </tags>
+ <aggregate>true</aggregate>
+ </configuration>
+- </plugin>
++ </plugin-->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
diff --git a/apache-commons-jci-1.0-janino26.patch b/apache-commons-jci-1.0-janino26.patch
new file mode 100644
index 0000000..90cc136
--- /dev/null
+++ b/apache-commons-jci-1.0-janino26.patch
@@ -0,0 +1,62 @@
+diff -Nru commons-jci-1.0-src/compilers/janino/src/main/java/org/apache/commons/jci/compilers/JaninoCompilationProblem.java commons-jci-1.0-src-gil/compilers/janino/src/main/java/org/apache/commons/jci/compilers/JaninoCompilationProblem.java
+--- commons-jci-1.0-src/compilers/janino/src/main/java/org/apache/commons/jci/compilers/JaninoCompilationProblem.java 2007-06-14 22:23:18.000000000 +0200
++++ commons-jci-1.0-src-gil/compilers/janino/src/main/java/org/apache/commons/jci/compilers/JaninoCompilationProblem.java 2012-06-13 11:57:32.778432297 +0200
+@@ -18,8 +18,8 @@
+ package org.apache.commons.jci.compilers;
+
+ import org.apache.commons.jci.problems.CompilationProblem;
+-import org.codehaus.janino.Location;
+-import org.codehaus.janino.Scanner.LocatedException;
++import org.codehaus.commons.compiler.Location;
++import org.codehaus.commons.compiler.LocatedException;
+
+ /**
+ * Janino version of a CompilationProblem
+diff -Nru commons-jci-1.0-src/compilers/janino/src/main/java/org/apache/commons/jci/compilers/JaninoJavaCompiler.java commons-jci-1.0-src-gil/compilers/janino/src/main/java/org/apache/commons/jci/compilers/JaninoJavaCompiler.java
+--- commons-jci-1.0-src/compilers/janino/src/main/java/org/apache/commons/jci/compilers/JaninoJavaCompiler.java 2007-06-14 22:23:18.000000000 +0200
++++ commons-jci-1.0-src-gil/compilers/janino/src/main/java/org/apache/commons/jci/compilers/JaninoJavaCompiler.java 2012-06-13 12:57:53.097609355 +0200
+@@ -34,18 +34,18 @@
+ import org.apache.commons.logging.Log;
+ import org.apache.commons.logging.LogFactory;
+ import org.codehaus.janino.ClassLoaderIClassLoader;
+-import org.codehaus.janino.CompileException;
+-import org.codehaus.janino.DebuggingInformation;
++import org.codehaus.commons.compiler.CompileException;
++//import org.codehaus.janino.DebuggingInformation;
+ import org.codehaus.janino.Descriptor;
+ import org.codehaus.janino.IClass;
+ import org.codehaus.janino.IClassLoader;
+ import org.codehaus.janino.Java;
+-import org.codehaus.janino.Location;
++import org.codehaus.commons.compiler.Location;
+ import org.codehaus.janino.Parser;
+ import org.codehaus.janino.Scanner;
+ import org.codehaus.janino.UnitCompiler;
+ import org.codehaus.janino.WarningHandler;
+-import org.codehaus.janino.Scanner.LocatedException;
++import org.codehaus.commons.compiler.LocatedException;
+ import org.codehaus.janino.UnitCompiler.ErrorHandler;
+ import org.codehaus.janino.util.ClassFile;
+
+@@ -112,7 +112,7 @@
+ }
+ });
+ log.debug("compile " + className);
+- final ClassFile[] classFiles = uc.compileUnit(DebuggingInformation.ALL);
++ final ClassFile[] classFiles = uc.compileUnit(true, true, true);
+ for (int i = 0; i < classFiles.length; i++) {
+ log.debug("compiled " + classFiles[i].getThisClassName());
+ classes.put(classFiles[i].getThisClassName(), classFiles[i].toByteArray());
+@@ -148,7 +148,11 @@
+ final CompilingIClassLoader icl = new CompilingIClassLoader(pResourceReader, classFilesByName, pClassLoader);
+ for (int i = 0; i < pSourceNames.length; i++) {
+ log.debug("compiling " + pSourceNames[i]);
+- icl.loadIClass(Descriptor.fromClassName(ConversionUtils.convertResourceToClassName(pSourceNames[i])));
++ try {
++ icl.loadIClass(Descriptor.fromClassName(ConversionUtils.convertResourceToClassName(pSourceNames[i])));
++ } catch (ClassNotFoundException e) {
++ log.error(e);
++ }
+ }
+
+ // Store all fully compiled classes
diff --git a/apache-commons-jci.spec b/apache-commons-jci.spec
new file mode 100644
index 0000000..863ff7a
--- /dev/null
+++ b/apache-commons-jci.spec
@@ -0,0 +1,241 @@
+%global base_name jci
+%global short_name commons-%{base_name}
+%global namedreltag %{nil}
+%global namedversion %{version}%{?namedreltag}
+
+Name: apache-commons-jci
+Version: 1.0
+Release: 2%{?dist}
+Summary: Commons Java Compiler Interface
+Group: Development/Libraries
+License: ASL 2.0
+URL: http://commons.apache.org/jci/
+Source0: ftp://ftp.gbnet.net/pub/apache/dist/commons/%{base_name}/source/%{short_name}-%{namedversion}-src.tar.gz
+
+# fix parent relative path
+# fix groovy gId and aId
+# add org.codehaus.janino commons-compiler
+# remove org.codehaus.mojo findbugs-maven-plugin 1.0.0
+Patch0: %{name}-%{namedversion}-fixbuild.patch
+# asm 3 test build
+Patch1: %{name}-%{namedversion}-ExtendedDump.patch
+Patch2: %{name}-%{namedversion}-SimpleDump.patch
+# fix parent relative path
+# remove jetty-maven-plugin
+# use tomcat 7.x apis
+Patch3: %{name}-%{namedversion}-examples-pom.patch
+
+Patch4: %{name}-%{namedversion}-janino26.patch
+
+BuildRequires: java-devel
+BuildRequires: jpackage-utils
+
+BuildRequires: maven
+BuildRequires: maven-antrun-plugin
+BuildRequires: maven-compiler-plugin
+BuildRequires: maven-install-plugin
+BuildRequires: maven-jar-plugin
+BuildRequires: maven-javadoc-plugin
+BuildRequires: maven-plugin-bundle
+BuildRequires: maven-plugin-cobertura
+BuildRequires: maven-resources-plugin
+BuildRequires: maven-site-plugin
+BuildRequires: maven-surefire-plugin
+BuildRequires: maven-surefire-provider-junit4
+
+BuildRequires: apache-commons-logging
+BuildRequires: apache-commons-io
+BuildRequires: ecj >= 3.4.2-13
+BuildRequires: groovy
+BuildRequires: janino
+BuildRequires: rhino
+
+# test deps
+BuildRequires: apache-commons-lang
+BuildRequires: junit
+BuildRequires: objectweb-asm
+
+Requires: %{name}-core = %{version}-%{release}
+
+Requires: java
+Requires: jpackage-utils
+BuildArch: noarch
+
+#* javac Commons JCI compiler implementation for the javac compiler (up to JDK 1.5).
+#* jsr199 Commons JCI compiler implementation for JDK 1.6 and up.
+
+%description
+JCI is a java compiler interface featuring a compiling class loader.
+The current implementation supports compilation via the following
+compilers:
+
+* eclipse
+* groovy
+* janino
+* rhino
+
+%package core
+Group: Development/Libraries
+Summary: Commons Java Compiler Interface - core
+Requires: apache-commons-io
+Requires: %{name}-fam = %{version}-%{release}
+
+%description core
+Commons JCI core interfaces and implementations.
+
+%package fam
+Group: Development/Libraries
+Summary: Commons Java Compiler Interface - FAM
+Requires: apache-commons-logging
+Requires: %{name} = %{version}-%{release}
+
+%description fam
+Commons JCI FileAlterationMonitor (FAM) to
+monitor local file systems and get notified
+about changes.
+
+%package javadoc
+Group: Documentation
+Summary: Javadoc for %{name}
+Requires: jpackage-utils
+
+%description javadoc
+This package contains javadoc for %{name}.
+
+# compilers
+
+%package eclipse
+Group: Development/Libraries
+Summary: Commons Java Compiler Interface - eclipse
+Requires: ecj >= 3.4.2-13
+Requires: %{name} = %{version}-%{release}
+
+%description eclipse
+Commons JCI compiler implementation for the eclipse compiler.
+
+%package groovy
+Group: Development/Libraries
+Summary: Commons Java Compiler Interface - groovy
+Requires: groovy
+Requires: %{name}-core = %{version}-%{release}
+
+%description groovy
+Commons JCI compiler implementation for the groovy compiler.
+
+%package janino
+Group: Development/Libraries
+Summary: Commons Java Compiler Interface - janino
+Requires: janino
+Requires: %{name}-core = %{version}-%{release}
+
+%description janino
+Commons JCI compiler implementation for the janino compiler.
+
+%package rhino
+Group: Development/Libraries
+Summary: Commons Java Compiler Interface - rhino
+Requires: rhino
+Requires: %{name}-core = %{version}-%{release}
+
+%description rhino
+Commons JCI compiler implementation for rhino JavaScript.
+
+%prep
+%setup -q -n %{short_name}-%{namedversion}-src
+find . -name "*.class" -delete
+find . -name "*.jar" -delete
+
+%patch0 -p1
+%patch1 -p0
+%patch2 -p0
+%patch3 -p0
+%patch4 -p1
+
+# TODO
+# require old version of jdependency
+sed -i "s|<module>compilers/javac</module>|<!--module>compilers/javac</module-->|" pom.xml
+
+sed -i "s|<module>examples</module>|<!--module>examples</module-->|" pom.xml
+
+%build
+
+# random tests failures
+mvn-rpmbuild \
+ -Dmaven.test.failure.ignore=true \
+ install javadoc:aggregate
+
+%install
+
+mkdir -p %{buildroot}%{_mavenpomdir}
+install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{short_name}-parent.pom
+%add_maven_depmap JPP.%{short_name}-parent.pom
+
+mkdir -p %{buildroot}%{_javadir}/%{short_name}
+for m in core \
+ fam;do
+ install -m 644 ${m}/target/%{short_name}-${m}-%{namedversion}.jar %{buildroot}%{_javadir}/%{short_name}/%{short_name}-${m}.jar
+ install -pm 644 ${m}/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-${m}.pom
+ %add_maven_depmap -f ${m} JPP.%{short_name}-%{short_name}-${m}.pom %{short_name}/%{short_name}-${m}.jar
+done
+
+# TODO
+# javac
+for mc in eclipse \
+ janino \
+ groovy \
+ rhino;do
+ install -m 644 compilers/${mc}/target/%{short_name}-${mc}-%{namedversion}.jar %{buildroot}%{_javadir}/%{short_name}/%{short_name}-${mc}.jar
+ install -pm 644 compilers/${mc}/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-${mc}.pom
+ %add_maven_depmap -f ${mc} JPP.%{short_name}-%{short_name}-${mc}.pom %{short_name}/%{short_name}-${mc}.jar
+done
+
+mkdir -p %{buildroot}%{_javadocdir}/%{name}
+cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
+
+%files
+%{_mavenpomdir}/JPP.%{short_name}-parent.pom
+%{_mavendepmapfragdir}/%{name}
+%doc LICENSE.txt NOTICE.txt README.txt TODO.txt
+
+%files core
+%{_javadir}/%{short_name}/%{short_name}-core.jar
+%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-core.pom
+%{_mavendepmapfragdir}/%{name}-core
+
+%files fam
+%{_javadir}/%{short_name}/%{short_name}-fam.jar
+%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-fam.pom
+%{_mavendepmapfragdir}/%{name}-fam
+
+%files javadoc
+%{_javadocdir}/%{name}
+%doc LICENSE.txt NOTICE.txt
+
+%files eclipse
+%{_javadir}/%{short_name}/%{short_name}-eclipse.jar
+%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-eclipse.pom
+%{_mavendepmapfragdir}/%{name}-eclipse
+
+%files groovy
+%{_javadir}/%{short_name}/%{short_name}-groovy.jar
+%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-groovy.pom
+%{_mavendepmapfragdir}/%{name}-groovy
+
+%files janino
+%{_javadir}/%{short_name}/%{short_name}-janino.jar
+%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-janino.pom
+%{_mavendepmapfragdir}/%{name}-janino
+
+%files rhino
+%{_javadir}/%{short_name}/%{short_name}-rhino.jar
+%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-rhino.pom
+%{_mavendepmapfragdir}/%{name}-rhino
+
+%changelog
+* Fri Jun 15 2012 gil cattaneo <puntogil at libero.it> 1.0-2
+- javadocs are installed in %%{_javadocdir}/%%{name}
+- correct spelling errors
+- fix requires
+
+* Fri Apr 06 2012 gil cattaneo <puntogil at libero.it> 1.0-1
+- initial rpm
\ No newline at end of file
diff --git a/sources b/sources
index e69de29..3c8caf7 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+969ca083b61d300e694c5300ad18107c commons-jci-1.0-src.tar.gz
More information about the scm-commits
mailing list