From aae470f1d0bbb7445a84818d1c9d82296116ee5e Mon Sep 17 00:00:00 2001 From: Heo Sangmin Date: Fri, 12 Feb 2021 01:27:46 +0900 Subject: [PATCH] refactor: change package name to capacitor.codepush --- android/src/main/AndroidManifest.xml | 2 +- .../java/com/microsoft/{cordova => capacitor}/CodePush.java | 3 ++- .../microsoft/{cordova => capacitor}/CodePushException.java | 2 +- .../{cordova => capacitor}/CodePushPackageManager.java | 2 +- .../{cordova => capacitor}/CodePushPackageMetadata.java | 2 +- .../{cordova => capacitor}/CodePushPreferences.java | 2 +- .../{cordova => capacitor}/CodePushReportingManager.java | 2 +- .../com/microsoft/{cordova => capacitor}/InstallMode.java | 2 +- .../microsoft/{cordova => capacitor}/InstallOptions.java | 2 +- .../microsoft/{cordova => capacitor}/ReportingStatus.java | 4 ++-- .../com/microsoft/{cordova => capacitor}/StatusReport.java | 4 ++-- .../microsoft/{cordova => capacitor}/UpdateHashUtils.java | 2 +- .../com/microsoft/{cordova => capacitor}/Utilities.java | 2 +- test/platform.ts | 6 +++--- test/projectManager.ts | 2 +- test/test.ts | 2 +- 16 files changed, 21 insertions(+), 20 deletions(-) rename android/src/main/java/com/microsoft/{cordova => capacitor}/CodePush.java (99%) rename android/src/main/java/com/microsoft/{cordova => capacitor}/CodePushException.java (91%) rename android/src/main/java/com/microsoft/{cordova => capacitor}/CodePushPackageManager.java (99%) rename android/src/main/java/com/microsoft/{cordova => capacitor}/CodePushPackageMetadata.java (99%) rename android/src/main/java/com/microsoft/{cordova => capacitor}/CodePushPreferences.java (99%) rename android/src/main/java/com/microsoft/{cordova => capacitor}/CodePushReportingManager.java (99%) rename android/src/main/java/com/microsoft/{cordova => capacitor}/InstallMode.java (95%) rename android/src/main/java/com/microsoft/{cordova => capacitor}/InstallOptions.java (91%) rename android/src/main/java/com/microsoft/{cordova => capacitor}/ReportingStatus.java (92%) rename android/src/main/java/com/microsoft/{cordova => capacitor}/StatusReport.java (98%) rename android/src/main/java/com/microsoft/{cordova => capacitor}/UpdateHashUtils.java (99%) rename android/src/main/java/com/microsoft/{cordova => capacitor}/Utilities.java (99%) diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 763bf606..eecd5002 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,3 +1,3 @@ + package="com.microsoft.capacitor.codepush"> diff --git a/android/src/main/java/com/microsoft/cordova/CodePush.java b/android/src/main/java/com/microsoft/capacitor/CodePush.java similarity index 99% rename from android/src/main/java/com/microsoft/cordova/CodePush.java rename to android/src/main/java/com/microsoft/capacitor/CodePush.java index 3156b992..80f73777 100644 --- a/android/src/main/java/com/microsoft/cordova/CodePush.java +++ b/android/src/main/java/com/microsoft/capacitor/CodePush.java @@ -1,4 +1,4 @@ -package com.microsoft.cordova; +package com.microsoft.capacitor; import android.content.pm.PackageManager; import android.os.AsyncTask; @@ -48,6 +48,7 @@ public class CodePush extends Plugin { @Override public void load() { + super.load(); CodePushPreferences codePushPreferences = new CodePushPreferences(getContext()); codePushPackageManager = new CodePushPackageManager(getContext(), codePushPreferences); codePushReportingManager = new CodePushReportingManager(getActivity(), codePushPreferences); diff --git a/android/src/main/java/com/microsoft/cordova/CodePushException.java b/android/src/main/java/com/microsoft/capacitor/CodePushException.java similarity index 91% rename from android/src/main/java/com/microsoft/cordova/CodePushException.java rename to android/src/main/java/com/microsoft/capacitor/CodePushException.java index 7dd1d68c..1b694ce2 100644 --- a/android/src/main/java/com/microsoft/cordova/CodePushException.java +++ b/android/src/main/java/com/microsoft/capacitor/CodePushException.java @@ -1,4 +1,4 @@ -package com.microsoft.cordova; +package com.microsoft.capacitor; public class CodePushException extends Exception { public CodePushException() { diff --git a/android/src/main/java/com/microsoft/cordova/CodePushPackageManager.java b/android/src/main/java/com/microsoft/capacitor/CodePushPackageManager.java similarity index 99% rename from android/src/main/java/com/microsoft/cordova/CodePushPackageManager.java rename to android/src/main/java/com/microsoft/capacitor/CodePushPackageManager.java index 0fec7b0f..a28471a5 100644 --- a/android/src/main/java/com/microsoft/cordova/CodePushPackageManager.java +++ b/android/src/main/java/com/microsoft/capacitor/CodePushPackageManager.java @@ -1,4 +1,4 @@ -package com.microsoft.cordova; +package com.microsoft.capacitor; import android.content.Context; diff --git a/android/src/main/java/com/microsoft/cordova/CodePushPackageMetadata.java b/android/src/main/java/com/microsoft/capacitor/CodePushPackageMetadata.java similarity index 99% rename from android/src/main/java/com/microsoft/cordova/CodePushPackageMetadata.java rename to android/src/main/java/com/microsoft/capacitor/CodePushPackageMetadata.java index 93389be1..41f98470 100644 --- a/android/src/main/java/com/microsoft/cordova/CodePushPackageMetadata.java +++ b/android/src/main/java/com/microsoft/capacitor/CodePushPackageMetadata.java @@ -1,4 +1,4 @@ -package com.microsoft.cordova; +package com.microsoft.capacitor; import org.json.JSONObject; diff --git a/android/src/main/java/com/microsoft/cordova/CodePushPreferences.java b/android/src/main/java/com/microsoft/capacitor/CodePushPreferences.java similarity index 99% rename from android/src/main/java/com/microsoft/cordova/CodePushPreferences.java rename to android/src/main/java/com/microsoft/capacitor/CodePushPreferences.java index bff8321b..1b6d48fa 100644 --- a/android/src/main/java/com/microsoft/cordova/CodePushPreferences.java +++ b/android/src/main/java/com/microsoft/capacitor/CodePushPreferences.java @@ -1,4 +1,4 @@ -package com.microsoft.cordova; +package com.microsoft.capacitor; import android.content.Context; import android.content.SharedPreferences; diff --git a/android/src/main/java/com/microsoft/cordova/CodePushReportingManager.java b/android/src/main/java/com/microsoft/capacitor/CodePushReportingManager.java similarity index 99% rename from android/src/main/java/com/microsoft/cordova/CodePushReportingManager.java rename to android/src/main/java/com/microsoft/capacitor/CodePushReportingManager.java index 2c660483..a7ded5ba 100644 --- a/android/src/main/java/com/microsoft/cordova/CodePushReportingManager.java +++ b/android/src/main/java/com/microsoft/capacitor/CodePushReportingManager.java @@ -1,4 +1,4 @@ -package com.microsoft.cordova; +package com.microsoft.capacitor; import java.util.Locale; import android.app.Activity; diff --git a/android/src/main/java/com/microsoft/cordova/InstallMode.java b/android/src/main/java/com/microsoft/capacitor/InstallMode.java similarity index 95% rename from android/src/main/java/com/microsoft/cordova/InstallMode.java rename to android/src/main/java/com/microsoft/capacitor/InstallMode.java index 0f3fb192..9e2efc9f 100644 --- a/android/src/main/java/com/microsoft/cordova/InstallMode.java +++ b/android/src/main/java/com/microsoft/capacitor/InstallMode.java @@ -1,4 +1,4 @@ -package com.microsoft.cordova; +package com.microsoft.capacitor; /** * Defines the available InstallModes. diff --git a/android/src/main/java/com/microsoft/cordova/InstallOptions.java b/android/src/main/java/com/microsoft/capacitor/InstallOptions.java similarity index 91% rename from android/src/main/java/com/microsoft/cordova/InstallOptions.java rename to android/src/main/java/com/microsoft/capacitor/InstallOptions.java index aa179acb..1e6adbec 100644 --- a/android/src/main/java/com/microsoft/cordova/InstallOptions.java +++ b/android/src/main/java/com/microsoft/capacitor/InstallOptions.java @@ -1,4 +1,4 @@ -package com.microsoft.cordova; +package com.microsoft.capacitor; /** * Defines the update installation options. diff --git a/android/src/main/java/com/microsoft/cordova/ReportingStatus.java b/android/src/main/java/com/microsoft/capacitor/ReportingStatus.java similarity index 92% rename from android/src/main/java/com/microsoft/cordova/ReportingStatus.java rename to android/src/main/java/com/microsoft/capacitor/ReportingStatus.java index fec17adc..eb3d2f60 100644 --- a/android/src/main/java/com/microsoft/cordova/ReportingStatus.java +++ b/android/src/main/java/com/microsoft/capacitor/ReportingStatus.java @@ -1,4 +1,4 @@ -package com.microsoft.cordova; +package com.microsoft.capacitor; /** * Defines application statuses we use in reporting events from the native to the JS layer. @@ -20,4 +20,4 @@ public enum ReportingStatus { public int getValue() { return this.value; } -} \ No newline at end of file +} diff --git a/android/src/main/java/com/microsoft/cordova/StatusReport.java b/android/src/main/java/com/microsoft/capacitor/StatusReport.java similarity index 98% rename from android/src/main/java/com/microsoft/cordova/StatusReport.java rename to android/src/main/java/com/microsoft/capacitor/StatusReport.java index 93169c7e..03ed8a8f 100644 --- a/android/src/main/java/com/microsoft/cordova/StatusReport.java +++ b/android/src/main/java/com/microsoft/capacitor/StatusReport.java @@ -1,4 +1,4 @@ -package com.microsoft.cordova; +package com.microsoft.capacitor; import org.json.JSONException; import org.json.JSONObject; @@ -82,4 +82,4 @@ public static StatusReport deserialize(String jsonString) throws JSONException { JSONObject jsonObject = new JSONObject(jsonString); return deserialize(jsonObject); } -} \ No newline at end of file +} diff --git a/android/src/main/java/com/microsoft/cordova/UpdateHashUtils.java b/android/src/main/java/com/microsoft/capacitor/UpdateHashUtils.java similarity index 99% rename from android/src/main/java/com/microsoft/cordova/UpdateHashUtils.java rename to android/src/main/java/com/microsoft/capacitor/UpdateHashUtils.java index d262c7d4..6b5b9bde 100644 --- a/android/src/main/java/com/microsoft/cordova/UpdateHashUtils.java +++ b/android/src/main/java/com/microsoft/capacitor/UpdateHashUtils.java @@ -1,4 +1,4 @@ -package com.microsoft.cordova; +package com.microsoft.capacitor; import android.app.Activity; import android.content.res.AssetManager; diff --git a/android/src/main/java/com/microsoft/cordova/Utilities.java b/android/src/main/java/com/microsoft/capacitor/Utilities.java similarity index 99% rename from android/src/main/java/com/microsoft/cordova/Utilities.java rename to android/src/main/java/com/microsoft/capacitor/Utilities.java index 7cc5527d..cf1d346b 100644 --- a/android/src/main/java/com/microsoft/cordova/Utilities.java +++ b/android/src/main/java/com/microsoft/capacitor/Utilities.java @@ -1,4 +1,4 @@ -package com.microsoft.cordova; +package com.microsoft.capacitor; import android.content.Context; import android.content.pm.PackageInfo; diff --git a/test/platform.ts b/test/platform.ts index 13831bec..13a72ca6 100644 --- a/test/platform.ts +++ b/test/platform.ts @@ -27,7 +27,7 @@ export interface IPlatform { getPlatformWwwPath(projectDirectory: string): string; /** - * Gets an optional IEmulatorManager for platforms for which "cordova run --nobuild" rebuilds the application for this platform anyway. + * Gets an optional IEmulatorManager for platforms for which "npx cap run --nobuild" rebuilds the application for this platform anyway. * IOS needs special handling here, since ios-sim touches the app every time and changes the app timestamp. * This challenges the tests since we rely on the app timestamp in our logic for finding out if the application was updated through the app store. */ @@ -439,7 +439,7 @@ export class PlatformResolver { private static supportedPlatforms: IPlatform[] = [Android.getInstance(), IOS.getInstance()]; /** - * Given the cordova name of a platform, this method returns the IPlatform associated with it. + * Given the capacitor name of a platform, this method returns the IPlatform associated with it. */ public static resolvePlatforms(cordovaPlatformNames: string[]): IPlatform[] { var platforms: IPlatform[] = []; @@ -458,7 +458,7 @@ export class PlatformResolver { } /** - * Given the cordova name of a platform, this method returns the IPlatform associated with it. + * Given the capacitor name of a platform, this method returns the IPlatform associated with it. */ public static resolvePlatform(cordovaPlatformName: string): IPlatform { for (var i = 0; i < this.supportedPlatforms.length; i++) { diff --git a/test/projectManager.ts b/test/projectManager.ts index a89394b4..32f42f38 100644 --- a/test/projectManager.ts +++ b/test/projectManager.ts @@ -34,7 +34,7 @@ export class ProjectManager { public static DEFAULT_APP_VERSION: string = "Store version"; /** - * Creates a new cordova test application at the specified path, and configures it + * Creates a new capacitor test application at the specified path, and configures it * with the given server URL, android and ios deployment keys. */ public static setupProject(projectDirectory: string, diff --git a/test/test.ts b/test/test.ts index c9b2352b..c76d0017 100644 --- a/test/test.ts +++ b/test/test.ts @@ -33,7 +33,7 @@ var restartEmulators: boolean = testUtil.readRestartEmulators(); const TestAppName = "CodePushTest"; const TestNamespace = "com.microsoft.codepush.test"; const AcquisitionSDKPluginName = "code-push"; -const WkWebViewEnginePluginName = "cordova-plugin-wkwebview-engine"; +const WkWebViewEnginePluginName = "capacitor-plugin-wkwebview-engine"; const ScenarioCheckForUpdatePath = "js/scenarioCheckForUpdate.js"; const ScenarioCheckForUpdateCustomKey = "js/scenarioCheckForUpdateCustomKey.js";