Skip to content

Commit

Permalink
Replace google-collections with guava, and build as a static library.
Browse files Browse the repository at this point in the history
Google-collections was masquerading as guava-libraries.  Replace it with
guava itself (which is a superset).  All of this change except Android.mk
(and README.android) is an import of the open source guava package, don't
feel obligated to review the code directly :)
  • Loading branch information
egnor committed Mar 5, 2010
1 parent 8f54683 commit bfe2dd0
Show file tree
Hide file tree
Showing 825 changed files with 65,219 additions and 55,011 deletions.
15 changes: 7 additions & 8 deletions Android.mk
@@ -1,4 +1,4 @@
# Copyright (C) 2009 The Android Open Source Project
# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -11,17 +11,16 @@
# 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.
#
#

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_MODULE := guava
LOCAL_SDK_VERSION := current
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_STATIC_JAVA_LIBRARIES := jsr305

LOCAL_JAVA_LIBRARIES := jsr305

include $(BUILD_JAVA_LIBRARY)
include $(BUILD_STATIC_JAVA_LIBRARY)

# Include this library in the build server's output directory
$(call dist-for-goals, droid, $(LOCAL_BUILT_MODULE):guava.jar)
15 changes: 7 additions & 8 deletions README.android
@@ -1,11 +1,10 @@
URL: http://code.google.com/p/google-collections/
Version: r127
URL: http://code.google.com/p/guava-libraries/source/checkout
Version: r11
License: Apache 2
Description: "Google Collections Library". Multimap, immutable collections, etc.
Description: "Guava: Google Core Libraries for Java 1.5"
Local Modifications: No local modifications

This project will eventually hold Guava-libraries, a superset of Google
Collections.

This APIs in this library are not included on the device. They may, however, be
included in test cases etc.
Guava-libraries are a grab bag of utility libraries published by Google as
open source, including among other things the Google collections libraries.

This code is built as a static library.
7 changes: 0 additions & 7 deletions build.properties

This file was deleted.

186 changes: 28 additions & 158 deletions build.xml
@@ -1,186 +1,56 @@
<?xml version="1.0"?>

<!--
You must:
* have JAVA_HOME set to a recent JDK 6 installation
* have JAVA5_HOME set to a JDK 1.5.0 (_0) installation
* have unzipped $JAVA_HOME/src.zip to $JAVA_HOME/src
* specify -Dversion=1.0-rc1 (for example) on the ant command line
-->

<project name="google-collections" default="compile">

<property environment="env"/>
<property file="build.properties"/>
<project name="guava" default="compile">

<!-- can be overridden at the command line with -Dversion=
or in IDEA, in the ant properties dialog -->
<property name="version" value="snapshot"/>

<target name="compile" description="Compile Java source.">
<mkdir dir="${build.dir}/classes"/>
<javac
srcdir="${src.dir}"
destdir="${build.dir}/classes"
debug="on"
target="1.5"
bootclasspath="${env.JAVA5_HOME}/lib/rt.jar"
extdirs=""
>
<compilerarg value="-Xlint:all"/>
<classpath>
<pathelement location="${lib.dir}/jsr305.jar"/>
</classpath>
</javac>

<!-- uncomment when GWT support is official
<javac
srcdir="${gwt.dir}"
destdir="${build.dir}/classes"
debug="on"
target="1.5"
bootclasspath="${env.JAVA5_HOME}/lib/rt.jar"
extdirs=""
>
<include name="${gwt.serializers}"/>
<compilerarg value="-Xlint:all"/>
<mkdir dir="build/classes"/>

<property environment="env"/>
<property name="java5bootclasspath" value="${env.JAVA5_HOME}/jre/lib/rt.jar"/>

<available file="${java5bootclasspath}" property="isJava5HomeSetRight"/>
<fail unless="isJava5HomeSetRight"
message="JAVA5_HOME must be set to a valid JDK 1.5 installation, containing a jre/lib/rt.jar file"/>

<!-- why does this still allow @Override on interface impl? -->
<javac srcdir="src"
debug="on"
destdir="build/classes"
source="1.5"
target="1.5"
bootclasspath="${java5bootclasspath}"
extdirs="">
<classpath>
<pathelement location="${build.dir}/dist/google-collect-${version}/google-collect-${version}.jar"/>
<pathelement location="${lib.dir}/jsr305.jar"/>
<pathelement location="${lib.dir}/gwt-servlet.jar"/>
<pathelement location="lib/jsr305.jar"/>
</classpath>
</javac>
-->
</target>

<target name="testfw" description="Compile test framework.">
<mkdir dir="${build.dir}/testfwclasses"/>
<javac
srcdir="${testfw.dir}"
destdir="${build.dir}/testfwclasses"
debug="on"
target="1.5"
bootclasspath="${env.JAVA5_HOME}/lib/rt.jar"
extdirs=""
>
<compilerarg value="-Xlint:all"/>
<classpath>
<pathelement location="${lib.dir}/junit.jar"/>
</classpath>
</javac>
</target>

