From 9baa24c347126c6fa1279faebed9849f95d8aedf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Manuel=20Carrasco=20Mo=C3=B1ino?= Date: Mon, 1 Jul 2013 17:20:36 +0200 Subject: [PATCH] Remove stuff to compile gquery for old gwt versions. Last gquery does not compiles for old versions. --- gwtquery-core-2.0.1/pom.xml | 181 ------------ .../google/gwt/core/client/JsArrayMixed.java | 269 ------------------ .../query/linker/IFrameWithDocTypeLinker.java | 44 --- .../rebind/SelectorGeneratorCssToXPath.java | 112 -------- gwtquery-core-2.1.0/pom.xml | 180 ------------ 5 files changed, 786 deletions(-) delete mode 100644 gwtquery-core-2.0.1/pom.xml delete mode 100644 gwtquery-core-2.0.1/src/main/java/com/google/gwt/core/client/JsArrayMixed.java delete mode 100644 gwtquery-core-2.0.1/src/main/java/com/google/gwt/query/linker/IFrameWithDocTypeLinker.java delete mode 100644 gwtquery-core-2.0.1/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorCssToXPath.java delete mode 100644 gwtquery-core-2.1.0/pom.xml diff --git a/gwtquery-core-2.0.1/pom.xml b/gwtquery-core-2.0.1/pom.xml deleted file mode 100644 index 7cc05d7e..00000000 --- a/gwtquery-core-2.0.1/pom.xml +++ /dev/null @@ -1,181 +0,0 @@ - - - 4.0.0 - - com.googlecode.gwtquery - gwtquery-project - 1.4.0-SNAPSHOT - - - Generates an artifact compiled with a concrete gwt version specified in the artifactId - 2.0.1 - jar - Gwt Query Core API for gwt-${artifactId} - - - - com.googlecode.gwtquery - gwtquery - ${version} - provided - - - com.google.gwt - gwt-user - ${artifactId} - provided - - - com.google.gwt - gwt-dev - ${artifactId} - provided - - - - - gwtquery-${version}-${artifactId} - - - - maven-deploy-plugin - - true - - - - - maven-gpg-plugin - - - deploy-jar - deploy - - sign-and-deploy-file - - - ${project.build.directory}/gwtquery-${version}-${artifactId}.jar - ${repoId} - ${repoUrl} - jar - gwtquery - ${groupId} - ${version} - ${artifactId} - ./target/generated-resources/META-INF/maven/com.googlecode.gwtquery/gwtquery/pom.xml - - - - deploy-src - deploy - - sign-and-deploy-file - - - ${project.build.directory}/gwtquery-${version}-${artifactId}-sources.jar - ${repoId} - ${repoUrl} - jar - gwtquery - ${groupId} - ${version} - ${artifactId}-sources - ./target/generated-resources/META-INF/maven/com.googlecode.gwtquery/gwtquery/pom.xml - - - - deploy-doc - deploy - - sign-and-deploy-file - - - ${project.build.directory}/gwtquery-${version}-${artifactId}-javadoc.jar - ${repoId} - ${repoUrl} - jar - gwtquery - ${groupId} - ${version} - ${artifactId}-javadoc - ./target/generated-resources/META-INF/maven/com.googlecode.gwtquery/gwtquery/pom.xml - - - - - - - maven-dependency-plugin - - - unpack-dependencies - generate-resources - - com.googlecode.gwtquery,com.googlecode.gwtquery.plugins - gwtquery - true - **/*.java,**/*.xml,**/*.html,**/*.css,**/*.jpg,**/*.png,**/*.gif - **/IFrameWithDocTypeLinker.java,**/SelectorGeneratorCssToXPath.java - ${project.build.directory}/generated-resources - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - javadoc - prepare-package - - jar - - - - - - - org.apache.maven.plugins - maven-source-plugin - - - source - prepare-package - - jar - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-sources - generate-sources - - add-source - - - - ${project.build.directory}/generated-resources - - - - - - - - - - - ${project.build.directory}/generated-resources/ - - - - - diff --git a/gwtquery-core-2.0.1/src/main/java/com/google/gwt/core/client/JsArrayMixed.java b/gwtquery-core-2.0.1/src/main/java/com/google/gwt/core/client/JsArrayMixed.java deleted file mode 100644 index 0639f8d9..00000000 --- a/gwtquery-core-2.0.1/src/main/java/com/google/gwt/core/client/JsArrayMixed.java +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Copyright 2010 Google Inc. - * - * Licensed 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 com.google.gwt.core.client; - -/** - * A simple wrapper around an heterogeneous native array of values. - * - * This class may not be directly instantiated, and can only be returned from a - * native method. For example, - * - * - * native JsArrayMixed getNativeArray() /*-{ - * return [ - * { x: 0, y: 1}, - * "apple", - * 12345, - * ]; - * }-* /; - * - */ -public class JsArrayMixed extends JavaScriptObject { - - protected JsArrayMixed() { - } - - /** - * Gets the boolean at a given index. - * - * @param index the index to be retrieved - * @return the object at the given index, or null if none exists - */ - public final native boolean getBoolean(int index) /*-{ - return Boolean(this[index]); - }-*/; - - /** - * Gets the double at a given index. - * - * @param index the index to be retrieved - * @return the object at the given index, or null if none exists - */ - public final native double getNumber(int index) /*-{ - return Number(this[index]); - }-*/; - - /** - * Gets the {@link JavaScriptObject} at a given index. - * - * @param index the index to be retrieved - * @return the {@code JavaScriptObject} at the given index, or - * null if none exists - */ - public final native T getObject(int index) /*-{ - return this[index] != null ? Object(this[index]) : null; - }-*/; - - /** - * Gets the String at a given index. - * - * @param index the index to be retrieved - * @return the object at the given index, or null if none exists - */ - public final native String getString(int index) /*-{ - return String(this[index]); - }-*/; - - /** - * Convert each element of the array to a String and join them with a comma - * separator. The value returned from this method may vary between browsers - * based on how JavaScript values are converted into strings. - */ - public final String join() { - // As per JS spec - return join(","); - } - - /** - * Convert each element of the array to a String and join them with a comma - * separator. The value returned from this method may vary between browsers - * based on how JavaScript values are converted into strings. - */ - public final native String join(String separator) /*-{ - return this.join(separator); - }-*/; - - /** - * Gets the length of the array. - * - * @return the array length - */ - public final native int length() /*-{ - return this.length; - }-*/; - - /** - * Pushes the given boolean onto the end of the array. - */ - public final native void push(boolean value) /*-{ - this[this.length] = value; - }-*/; - - /** - * Pushes the given double onto the end of the array. - */ - public final native void push(double value) /*-{ - this[this.length] = value; - }-*/; - - /** - * Pushes the given {@link JavaScriptObject} onto the end of the array. - */ - public final native void push(JavaScriptObject value) /*-{ - this[this.length] = value; - }-*/; - - /** - * Pushes the given String onto the end of the array. - */ - public final native void push(String value) /*-{ - this[this.length] = value; - }-*/; - - /** - * Sets the boolean value at a given index. - * - * If the index is out of bounds, the value will still be set. The array's - * length will be updated to encompass the bounds implied by the added value. - * - * @param index the index to be set - * @param value the boolean to be stored - */ - public final native void set(int index, boolean value) /*-{ - this[index] = value; - }-*/; - - /** - * Sets the double value at a given index. - * - * If the index is out of bounds, the value will still be set. The array's - * length will be updated to encompass the bounds implied by the added value. - * - * @param index the index to be set - * @param value the double to be stored - */ - public final native void set(int index, double value) /*-{ - this[index] = value; - }-*/; - - /** - * Sets the object value at a given index. - * - * If the index is out of bounds, the value will still be set. The array's - * length will be updated to encompass the bounds implied by the added object. - * - * @param index the index to be set - * @param value the {@link JavaScriptObject} to be stored - */ - public final native void set(int index, JavaScriptObject value) /*-{ - this[index] = value; - }-*/; - - /** - * Sets the String value at a given index. - * - * If the index is out of bounds, the value will still be set. The array's - * length will be updated to encompass the bounds implied by the added String. - * - * @param index the index to be set - * @param value the String to be stored - */ - public final native void set(int index, String value) /*-{ - this[index] = value; - }-*/; - - /** - * Reset the length of the array. - * - * @param newLength the new length of the array - */ - public final native void setLength(int newLength) /*-{ - this.length = newLength; - }-*/; - - /** - * Shifts the first value off the array. - * - * @return the shifted boolean - */ - public final native boolean shiftBoolean() /*-{ - return Boolean(this.shift()); - }-*/; - - /** - * Shifts the first value off the array. - * - * @return the shifted double - */ - public final native double shiftNumber() /*-{ - return Number(this.shift()); - }-*/; - - /** - * Shifts the first value off the array. - * - * @return the shifted {@link JavaScriptObject} - */ - public final native T shiftObject() /*-{ - return Object(this.shift()); - }-*/; - - /** - * Shifts the first value off the array. - * - * @return the shifted String - */ - public final native String shiftString() /*-{ - return String(this.shift()); - }-*/; - - /** - * Shifts a boolean onto the beginning of the array. - * - * @param value the value to the stored - */ - public final native void unshift(boolean value) /*-{ - this.unshift(value); - }-*/; - - /** - * Shifts a double onto the beginning of the array. - * - * @param value the value to store - */ - public final native void unshift(double value) /*-{ - this.unshift(value); - }-*/; - - /** - * Shifts a {@link JavaScriptObject} onto the beginning of the array. - * - * @param value the value to store - */ - public final native void unshift(JavaScriptObject value) /*-{ - this.unshift(value); - }-*/; - - /** - * Shifts a String onto the beginning of the array. - * - * @param value the value to store - */ - public final native void unshift(String value) /*-{ - this.unshift(value); - }-*/; - -} diff --git a/gwtquery-core-2.0.1/src/main/java/com/google/gwt/query/linker/IFrameWithDocTypeLinker.java b/gwtquery-core-2.0.1/src/main/java/com/google/gwt/query/linker/IFrameWithDocTypeLinker.java deleted file mode 100644 index a1bbf53f..00000000 --- a/gwtquery-core-2.0.1/src/main/java/com/google/gwt/query/linker/IFrameWithDocTypeLinker.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2009 Google Inc. - * - * Licensed 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 com.google.gwt.query.linker; - -import com.google.gwt.core.ext.LinkerContext; -import com.google.gwt.core.ext.TreeLogger; -import com.google.gwt.core.linker.IFrameLinker; -import com.google.gwt.core.ext.linker.LinkerOrder; - -/** - * Adds doctype to the iframe used to load the application. - * Without this code, IE8 does not enable document.querySelectorAll feature. - */ -@LinkerOrder(LinkerOrder.Order.PRIMARY) -public class IFrameWithDocTypeLinker extends IFrameLinker { - - private static final String DOCTYPE = "\n"; - - protected String getModulePrefix(TreeLogger logger, LinkerContext context, - String strongName) { - return DOCTYPE + super.getModulePrefix(logger, context, strongName); - } - - @Override - protected String getModulePrefix(TreeLogger logger, LinkerContext context, - String strongName, int numFragments) { - return DOCTYPE - + super.getModulePrefix(logger, context, strongName, numFragments); - } -} - diff --git a/gwtquery-core-2.0.1/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorCssToXPath.java b/gwtquery-core-2.0.1/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorCssToXPath.java deleted file mode 100644 index 688a6042..00000000 --- a/gwtquery-core-2.0.1/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorCssToXPath.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2011, The gwtquery team. - * - * Licensed 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 com.google.gwt.query.rebind; - -import java.util.ArrayList; -import java.util.regex.MatchResult; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; - -import com.google.gwt.core.ext.TreeLogger; -import com.google.gwt.core.ext.UnableToCompleteException; -import com.google.gwt.core.ext.typeinfo.JMethod; -import com.google.gwt.query.client.Selector; -import com.google.gwt.query.client.impl.SelectorEngineCssToXPath; -import com.google.gwt.query.client.impl.SelectorEngineCssToXPath.ReplaceCallback; -import com.google.gwt.query.client.impl.SelectorEngineCssToXPath.Replacer; -import com.google.gwt.user.rebind.SourceWriter; - -/** - * Compile time selector generator which translates selector into XPath at - * compile time. It Uses the SelectorEngineCssToXpath to produce the xpath - * selectors - */ -public class SelectorGeneratorCssToXPath extends SelectorGeneratorBase { - - /** - * The replacer implementation for the JVM. - */ - public static final Replacer replacerJvm = new Replacer() { - public String replaceAll(String s, String r, Object o) { - Pattern p = Pattern.compile(r); - if (o instanceof ReplaceCallback) { - final Matcher matcher = p.matcher(s); - ReplaceCallback callback = (ReplaceCallback) o; - while (matcher.find()) { - final MatchResult matchResult = matcher.toMatchResult(); - ArrayList argss = new ArrayList(); - for (int i = 0; i < matchResult.groupCount() + 1; i++) { - argss.add(matchResult.group(i)); - } - final String replacement = callback.foundMatch(argss); - s = s.substring(0, matchResult.start()) + replacement - + s.substring(matchResult.end()); - matcher.reset(s); - } - return s; - } else { - return p.matcher(s).replaceAll(o.toString()); - } - } - }; - - public static final Replacer replacer = replacerJvm; - - private SelectorEngineCssToXPath engine = new SelectorEngineCssToXPath( - replacer); - - protected String css2Xpath(String s) { - return engine.css2Xpath(s); - } - - private XPathFactory factory = XPathFactory.newInstance(); - private XPath xpath = factory.newXPath(); - - protected void generateMethodBody(SourceWriter sw, JMethod method, - TreeLogger treeLogger, boolean hasContext) - throws UnableToCompleteException { - - String selector = method.getAnnotation(Selector.class).value(); - String xselector = css2Xpath(selector); - - // Validate the generated xpath selector. - try { - validateXpath(xselector); - } catch (XPathExpressionException e1) { - System.err.println("Invalid XPath generated selector, please revise it: " + xselector); - if (!selector.equals(xselector)) { - System.err.println("If your css2 selector syntax is correct, open an issue in the gwtquery project. cssselector:" - + selector + " xpath:" + xselector); - } - throw new UnableToCompleteException(); - } - - sw.println("return " - + wrap(method, "xpathEvaluate(\"" + xselector + "\", root)") + ";"); - } - - public void validateXpath(String xselector) throws XPathExpressionException { - xpath.compile(xselector); - } - - protected String getImplSuffix() { - return "CssToXPath" + super.getImplSuffix(); - } -} diff --git a/gwtquery-core-2.1.0/pom.xml b/gwtquery-core-2.1.0/pom.xml deleted file mode 100644 index 50f1bf36..00000000 --- a/gwtquery-core-2.1.0/pom.xml +++ /dev/null @@ -1,180 +0,0 @@ - - - 4.0.0 - - com.googlecode.gwtquery - gwtquery-project - 1.4.0-SNAPSHOT - - - Generates an artifact compiled with a concrete gwt version specified in the artifactId - 2.1.0 - jar - Gwt Query Core API for gwt-${artifactId} - - - - com.googlecode.gwtquery - gwtquery - ${version} - provided - - - com.google.gwt - gwt-user - ${artifactId} - provided - - - com.google.gwt - gwt-dev - ${artifactId} - provided - - - - - gwtquery-${version}-${artifactId} - - - - maven-deploy-plugin - - true - - - - - maven-gpg-plugin - - - deploy-jar - deploy - - sign-and-deploy-file - - - ${project.build.directory}/gwtquery-${version}-${artifactId}.jar - ${repoId} - ${repoUrl} - jar - gwtquery - ${groupId} - ${version} - ${artifactId} - ./target/generated-resources/META-INF/maven/com.googlecode.gwtquery/gwtquery/pom.xml - - - - deploy-src - deploy - - sign-and-deploy-file - - - ${project.build.directory}/gwtquery-${version}-${artifactId}-sources.jar - ${repoId} - ${repoUrl} - jar - gwtquery - ${groupId} - ${version} - ${artifactId}-sources - ./target/generated-resources/META-INF/maven/com.googlecode.gwtquery/gwtquery/pom.xml - - - - deploy-doc - deploy - - sign-and-deploy-file - - - ${project.build.directory}/gwtquery-${version}-${artifactId}-javadoc.jar - ${repoId} - ${repoUrl} - jar - gwtquery - ${groupId} - ${version} - ${artifactId}-javadoc - ./target/generated-resources/META-INF/maven/com.googlecode.gwtquery/gwtquery/pom.xml - - - - - - - maven-dependency-plugin - - - unpack-dependencies - generate-resources - - com.googlecode.gwtquery,com.googlecode.gwtquery.plugins - gwtquery - true - **/*.java,**/*.xml,**/*.html,**/*.css,**/*.jpg,**/*.png,**/*.gif - ${project.build.directory}/generated-resources - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - javadoc - prepare-package - - jar - - - - - - - org.apache.maven.plugins - maven-source-plugin - - - source - prepare-package - - jar - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-sources - generate-sources - - add-source - - - - ${project.build.directory}/generated-resources - - - - - - - - - - - ${project.build.directory}/generated-resources/ - - - - - -- 2.39.5