diff --git a/jibx-1.2.6-poms.patch b/jibx-1.2.6-poms.patch new file mode 100644 index 0000000..1ae9801 --- /dev/null +++ b/jibx-1.2.6-poms.patch @@ -0,0 +1,191 @@ +diff -Nru jibx/build/maven/jibx-bind/pom.xml jibx-gil/build/maven/jibx-bind/pom.xml +--- jibx/build/maven/jibx-bind/pom.xml 2014-12-30 21:17:06.000000000 +0100 ++++ jibx-gil/build/maven/jibx-bind/pom.xml 2015-01-04 18:14:23.938657295 +0100 +@@ -5,7 +5,7 @@ + + org.jibx.config + main-reactor +- 1.2.6-SNAPSHOT ++ 1.2.6 + + + org.jibx +@@ -72,9 +72,7 @@ + org.jibx.binding.*;version=${project.version}, + org.jibx.util.*;version=${project.version}, + +- @${jibxLibDir}/jibx-bind.jar;inline=** + org.jibx.binding.Compile +- bcel.jar jibx-run.jar xpp3.jar stax-api.jar wstx-asl.jar + + + +@@ -85,7 +83,7 @@ + + ${project.groupId} + jibx-run +- 1.2.6-SNAPSHOT ++ 1.2.6 + + + +diff -Nru jibx/build/maven/jibx-extras/pom.xml jibx-gil/build/maven/jibx-extras/pom.xml +--- jibx/build/maven/jibx-extras/pom.xml 2014-12-30 21:17:06.000000000 +0100 ++++ jibx-gil/build/maven/jibx-extras/pom.xml 2015-01-04 18:15:07.157501708 +0100 +@@ -5,7 +5,7 @@ + + org.jibx.config + main-reactor +- 1.2.6-SNAPSHOT ++ 1.2.6 + + + org.jibx +@@ -60,9 +60,7 @@ + + org.jibx.extras.*;version=${project.version}, + +- @${jibxLibDir}/jibx-extras.jar;inline=** + org.jibx.extras.TestRoundtrip +- jibx-run.jar xpp3.jar stax-api.jar wstx-asl.jar + + + +@@ -73,7 +71,7 @@ + + ${project.groupId} + jibx-run +- 1.2.6-SNAPSHOT ++ 1.2.6 + + + +diff -Nru jibx/build/maven/jibx-run/pom.xml jibx-gil/build/maven/jibx-run/pom.xml +--- jibx/build/maven/jibx-run/pom.xml 2014-12-30 21:17:06.000000000 +0100 ++++ jibx-gil/build/maven/jibx-run/pom.xml 2015-01-04 18:15:43.957666260 +0100 +@@ -5,7 +5,7 @@ + + org.jibx.config + main-reactor +- 1.2.6-SNAPSHOT ++ 1.2.6 + + + org.jibx +@@ -63,9 +63,7 @@ + + org.jibx.runtime.*;version=${project.version}, + +- @${jibxLibDir}/jibx-run.jar;inline=** + org.jibx.runtime.PrintInfo +- xpp3.jar stax-api.jar wstx-asl.jar + + + +diff -Nru jibx/build/maven/jibx-schema/pom.xml jibx-gil/build/maven/jibx-schema/pom.xml +--- jibx/build/maven/jibx-schema/pom.xml 2014-12-30 21:17:06.000000000 +0100 ++++ jibx-gil/build/maven/jibx-schema/pom.xml 2015-01-04 18:16:21.167810364 +0100 +@@ -5,7 +5,7 @@ + + org.jibx.config + main-reactor +- 1.2.6-SNAPSHOT ++ 1.2.6 + + + org.jibx +@@ -79,8 +79,6 @@ + !org.jibx.schema.generator.*, + org.jibx.schema.*;version=${project.version}, + +- @${jibxLibDir}/jibx-schema.jar;inline=** +- jibx-run.jar jibx-bind.jar xpp3.jar stax-api.jar wstx-asl.jar + + + +@@ -91,12 +89,12 @@ + + ${project.groupId} + jibx-bind +- 1.2.6-SNAPSHOT ++ 1.2.6 + + + ${project.groupId} + jibx-extras +- 1.2.6-SNAPSHOT ++ 1.2.6 + + + +diff -Nru jibx/build/maven/jibx-tools/pom.xml jibx-gil/build/maven/jibx-tools/pom.xml +--- jibx/build/maven/jibx-tools/pom.xml 2014-12-30 21:17:06.000000000 +0100 ++++ jibx-gil/build/maven/jibx-tools/pom.xml 2015-01-04 18:18:10.831340776 +0100 +@@ -5,7 +5,7 @@ + + org.jibx.config + main-reactor +- 1.2.6-SNAPSHOT ++ 1.2.6 + + + org.jibx +@@ -81,15 +81,7 @@ + org.jibx.custom.*;version=${project.version}, + org.jibx.ws.*;version=${project.version}, + +- @${jibxLibDir}/jibx-tools.jar;inline=** + org.jibx.ws.wsdl.tools.Jibx2Wsdl +- bcel.jar jibx-run.jar jibx-bind.jar jibx-extras.jar +- jibx-schema.jar xpp3.jar stax-api.jar wstx-asl.jar joda-time.jar log4j.jar +- qdox.jar org.eclipse.core.contenttype.jar org.eclipse.core.jobs.jar +- org.eclipse.core.resources.jar org.eclipse.core.runtime.jar +- org.eclipse.equinox.common.jar org.eclipse.equinox.preferences.jar +- org.eclipse.jdt.core.jar org.eclipse.jdt.core.manipulation.jar org.eclipse.osgi.jar +- org.eclipse.text.jar + + + +@@ -100,10 +92,10 @@ + + ${project.groupId} + jibx-schema +- 1.2.6-SNAPSHOT ++ 1.2.6 + + +- ++ + + + +diff -Nru jibx/build/maven/pom.xml jibx-gil/build/maven/pom.xml +--- jibx/build/maven/pom.xml 2014-12-30 21:17:06.000000000 +0100 ++++ jibx-gil/build/maven/pom.xml 2015-01-04 18:12:48.452419775 +0100 +@@ -2,15 +2,9 @@ + + 4.0.0 + +- +- org.jibx.config +- core-reactor +- 1.2.6-SNAPSHOT +- ../.. +- +- ++ org.jibx.config + main-reactor +- ++ 1.2.6 + pom + main-reactor - JiBX main reactor + JiBX main reactor diff --git a/jibx-classpath.patch b/jibx-classpath.patch new file mode 100644 index 0000000..90d46ad --- /dev/null +++ b/jibx-classpath.patch @@ -0,0 +1,52 @@ +From a24a03620c2f089b417548e980fb5ba8fe6f0fe7 Mon Sep 17 00:00:00 2001 +From: hannes +Date: Sat, 5 May 2012 11:25:16 +0100 +Subject: [PATCH] classpath + +--- + build/build.xml | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/build/build.xml b/build/build.xml +index 5c66d42..48aa43c 100644 +--- a/build/build.xml ++++ b/build/build.xml +@@ -299,7 +299,7 @@ file has been tested with ant version 1.6.1. + source="${source}" + deprecation="on"> + +- ++ + + + +@@ -312,7 +312,7 @@ file has been tested with ant version 1.6.1. + + + +- ++ + + + +@@ -846,7 +846,7 @@ file has been tested with ant version 1.6.1. + source="1.5" + deprecation="on"> + +- ++ + + + +@@ -857,7 +857,7 @@ file has been tested with ant version 1.6.1. + + + +- ++ + + + +-- +1.7.10 + diff --git a/jibx-port-to-qdox-2.patch b/jibx-port-to-qdox-2.patch new file mode 100644 index 0000000..297ab45 --- /dev/null +++ b/jibx-port-to-qdox-2.patch @@ -0,0 +1,167 @@ +--- build/src/org/jibx/custom/classes/ClassItemSourceWrapper.java ++++ build/src/org/jibx/custom/classes/ClassItemSourceWrapper.java +@@ -21,6 +21,8 @@ + + package org.jibx.custom.classes; + ++import java.util.List; ++ + import org.jibx.binding.classes.ClassItem; + import org.jibx.binding.model.ClassItemWrapper; + import org.jibx.util.IClass; +@@ -29,10 +31,10 @@ import org.jibx.util.IClassLocator; + import com.thoughtworks.qdox.model.DocletTag; + import com.thoughtworks.qdox.model.JavaClass; + import com.thoughtworks.qdox.model.JavaField; ++import com.thoughtworks.qdox.model.JavaMember; + import com.thoughtworks.qdox.model.JavaMethod; + import com.thoughtworks.qdox.model.JavaParameter; +-import com.thoughtworks.qdox.model.Member; +-import com.thoughtworks.qdox.model.Type; ++import com.thoughtworks.qdox.model.JavaType; + + /** + * Wrapper for class field or method item with added source information. This wraps the basic class handling +@@ -44,7 +46,7 @@ public class ClassItemSourceWrapper extends ClassItemWrapper + { + private boolean m_checkedSource; + +- private Member m_itemSource; ++ private JavaMember m_itemSource; + + /** + * Constructor +@@ -64,14 +66,16 @@ public class ClassItemSourceWrapper extends ClassItemWrapper + */ + private boolean matchSignature(JavaMethod method) { + boolean match = true; +- JavaParameter[] parms = method.getParameters(); +- if (parms.length == getArgumentCount()) { +- for (int j = 0; j < parms.length; j++) { +- Type ptype = parms[j].getType(); ++ List parms = method.getParameters(); ++ if (parms.size() == getArgumentCount()) { ++ for (int j = 0; j < parms.size(); j++) { ++ JavaType ptype = parms.get(j).getType(); + String type = ptype.getValue(); +- int ndim = ptype.getDimensions(); +- while (ndim-- > 0) { +- type += "[]"; ++ if (ptype instanceof JavaClass) { ++ int ndim = ((JavaClass)ptype).getDimensions(); ++ while (ndim-- > 0) { ++ type += "[]"; ++ } + } + String comp = getArgumentType(j); + if (!comp.equals(type)) { +@@ -90,7 +94,7 @@ public class ClassItemSourceWrapper extends ClassItemWrapper + * + * @return source information + */ +- private Member getItemSource() { ++ private JavaMember getItemSource() { + if (!m_checkedSource) { + m_checkedSource = true; + IClass clas = getContainingClass(); +@@ -101,9 +105,9 @@ public class ClassItemSourceWrapper extends ClassItemWrapper + if (jc != null) { + if (isMethod()) { + String mname = getName(); +- JavaMethod[] methods = jc.getMethods(); +- for (int i = 0; i < methods.length; i++) { +- JavaMethod method = methods[i]; ++ List methods = jc.getMethods(); ++ for (int i = 0; i < methods.size(); i++) { ++ JavaMethod method = methods.get(i); + if (mname.equals(method.getName())) { + if (matchSignature(method)) { + m_itemSource = method; +@@ -142,7 +146,7 @@ public class ClassItemSourceWrapper extends ClassItemWrapper + * @see org.jibx.binding.model.IClassItem#getJavaDoc() + */ + public String getJavaDoc() { +- Member src = getItemSource(); ++ JavaMember src = getItemSource(); + if (src == null) { + return null; + } else if (isMethod()) { +@@ -181,12 +185,12 @@ public class ClassItemSourceWrapper extends ClassItemWrapper + if (isMethod()) { + JavaMethod jm = (JavaMethod)getItemSource(); + if (jm != null) { +- String name = jm.getParameters()[index].getName(); +- DocletTag[] tags = jm.getTagsByName("param"); +- for (int i = 0; i < tags.length; i++) { +- DocletTag tag = tags[i]; +- String[] parms = tag.getParameters(); +- if (parms != null && parms.length > 0 && name.equals(parms[0])) { ++ String name = jm.getParameters().get(index).getName(); ++ List tags = jm.getTagsByName("param"); ++ for (int i = 0; i < tags.size(); i++) { ++ DocletTag tag = tags.get(i); ++ List parms = tag.getParameters(); ++ if (parms != null && parms.size() > 0 && name.equals(parms.get(0))) { + String text = tag.getValue().trim(); + if (text.startsWith(name)) { + text = text.substring(name.length()).trim(); +@@ -210,8 +214,8 @@ public class ClassItemSourceWrapper extends ClassItemWrapper + JavaMethod jm = (JavaMethod)getItemSource(); + String name; + if (jm != null) { +- JavaParameter[] parameters = jm.getParameters(); +- name = parameters[index].getName(); ++ List parameters = jm.getParameters(); ++ name = parameters.get(index).getName(); + } else { + name = super.getParameterName(index); + } +@@ -228,11 +232,11 @@ public class ClassItemSourceWrapper extends ClassItemWrapper + JavaMethod jm = (JavaMethod)getItemSource(); + if (jm != null) { + String name = getExceptions()[index]; +- DocletTag[] tags = jm.getTagsByName("throws"); +- for (int i = 0; i < tags.length; i++) { +- DocletTag tag = tags[i]; +- String[] parms = tag.getParameters(); +- if (parms != null && parms.length > 0 && name.equals(parms[0])) { ++ List tags = jm.getTagsByName("throws"); ++ for (int i = 0; i < tags.size(); i++) { ++ DocletTag tag = tags.get(i); ++ List parms = tag.getParameters(); ++ if (parms != null && parms.size() > 0 && name.equals(parms.get(0))) { + return docText(tag.getValue()); + } + } +--- build/src/org/jibx/custom/classes/ClassSourceLocator.java ++++ build/src/org/jibx/custom/classes/ClassSourceLocator.java +@@ -31,7 +31,7 @@ import org.jibx.binding.classes.ClassFile; + import org.jibx.runtime.JiBXException; + import org.jibx.util.IClass; + +-import com.thoughtworks.qdox.JavaDocBuilder; ++import com.thoughtworks.qdox.JavaProjectBuilder; + import com.thoughtworks.qdox.model.JavaClass; + + /** +@@ -45,7 +45,7 @@ public class ClassSourceLocator implements IClassSourceLocator + private final String[] m_sourcePaths; + + /** Source file parser. */ +- private final JavaDocBuilder m_builder; ++ private final JavaProjectBuilder m_builder; + + /** Set of classes parsed. */ + private final Set m_lookupSet; +@@ -57,7 +57,7 @@ public class ClassSourceLocator implements IClassSourceLocator + */ + public ClassSourceLocator(String[] paths) { + m_sourcePaths = paths; +- m_builder = new JavaDocBuilder(); ++ m_builder = new JavaProjectBuilder(); + m_lookupSet = new HashSet(); + } + +-- +2.1.0 + diff --git a/jibx.spec b/jibx.spec new file mode 100644 index 0000000..583d89b --- /dev/null +++ b/jibx.spec @@ -0,0 +1,92 @@ +%global debug_package %{nil} +%global _version 1_2_6 +Name: jibx +Version: 1.2.6 +Release: 1 +Summary: Framework for binding XML data to Java objects +License: BSD and ASL 1.1 +URL: http://sourceforge.net/projects/jibx/ +Source0: http://sourceforge.net/projects/jibx/files/jibx/jibx-%{version}/%{name}_%{_version}.zip +Patch0: %{name}-classpath.patch +Patch1: %{name}-1.2.6-poms.patch +Patch2: %{name}-port-to-qdox-2.patch +BuildRequires: ant ant-junit junit objectweb-asm3 bcel bea-stax-api +BuildRequires: eclipse-equinox-osgi >= 1:4.6.0 eclipse-jdt >= 1:4.6.0 +BuildRequires: eclipse-platform >= 1:4.6.0 joda-time qdox dom4j jdom xpp3 log4j12 +BuildRequires: javapackages-local +%description +JiBX is a framework for binding XML data to Java objects. It lets you +work with data from XML documents using your own class structures. + +%package javadoc +Summary: Javadoc for %{name} +%description javadoc +This package contains the API documentation for %{name}. + +%prep +%setup -q -n %{name} +%patch0 -p1 +%patch1 -p1 +%patch2 -p0 +find -name '*.class' -delete +find -name '*.jar' -delete +rm -rf %{_builddir}/%{name}/build/docs/src/* +%global _eclipsedir %{_prefix}/lib/eclipse +plugin_file=`ls %{_eclipsedir}/plugins/org.eclipse.core.contenttype_*.jar` +ln -s "$plugin_file" lib/org.eclipse.core.contenttype.jar +plugin_file=`ls %{_eclipsedir}/plugins/org.eclipse.core.jobs_*.jar` +ln -s "$plugin_file" lib/org.eclipse.core.jobs.jar +plugin_file=`ls %{_eclipsedir}/plugins/org.eclipse.core.runtime_*.jar` +ln -s "$plugin_file" lib/org.eclipse.core.runtime.jar +plugin_file=`ls %{_eclipsedir}/plugins/org.eclipse.core.resources_*.jar` +ln -s "$plugin_file" lib/org.eclipse.core.resources.jar +plugin_file=`ls %{_eclipsedir}/plugins/org.eclipse.equinox.common_*.jar` +ln -s "$plugin_file" lib/org.eclipse.equinox.common.jar +plugin_file=`ls %{_eclipsedir}/plugins/org.eclipse.equinox.preferences_*.jar` +ln -s "$plugin_file" lib/org.eclipse.equinox.preferences.jar +plugin_file=`ls %{_eclipsedir}/plugins/org.eclipse.text_*.jar` +ln -s "$plugin_file" lib/org.eclipse.text.jar +plugin_file=`ls %{_datadir}/eclipse/droplets/eclipse-jdt/plugins/org.eclipse.jdt.core_*jar` +ln -s "$plugin_file" lib/org.eclipse.jdt.core.jar +ln -s $(build-classpath eclipse/osgi) lib/org.eclipse.osgi.jar +plugin_file=`ls %{_datadir}/eclipse/droplets/eclipse-jdt/plugins/org.eclipse.jdt.core.manipulation_*.jar` +ln -s "$plugin_file" lib/org.eclipse.jdt.core.manipulation.jar +build-jar-repository -p lib \ +bcel \ +bea-stax-api \ +dom4j \ +jdom \ +joda-time \ +qdox \ +xpp3 +ln -s $(build-classpath objectweb-asm3/asm) lib/ +ln -s $(build-classpath objectweb-asm3/asm-commons) lib/ +ln -s $(build-classpath log4j12-1.2.17) lib/ +sed -i '/Class-Path/I d' %{_builddir}/%{name}/build/build.xml +%pom_change_dep :log4j ::1.2.17 build/maven/jibx-bind/pom.xml + +%build +for sub_component in bind extras run schema tools; do +%mvn_file org.%{name}:%{name}-${sub_component} %{name}/${sub_component} +done +pushd build/ +sed -i -e s:stax-api.jar:bea-stax-api.jar:g build.xml +sed -i 's|version}" arg2="1.5"|version}" arg2="1.8"|g' build.xml +javac jenable/JEnable.java +export CLASSPATH=$(build-classpath junit) +ant current -Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 devdoc + +%install +%mvn_artifact build/maven/pom.xml +for sub_component in bind extras run schema tools; do +%mvn_artifact build/maven/jibx-${sub_component}/pom.xml lib/%{name}-${sub_component}.jar +done +%mvn_install -J %{_builddir}/%{name}/build/api + +%files -f .mfiles + +%files javadoc -f .mfiles-javadoc + +%changelog +* Mon Aug 10 2020 chengzihan - 1.2.6-1 +- Package init diff --git a/jibx.yaml b/jibx.yaml new file mode 100644 index 0000000..82a1d49 --- /dev/null +++ b/jibx.yaml @@ -0,0 +1,4 @@ +version_control: git +src_repo: https://git.code.sf.net/p/jibx/code +tag_prefix: "jibx-" +seperator: "." diff --git a/jibx_1_2_6.zip b/jibx_1_2_6.zip new file mode 100644 index 0000000..b76d260 Binary files /dev/null and b/jibx_1_2_6.zip differ