Refactor packages
This commit is contained in:
parent
bd6ccd5510
commit
41300c96d9
3 changed files with 9 additions and 12 deletions
|
@ -5,7 +5,10 @@ configurations {
|
||||||
android
|
android
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
sourceCompatibility = "1.7"
|
||||||
|
targetCompatibility = "1.7"
|
||||||
|
}
|
||||||
|
|
||||||
task collectRoutingResources(type: Sync) {
|
task collectRoutingResources(type: Sync) {
|
||||||
from "../../resources/routing"
|
from "../../resources/routing"
|
||||||
|
@ -37,8 +40,7 @@ task collectRegionsInfoResources(type: Copy) {
|
||||||
|
|
||||||
task collectTestResources(type: Copy) {
|
task collectTestResources(type: Copy) {
|
||||||
from "../../resources/test-resources"
|
from "../../resources/test-resources"
|
||||||
into "src/main/test/resources/"
|
into "src/test/resources/"
|
||||||
include "regions.ocbf"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -51,9 +53,9 @@ task collectExternalResources {
|
||||||
}
|
}
|
||||||
|
|
||||||
task androidJar(type: Jar) {
|
task androidJar(type: Jar) {
|
||||||
dependsOn collectExternalResources
|
dependsOn collectExternalResources, build
|
||||||
appendix = "android"
|
appendix = "android"
|
||||||
from(sourceSets.main.java.outputDir) {
|
from (sourceSets.main.java.outputDir) {
|
||||||
exclude("**/PlatformUtil.*")
|
exclude("**/PlatformUtil.*")
|
||||||
}
|
}
|
||||||
from sourceSets.main.resources
|
from sourceSets.main.resources
|
||||||
|
|
|
@ -67,7 +67,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
|
||||||
import scala.collection.immutable.HashMap;
|
|
||||||
|
|
||||||
public class OsmandAidlApi {
|
public class OsmandAidlApi {
|
||||||
private static final Log LOG = PlatformUtil.getLog(OsmandAidlApi.class);
|
private static final Log LOG = PlatformUtil.getLog(OsmandAidlApi.class);
|
||||||
|
|
|
@ -14,7 +14,7 @@ import net.osmand.plus.api.SQLiteAPI.SQLiteConnection;
|
||||||
import net.osmand.plus.api.SQLiteAPI.SQLiteCursor;
|
import net.osmand.plus.api.SQLiteAPI.SQLiteCursor;
|
||||||
import net.osmand.util.Algorithms;
|
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.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
@ -324,15 +324,11 @@ public class FavouritesDbHelper {
|
||||||
private void backup(File backupFile, File externalFile) {
|
private void backup(File backupFile, File externalFile) {
|
||||||
try {
|
try {
|
||||||
File f = new File(backupFile.getParentFile(), backupFile.getName());
|
File f = new File(backupFile.getParentFile(), backupFile.getName());
|
||||||
FileOutputStream fout = new FileOutputStream(f);
|
BZip2CompressorOutputStream out = new BZip2CompressorOutputStream( new FileOutputStream(f));
|
||||||
fout.write('B');
|
|
||||||
fout.write('Z');
|
|
||||||
CBZip2OutputStream out = new CBZip2OutputStream(fout);
|
|
||||||
FileInputStream fis = new FileInputStream(externalFile);
|
FileInputStream fis = new FileInputStream(externalFile);
|
||||||
Algorithms.streamCopy(fis, out);
|
Algorithms.streamCopy(fis, out);
|
||||||
fis.close();
|
fis.close();
|
||||||
out.close();
|
out.close();
|
||||||
fout.close();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("Backup failed", e);
|
log.warn("Backup failed", e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue