diff --git a/OsmAnd-java/build.gradle b/OsmAnd-java/build.gradle index 9797bb9f4e..277f05b5a9 100644 --- a/OsmAnd-java/build.gradle +++ b/OsmAnd-java/build.gradle @@ -5,7 +5,10 @@ configurations { android } - +tasks.withType(JavaCompile) { + sourceCompatibility = "1.7" + targetCompatibility = "1.7" +} task collectRoutingResources(type: Sync) { from "../../resources/routing" @@ -37,8 +40,7 @@ task collectRegionsInfoResources(type: Copy) { task collectTestResources(type: Copy) { from "../../resources/test-resources" - into "src/main/test/resources/" - include "regions.ocbf" + into "src/test/resources/" } @@ -51,9 +53,9 @@ task collectExternalResources { } task androidJar(type: Jar) { - dependsOn collectExternalResources + dependsOn collectExternalResources, build appendix = "android" - from(sourceSets.main.java.outputDir) { + from (sourceSets.main.java.outputDir) { exclude("**/PlatformUtil.*") } from sourceSets.main.resources diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java index 9f472eaa1f..51c77ba0b0 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java @@ -67,7 +67,6 @@ import java.util.concurrent.ConcurrentHashMap; import org.apache.commons.logging.Log; -import scala.collection.immutable.HashMap; public class OsmandAidlApi { private static final Log LOG = PlatformUtil.getLog(OsmandAidlApi.class); diff --git a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java index 8c19dfbd53..8d56f5ba25 100644 --- a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java @@ -14,7 +14,7 @@ import net.osmand.plus.api.SQLiteAPI.SQLiteConnection; import net.osmand.plus.api.SQLiteAPI.SQLiteCursor; import net.osmand.util.Algorithms; -import org.apache.tools.bzip2.CBZip2OutputStream; +import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream; import java.io.File; import java.io.FileInputStream; @@ -324,15 +324,11 @@ public class FavouritesDbHelper { private void backup(File backupFile, File externalFile) { try { File f = new File(backupFile.getParentFile(), backupFile.getName()); - FileOutputStream fout = new FileOutputStream(f); - fout.write('B'); - fout.write('Z'); - CBZip2OutputStream out = new CBZip2OutputStream(fout); + BZip2CompressorOutputStream out = new BZip2CompressorOutputStream( new FileOutputStream(f)); FileInputStream fis = new FileInputStream(externalFile); Algorithms.streamCopy(fis, out); fis.close(); out.close(); - fout.close(); } catch (Exception e) { log.warn("Backup failed", e); }