Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 919c256

Browse files
committed
Separate Java and Android builds
1 parent 166be4a commit 919c256

File tree

5 files changed

+158
-20
lines changed

5 files changed

+158
-20
lines changed

android/pom.xml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?xml version="1.0"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<!-- Inherit from ../pom.xml -->
6+
<parent>
7+
<groupId>com.firebase</groupId>
8+
<artifactId>geofire</artifactId>
9+
<version>2.0.0-SNAPSHOT</version>
10+
<relativePath>../</relativePath>
11+
</parent>
12+
13+
<artifactId>geofire-android</artifactId>
14+
<packaging>aar</packaging>
15+
16+
<name>geofire-android</name>
17+
<description>GeoFire is an open-source library for Android/Java that allows you to store and query a set of keys based on their geographic location.</description>
18+
<organization>
19+
<name>Firebase</name>
20+
<url>https://www.firebase.com/</url>
21+
</organization>
22+
<url>https://github.com/firebase/geofire-java</url>
23+
<scm>
24+
<connection>scm:git:[email protected]:firebase/geofire-java.git</connection>
25+
<developerConnection>scm:git:[email protected]:firebase/geofire-java.git</developerConnection>
26+
<url>https://github.com/firebase/geofire-java</url>
27+
</scm>
28+
<licenses>
29+
<license>
30+
<name>MIT</name>
31+
<url>http://firebase.mit-license.org</url>
32+
</license>
33+
</licenses>
34+
<properties>
35+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
36+
</properties>
37+
<build>
38+
<sourceDirectory>../src/main/java</sourceDirectory>
39+
<plugins>
40+
<plugin>
41+
<groupId>com.simpligility.maven.plugins</groupId>
42+
<artifactId>android-maven-plugin</artifactId>
43+
<version>4.3.0</version> <!-- use latest release -->
44+
<extensions>true</extensions>
45+
</plugin>
46+
</plugins>
47+
</build>
48+
<repositories>
49+
<repository>
50+
<id>google-extras</id>
51+
<url>file://${env.ANDROID_HOME}/extras/google/m2repository</url>
52+
</repository>
53+
<repository>
54+
<id>android-extras</id>
55+
<url>file://${env.ANDROID_HOME}/extras/android/m2repository</url>
56+
</repository>
57+
</repositories>
58+
<dependencies>
59+
<dependency>
60+
<groupId>com.google.firebase</groupId>
61+
<artifactId>firebase-database</artifactId>
62+
<version>[9.0.2,)</version>
63+
<scope>provided</scope>
64+
<type>aar</type>
65+
</dependency>
66+
<dependency>
67+
<groupId>com.google.android</groupId>
68+
<artifactId>android</artifactId>
69+
<version>2.2.1</version>
70+
<scope>provided</scope>
71+
</dependency>
72+
<dependency>
73+
<groupId>junit</groupId>
74+
<artifactId>junit</artifactId>
75+
<version>4.8.1</version>
76+
<scope>test</scope>
77+
</dependency>
78+
</dependencies>
79+
</project>

android/src/main/AndroidManifest.xml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.firebase.geofire">
2+
<uses-sdk
3+
android:minSdkVersion="9"
4+
android:targetSdkVersion="24" />
5+
6+
<uses-permission android:name="android.permission.INTERNET" />
7+
</manifest>

