Skip to content

Commit

Permalink
Modified the way maven packages up the JAR so we can get a JAR that i…
Browse files Browse the repository at this point in the history
…ncludes all of the unpacked dependency .class files. This makes it work with Android Studio. Also optimized us_street/Client.assignCandidatesToLookups()
  • Loading branch information
MouaYing committed Jun 23, 2016
1 parent beffd1d commit 386ac27
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 8 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

SOURCE_VERSION := 1.0

clean:
mvn clean

build:
mvn compile

Expand Down
16 changes: 16 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,22 @@
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
11 changes: 3 additions & 8 deletions src/main/java/com/smartystreets/api/us_street/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,8 @@ private void populateQueryString(Lookup address, Request request) {
request.putParameter("candidates", Integer.toString(address.getMaxCandidates()));
}

private void assignCandidatesToLookups(Batch batch, Candidate[] candidates) {
for (int i = 0; i < batch.size(); i++) {
for (Candidate candidate : candidates) {
if (candidate.getInputIndex() == i) {
batch.get(i).addToResult(candidate);
}
}
}
private void assignCandidatesToLookups(Batch batch, Candidate[] candidates) {
for (Candidate candidate : candidates)
batch.get(candidate.getInputIndex()).addToResult(candidate);
}
}
Binary file not shown.
Binary file not shown.
Binary file removed src/main/resources/lib/jackson-core-2.1.3.jar
Binary file not shown.

0 comments on commit 386ac27

Please sign in to comment.