Skip to content

Commit

Permalink
runtime doesn't try to delete /data/local/tmp/ folder anymore (#811)
Browse files Browse the repository at this point in the history
removed apache until it's actually needed
  • Loading branch information
Plamen5kov authored Aug 4, 2017
1 parent 0ab0682 commit 9482553
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 36 deletions.
2 changes: 0 additions & 2 deletions build-artifacts/project-template-gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ dependencies {
if(project.hasProperty("supportVersion")) {
supportVer = supportVersion
}

debugCompile group: 'commons-io', name: 'commons-io', version: '2.0.1'

compile "com.android.support:support-v4:$supportVer"
compile "com.android.support:appcompat-v7:$supportVer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,15 @@ public void sync() {

if (fullSyncDir.exists()) {
executeFullSync(context, fullSyncDir);
deleteRecursive(fullSyncDir);
return;
}

if (syncDir.exists()) {
executePartialSync(context, syncDir);
deleteRecursive(syncDir);
}

if (removedSyncDir.exists()) {
executeRemovedSync(context, removedSyncDir);
deleteRecursive(removedSyncDir);
}
}

Expand Down Expand Up @@ -128,11 +125,7 @@ public void run() {
int length = input.readInt();
input.readFully(new byte[length]); // ignore the payload
executePartialSync(context, syncDir);
// delete temporary /sync dir after syncing .xml/.css resources
deleteRecursive(syncDir);
executeRemovedSync(context, removedSyncDir);
// delete temporary /removedsync dir after removing files from the project
deleteRecursive(removedSyncDir);

runtime.runScript(new File(NativeScriptSyncService.this.context.getFilesDir(), "internal/livesync.js"));
try {
Expand All @@ -153,14 +146,6 @@ public void startServer() {
localServerJavaThread.start();
}

private void deleteRecursive(File fileOrDirectory) {
try {
org.apache.commons.io.FileUtils.deleteDirectory(fileOrDirectory);
} catch (IOException e) {
android.util.Log.d("Sync", e.toString());
}
}

public static boolean isSyncEnabled(Context context) {
int flags;
boolean shouldExecuteSync = false;
Expand Down
4 changes: 0 additions & 4 deletions runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,6 @@ model {
}
}

dependencies {
compile group: 'commons-io', name: 'commons-io', version: '2.0.1'
}

if (project.hasProperty("embedBindingGenerator")) {
dependencies {
compile fileTree(dir: (project(':binding-generator').buildDir.toString() + "/libs"), include: ['*.jar'])
Expand Down
15 changes: 0 additions & 15 deletions test-app/app/src/main/java/com/tns/NativeScriptSyncService.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,15 @@ public void sync() {

if (fullSyncDir.exists()) {
executeFullSync(context, fullSyncDir);
deleteRecursive(fullSyncDir);
return;
}

if (syncDir.exists()) {
executePartialSync(context, syncDir);
deleteRecursive(syncDir);
}

if (removedSyncDir.exists()) {
executeRemovedSync(context, removedSyncDir);
deleteRecursive(removedSyncDir);
}
}

Expand Down Expand Up @@ -128,11 +125,7 @@ public void run() {
int length = input.readInt();
input.readFully(new byte[length]); // ignore the payload
executePartialSync(context, syncDir);
// delete temporary /sync dir after syncing .xml/.css resources
deleteRecursive(syncDir);
executeRemovedSync(context, removedSyncDir);
// delete temporary /removedsync dir after removing files from the project
deleteRecursive(removedSyncDir);

runtime.runScript(new File(NativeScriptSyncService.this.context.getFilesDir(), "internal/livesync.js"));
try {
Expand All @@ -153,14 +146,6 @@ public void startServer() {
localServerJavaThread.start();
}

private void deleteRecursive(File fileOrDirectory) {
try {
org.apache.commons.io.FileUtils.deleteDirectory(fileOrDirectory);
} catch (IOException e) {
android.util.Log.d("Sync", e.toString());
}
}

public static boolean isSyncEnabled(Context context) {
int flags;
boolean shouldExecuteSync = false;
Expand Down

0 comments on commit 9482553

Please sign in to comment.