java/pom.xml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<!-- Inherit from ../pom.xml -->
6+
<parent>
7+
<groupId>com.firebase</groupId>
8+
<artifactId>geofire</artifactId>
9+
<version>2.0.0-SNAPSHOT</version>
10+
<relativePath>../</relativePath>
11+
</parent>
12+
13+
<artifactId>geofire-java</artifactId>
14+
<packaging>jar</packaging>
15+
16+
<name>geofire-java</name>
17+
<description>GeoFire is an open-source library for Android/Java that allows you to store and query a set of keys based on their geographic location.</description>
18+
<organization>
19+
<name>Firebase</name>
20+
<url>https://www.firebase.com/</url>
21+
</organization>
22+
<url>https://github.com/firebase/geofire-java</url>
23+
<scm>
24+
<connection>scm:git:[email protected]:firebase/geofire-java.git</connection>
25+
<developerConnection>scm:git:[email protected]:firebase/geofire-java.git</developerConnection>
26+
<url>https://github.com/firebase/geofire-java</url>
27+
</scm>
28+
<licenses>
29+
<license>
30+
<name>MIT</name>
31+
<url>http://firebase.mit-license.org</url>
32+
</license>
33+
</licenses>
34+
<properties>
35+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
36+
</properties>
37+
<build>
38+
<!-- Plugins inherited -->
39+
</build>
40+
<dependencies>
41+
<dependency>
42+
<groupId>com.google.firebase</groupId>
43+
<artifactId>firebase-server-sdk</artifactId>
44+
<version>[3.0.0,)</version>
45+
<scope>provided</scope>
46+
</dependency>
47+
<dependency>
48+
<groupId>com.google.android</groupId>
49+
<artifactId>android</artifactId>
50+
<version>2.2.1</version>
51+
<scope>provided</scope>
52+
</dependency>
53+
<dependency>
54+
<groupId>junit</groupId>
55+
<artifactId>junit</artifactId>
56+
<version>4.8.1</version>
57+
<scope>test</scope>
58+
</dependency>
59+
</dependencies>
60+
</project>

pom.xml

+10-19
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?xml version="1.0"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
4+
45
<groupId>com.firebase</groupId>
56
<artifactId>geofire</artifactId>
67
<version>2.0.0-SNAPSHOT</version>
7-
<packaging>jar</packaging>
8+
<packaging>pom</packaging>
9+
810
<name>geofire</name>
911
<description>GeoFire is an open-source library for Android/Java that allows you to store and query a set of keys based on their geographic location.</description>
1012
<organization>
@@ -31,6 +33,12 @@
3133
<properties>
3234
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3335
</properties>
36+
37+
<modules>
38+
<module>android</module>
39+
<module>java</module>
40+
</modules>
41+
3442
<build>
3543
<plugins>
3644
<plugin>
@@ -77,23 +85,6 @@
7785
</plugins>
7886
</build>
7987
<dependencies>
80-
<dependency>
81-
<groupId>com.google.firebase</groupId>
82-
<artifactId>firebase-server-sdk</artifactId>
83-
<version>[3.0.0,)</version>
84-
<scope>provided</scope>
85-
</dependency>
86-
<dependency>
87-
<groupId>com.google.android</groupId>
88-
<artifactId>android</artifactId>
89-
<version>2.2.1</version>
90-
<scope>provided</scope>
91-
</dependency>
92-
<dependency>
93-
<groupId>junit</groupId>
94-
<artifactId>junit</artifactId>
95-
<version>4.8.1</version>
96-
<scope>test</scope>
97-
</dependency>
88+
<!-- Dependencies defined in child POMs -->
9889
</dependencies>
9990
</project>

src/main/java/com/firebase/geofire/GeoFire.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import com.google.firebase.database.ValueEventListener;
3636
import com.google.firebase.database.GenericTypeIndicator;
3737

38+
import java.lang.Throwable;
3839
import java.util.*;
3940

4041
/**
@@ -77,7 +78,7 @@ public void onDataChange(DataSnapshot dataSnapshot) {
7778
this.callback.onLocationResult(dataSnapshot.getKey(), location);
7879
} else {
7980
String message = "GeoFire data has invalid format: " + dataSnapshot.getValue();
80-
this.callback.onCancelled(DatabaseError.fromStatus(message));
81+
this.callback.onCancelled(DatabaseError.fromException(new Throwable(message)));
8182
}
8283
}
8384
}

0 commit comments

Comments
 (0)