Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime doesn't try to delete /data/local/tmp/ folder anymore #811

Merged
merged 1 commit into from
Aug 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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