<target name="test.compile"
depends="dist,testfw"
description="Compile test source.">
<mkdir dir="${build.dir}/test"/>
<javac srcdir="${test.dir}"
destdir="${build.dir}/test"
debug="on"
>
<compilerarg value="-Xlint:all"/>
<classpath>
<pathelement location="${build.dir}/dist/google-collect-${version}/google-collect-${version}.jar"/>
<pathelement location="${build.dir}/testfwclasses"/>
<pathelement location="${lib.dir}/junit.jar"/>
<pathelement location="${lib.dir}/tl4j-1.1.0.jar"/>
<pathelement location="${lib.dir}/jsr305.jar"/>
<pathelement location="${lib.dir}/easymock-2.4.jar"/>
<pathelement location="${lib.dir}/easymockclassextension-2.4.jar"/>
</classpath>
</javac>
</target>

<target name="test"
depends="test.compile"
description="Execute JUnit tests.">
<java fork="true"
classname="junit.textui.TestRunner"
failonerror="true"
taskname="junit">
<classpath>
<pathelement location="${build.dir}/test"/>
<pathelement location="${build.dir}/dist/google-collect-${version}/google-collect-${version}.jar"/>
<pathelement location="${build.dir}/testfwclasses"/>
<pathelement location="${lib.dir}/junit.jar"/>
<pathelement location="${lib.dir}/tl4j-1.1.0.jar"/>
<pathelement location="${lib.dir}/jsr305.jar"/>
<pathelement location="${lib.dir}/easymock-2.4.jar"/>
<pathelement location="${lib.dir}/easymockclassextension-2.4.jar"/>
<pathelement location="${lib.dir}/cglib-nodep-2.2.jar"/>
</classpath>
<arg value="com.google.common.collect.CollectTestSuite"/>
</java>
</target>

<target name="clean"
description="Remove generated files.">
<delete dir="${build.dir}"/>
</target>

<target name="jar" depends="compile" description="Build jars.">
<mkdir dir="${build.dir}/dist/google-collect-${version}"/>
<jar jarfile="${build.dir}/dist/google-collect-${version}/google-collect-${version}.jar">
<fileset dir="${build.dir}/classes"/>
</jar>
</target>

<target name="jargwt" description="Build GWT jar.">
<mkdir dir="${build.dir}/dist/google-collect-${version}"/>
<jar jarfile="${build.dir}/dist/google-collect-${version}/google-collect-gwt-${version}.jar">
<fileset dir="${gwt.dir}"/>
<fileset dir="${src.dir}">
<and>
<contains text="@GwtCompatible"/>
<not>
<contains text="emulated = true"/>
</not>
</and>
</fileset>
</jar>
</target>

<target name="jarsrc" description="Build jar of source.">
<mkdir dir="${build.dir}/dist/google-collect-${version}"/>
<jar jarfile="${build.dir}/dist/google-collect-${version}/src-${version}.zip">
<fileset dir="${src.dir}"/>
<!-- uncomment when GWT support is official
<fileset dir="${gwt.dir}">
<include name="${gwt.serializers}"/>
</fileset>
-->
</jar>
</target>

<target name="dist" depends="jar, jarsrc, javadoc"
description="Build entire distribution.">
<copy toDir="${build.dir}/dist/google-collect-${version}" file="COPYING"/>
<copy toDir="${build.dir}/dist/google-collect-${version}">
<fileset dir="${build.dir}" includes="javadoc/**/*"/>
</copy>

<zip destfile="${build.dir}/google-collect-${version}.zip"
basedir="${build.dir}/dist"/>
<delete dir="build"/>
</target>

<target name="javadoc"
description="Generate Javadocs.">
<delete dir="${build.dir}/javadoc"/>
<mkdir dir="${build.dir}/javadoc"/>
<javadoc packagenames="com.google.common.annotations,com.google.common.base,com.google.common.collect"
destdir="${build.dir}/javadoc"
<delete dir="build/javadoc"/>
<mkdir dir="build/javadoc"/>
<javadoc packagenames="com.google.common.annotations,com.google.common.base,com.google.common.collect,com.google.common.io,com.google.common.primitives,com.google.common.util.concurrent"
destdir="build/javadoc"
use="true"
author="true"
protected="true"
windowtitle="Google Collections Library ${version}">
windowtitle="Guava Libraries ${version}">
<sourcepath>
<pathelement location="${src.dir}"/>
<pathelement location="${env.JAVA_HOME}/src"/>
<pathelement location="src"/>
</sourcepath>
<!-- workaround for http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6442982 -->
<classpath>
<pathelement location="${lib.dir}/jsr305.jar"/>
<pathelement location="lib/jsr305.jar"/>
</classpath>
<link href="http://jsr-305.googlecode.com/svn/trunk/javadoc"/>
<link href="http://java.sun.com/javase/6/docs/api"/>
Expand Down
4 changes: 2 additions & 2 deletions google-collect.iml → guava.iml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module relativePaths="true" type="JAVA_MODULE" version="4">
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/src">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
Expand Down

0 comments on commit bfe2dd0

Please sign in to comment.