diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4477845..7cc2b1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: path: electrode-native - working-directory: electrode-native/ run: node setup-dev.js - - run: ern platform use 0.49.2 + - run: ern platform use 1000.0.0 - run: yarn --frozen-lockfile - working-directory: android/ run: ./gradlew createAndPublishErnDevContainer diff --git a/android/lib/src/androidTest/java/com/ern/api/impl/ActivityScopedNavigationApiTest.java b/android/lib/src/androidTest/java/com/ern/api/impl/ActivityScopedNavigationApiTest.java index 03ca1ee..73bbc8b 100644 --- a/android/lib/src/androidTest/java/com/ern/api/impl/ActivityScopedNavigationApiTest.java +++ b/android/lib/src/androidTest/java/com/ern/api/impl/ActivityScopedNavigationApiTest.java @@ -11,9 +11,9 @@ import com.ern.api.impl.navigation.MiniAppNavigationFragment; import com.ern.api.impl.navigation.NavigationLaunchConfig; -import com.ernnavigationApi.ern.api.EnNavigationApi; -import com.ernnavigationApi.ern.model.ErnNavRoute; -import com.ernnavigationApi.ern.model.NavigationBar; +import com.ernnavigation.ern.api.EnNavigationApi; +import com.ernnavigation.ern.model.ErnNavRoute; +import com.ernnavigation.ern.model.NavigationBar; import com.walmartlabs.electrode.reactnative.bridge.ElectrodeBridgeResponseListener; import com.walmartlabs.electrode.reactnative.bridge.FailureMessage; import com.walmartlabs.electrode.reactnative.bridge.None; diff --git a/android/lib/src/androidTest/java/com/ern/api/impl/FragmentScopedNavigationApiTest.java b/android/lib/src/androidTest/java/com/ern/api/impl/FragmentScopedNavigationApiTest.java index ae3f947..638b8be 100644 --- a/android/lib/src/androidTest/java/com/ern/api/impl/FragmentScopedNavigationApiTest.java +++ b/android/lib/src/androidTest/java/com/ern/api/impl/FragmentScopedNavigationApiTest.java @@ -12,9 +12,9 @@ import androidx.test.filters.LargeTest; import com.ern.api.impl.navigation.MiniAppNavigationFragment; -import com.ernnavigationApi.ern.api.EnNavigationApi; -import com.ernnavigationApi.ern.model.ErnNavRoute; -import com.ernnavigationApi.ern.model.NavigationBar; +import com.ernnavigation.ern.api.EnNavigationApi; +import com.ernnavigation.ern.model.ErnNavRoute; +import com.ernnavigation.ern.model.NavigationBar; import com.walmartlabs.electrode.reactnative.bridge.ElectrodeBridgeResponseListener; import com.walmartlabs.electrode.reactnative.bridge.FailureMessage; import com.walmartlabs.electrode.reactnative.bridge.None; diff --git a/android/lib/src/androidTest/java/com/ern/api/impl/LaunchConfigTests.java b/android/lib/src/androidTest/java/com/ern/api/impl/LaunchConfigTests.java index 4f61ed6..58cdb3a 100644 --- a/android/lib/src/androidTest/java/com/ern/api/impl/LaunchConfigTests.java +++ b/android/lib/src/androidTest/java/com/ern/api/impl/LaunchConfigTests.java @@ -15,11 +15,11 @@ import com.ern.api.impl.navigation.MiniAppNavigationFragment; import com.ern.api.impl.navigation.NavEventType; import com.ern.api.impl.navigation.NavigationLaunchConfig; -import com.ernnavigationApi.ern.api.EnNavigationApi; -import com.ernnavigationApi.ern.model.ErnNavRoute; -import com.ernnavigationApi.ern.model.NavEventData; -import com.ernnavigationApi.ern.model.NavigationBar; -import com.ernnavigationApi.ern.model.NavigationBarLeftButton; +import com.ernnavigation.ern.api.EnNavigationApi; +import com.ernnavigation.ern.model.ErnNavRoute; +import com.ernnavigation.ern.model.NavEventData; +import com.ernnavigation.ern.model.NavigationBar; +import com.ernnavigation.ern.model.NavigationBarLeftButton; import com.walmartlabs.electrode.reactnative.bridge.ElectrodeBridgeEventListener; import com.walmartlabs.electrode.reactnative.bridge.ElectrodeBridgeResponseListener; import com.walmartlabs.electrode.reactnative.bridge.FailureMessage; diff --git a/android/lib/src/androidTest/java/com/ern/api/impl/NavigationFragmentDelegateTest.java b/android/lib/src/androidTest/java/com/ern/api/impl/NavigationFragmentDelegateTest.java index c01af5b..57781f6 100644 --- a/android/lib/src/androidTest/java/com/ern/api/impl/NavigationFragmentDelegateTest.java +++ b/android/lib/src/androidTest/java/com/ern/api/impl/NavigationFragmentDelegateTest.java @@ -30,12 +30,12 @@ import com.ern.api.impl.navigation.MenuItemProperties; import com.ern.api.impl.navigation.MiniAppNavigationFragment; import com.ern.api.impl.navigation.NavEventType; -import com.ernnavigationApi.ern.api.EnNavigationApi; -import com.ernnavigationApi.ern.model.ErnNavRoute; -import com.ernnavigationApi.ern.model.NavEventData; -import com.ernnavigationApi.ern.model.NavigationBar; -import com.ernnavigationApi.ern.model.NavigationBarButton; -import com.ernnavigationApi.ern.model.NavigationBarLeftButton; +import com.ernnavigation.ern.api.EnNavigationApi; +import com.ernnavigation.ern.model.ErnNavRoute; +import com.ernnavigation.ern.model.NavEventData; +import com.ernnavigation.ern.model.NavigationBar; +import com.ernnavigation.ern.model.NavigationBarButton; +import com.ernnavigation.ern.model.NavigationBarLeftButton; import com.walmartlabs.electrode.reactnative.bridge.ElectrodeBridgeEventListener; import com.walmartlabs.electrode.reactnative.bridge.ElectrodeBridgeResponseListener; import com.walmartlabs.electrode.reactnative.bridge.FailureMessage; diff --git a/android/lib/src/main/java/com/ern/api/impl/core/ElectrodeBaseFragmentDelegate.java b/android/lib/src/main/java/com/ern/api/impl/core/ElectrodeBaseFragmentDelegate.java index fccf3b0..7da8d03 100644 --- a/android/lib/src/main/java/com/ern/api/impl/core/ElectrodeBaseFragmentDelegate.java +++ b/android/lib/src/main/java/com/ern/api/impl/core/ElectrodeBaseFragmentDelegate.java @@ -20,7 +20,7 @@ import androidx.lifecycle.OnLifecycleEvent; import com.ern.api.impl.navigation.NavUtils; -import com.ernnavigationApi.ern.model.ErnNavRoute; +import com.ernnavigation.ern.model.ErnNavRoute; import com.facebook.react.ReactRootView; import com.walmartlabs.electrode.reactnative.bridge.helpers.Logger; diff --git a/android/lib/src/main/java/com/ern/api/impl/core/ElectrodeReactFragmentDelegate.java b/android/lib/src/main/java/com/ern/api/impl/core/ElectrodeReactFragmentDelegate.java index 87c6993..2c3bca0 100644 --- a/android/lib/src/main/java/com/ern/api/impl/core/ElectrodeReactFragmentDelegate.java +++ b/android/lib/src/main/java/com/ern/api/impl/core/ElectrodeReactFragmentDelegate.java @@ -38,7 +38,7 @@ import androidx.lifecycle.LifecycleObserver; import androidx.lifecycle.OnLifecycleEvent; -import com.ernnavigationApi.ern.model.ErnNavRoute; +import com.ernnavigation.ern.model.ErnNavRoute; import com.facebook.react.ReactRootView; import com.walmartlabs.electrode.reactnative.bridge.helpers.Logger; diff --git a/android/lib/src/main/java/com/ern/api/impl/navigation/ElectrodeNavigationFragmentDelegate.java b/android/lib/src/main/java/com/ern/api/impl/navigation/ElectrodeNavigationFragmentDelegate.java index 2d6740e..513b1ee 100644 --- a/android/lib/src/main/java/com/ern/api/impl/navigation/ElectrodeNavigationFragmentDelegate.java +++ b/android/lib/src/main/java/com/ern/api/impl/navigation/ElectrodeNavigationFragmentDelegate.java @@ -23,11 +23,11 @@ import com.ern.api.impl.core.ElectrodeBaseFragmentDelegate; import com.ern.api.impl.core.ElectrodeFragmentConfig; import com.ern.api.impl.core.LaunchConfig; -import com.ernnavigationApi.ern.api.EnNavigationApi; -import com.ernnavigationApi.ern.model.NavEventData; -import com.ernnavigationApi.ern.model.NavigationBar; -import com.ernnavigationApi.ern.model.NavigationBarButton; -import com.ernnavigationApi.ern.model.NavigationBarLeftButton; +import com.ernnavigation.ern.api.EnNavigationApi; +import com.ernnavigation.ern.model.NavEventData; +import com.ernnavigation.ern.model.NavigationBar; +import com.ernnavigation.ern.model.NavigationBarButton; +import com.ernnavigation.ern.model.NavigationBarLeftButton; import com.walmartlabs.electrode.reactnative.bridge.helpers.Logger; import org.json.JSONObject; diff --git a/android/lib/src/main/java/com/ern/api/impl/navigation/ElectrodeReactFragmentNavDelegate.java b/android/lib/src/main/java/com/ern/api/impl/navigation/ElectrodeReactFragmentNavDelegate.java index 698e6a0..cd2a790 100644 --- a/android/lib/src/main/java/com/ern/api/impl/navigation/ElectrodeReactFragmentNavDelegate.java +++ b/android/lib/src/main/java/com/ern/api/impl/navigation/ElectrodeReactFragmentNavDelegate.java @@ -36,9 +36,9 @@ import com.ern.api.impl.core.ElectrodeReactFragmentActivityDelegate.StartMiniAppConfig; import com.ern.api.impl.core.ElectrodeReactFragmentDelegate; -import com.ernnavigationApi.ern.api.EnNavigationApi; -import com.ernnavigationApi.ern.model.NavigationBar; -import com.ernnavigationApi.ern.model.NavigationBarButton; +import com.ernnavigation.ern.api.EnNavigationApi; +import com.ernnavigation.ern.model.NavigationBar; +import com.ernnavigation.ern.model.NavigationBarButton; import com.walmartlabs.electrode.reactnative.bridge.helpers.Logger; /** diff --git a/android/lib/src/main/java/com/ern/api/impl/navigation/ElectrodeReactNavigationActivityDelegate.java b/android/lib/src/main/java/com/ern/api/impl/navigation/ElectrodeReactNavigationActivityDelegate.java index 2438baf..5fd7839 100644 --- a/android/lib/src/main/java/com/ern/api/impl/navigation/ElectrodeReactNavigationActivityDelegate.java +++ b/android/lib/src/main/java/com/ern/api/impl/navigation/ElectrodeReactNavigationActivityDelegate.java @@ -20,7 +20,7 @@ import androidx.fragment.app.FragmentActivity; import com.ern.api.impl.core.ElectrodeReactFragmentActivityDelegate; -import com.ernnavigationApi.ern.model.NavigationBar; +import com.ernnavigation.ern.model.NavigationBar; /** * @deprecated This delegate is no longer in use. Change to use {@link com.ern.api.impl.core.ElectrodeBaseActivityDelegate} diff --git a/android/lib/src/main/java/com/ern/api/impl/navigation/MenuItemDataProvider.java b/android/lib/src/main/java/com/ern/api/impl/navigation/MenuItemDataProvider.java index ba88ccd..c00b842 100644 --- a/android/lib/src/main/java/com/ern/api/impl/navigation/MenuItemDataProvider.java +++ b/android/lib/src/main/java/com/ern/api/impl/navigation/MenuItemDataProvider.java @@ -20,7 +20,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.ernnavigationApi.ern.model.NavigationBarButton; +import com.ernnavigation.ern.model.NavigationBarButton; /** * Interface that helps native to override the menuItem properties. @@ -40,7 +40,7 @@ public interface MenuItemDataProvider { /** * Use when the left up indicator needs an override from native. - * When react native sends a {@link com.ernnavigationApi.ern.model.NavigationBar} with a {@link com.ernnavigationApi.ern.model.NavigationBarLeftButton} native has an opportunity to provide the id and drawable resource from native side. + * When react native sends a {@link com.ernnavigation.ern.model.NavigationBar} with a {@link com.ernnavigation.ern.model.NavigationBarLeftButton} native has an opportunity to provide the id and drawable resource from native side. * * @param iconName {@link String} name if the iconName provided by React Native component. * @return int return {@link #NONE} when you don't need an override. diff --git a/android/lib/src/main/java/com/ern/api/impl/navigation/MenuUtil.java b/android/lib/src/main/java/com/ern/api/impl/navigation/MenuUtil.java index 3cedb14..f2ade52 100644 --- a/android/lib/src/main/java/com/ern/api/impl/navigation/MenuUtil.java +++ b/android/lib/src/main/java/com/ern/api/impl/navigation/MenuUtil.java @@ -34,8 +34,8 @@ import androidx.annotation.Nullable; import androidx.core.view.MenuItemCompat; -import com.ernnavigationApi.ern.model.NavigationBar; -import com.ernnavigationApi.ern.model.NavigationBarButton; +import com.ernnavigation.ern.model.NavigationBar; +import com.ernnavigation.ern.model.NavigationBarButton; import com.walmartlabs.electrode.reactnative.bridge.helpers.Logger; import java.io.IOException; diff --git a/android/lib/src/main/java/com/ern/api/impl/navigation/MiniAppNavRequestListener.java b/android/lib/src/main/java/com/ern/api/impl/navigation/MiniAppNavRequestListener.java index df228b9..e0e5c15 100644 --- a/android/lib/src/main/java/com/ern/api/impl/navigation/MiniAppNavRequestListener.java +++ b/android/lib/src/main/java/com/ern/api/impl/navigation/MiniAppNavRequestListener.java @@ -20,7 +20,7 @@ import androidx.annotation.Nullable; import com.ern.api.impl.core.ElectrodeReactFragmentDelegate; -import com.ernnavigationApi.ern.model.NavigationBar; +import com.ernnavigation.ern.model.NavigationBar; import org.json.JSONObject; diff --git a/android/lib/src/main/java/com/ern/api/impl/navigation/NavUtils.java b/android/lib/src/main/java/com/ern/api/impl/navigation/NavUtils.java index b52ee43..769215b 100644 --- a/android/lib/src/main/java/com/ern/api/impl/navigation/NavUtils.java +++ b/android/lib/src/main/java/com/ern/api/impl/navigation/NavUtils.java @@ -21,8 +21,8 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.ernnavigationApi.ern.model.ErnNavRoute; -import com.ernnavigationApi.ern.model.NavigationBar; +import com.ernnavigation.ern.model.ErnNavRoute; +import com.ernnavigation.ern.model.NavigationBar; import com.walmartlabs.electrode.reactnative.bridge.helpers.Logger; import org.json.JSONException; diff --git a/android/lib/src/main/java/com/ern/api/impl/navigation/OnNavBarItemClickListener.java b/android/lib/src/main/java/com/ern/api/impl/navigation/OnNavBarItemClickListener.java index 6e5517c..8d52f21 100644 --- a/android/lib/src/main/java/com/ern/api/impl/navigation/OnNavBarItemClickListener.java +++ b/android/lib/src/main/java/com/ern/api/impl/navigation/OnNavBarItemClickListener.java @@ -20,7 +20,7 @@ import androidx.annotation.NonNull; -import com.ernnavigationApi.ern.model.NavigationBarButton; +import com.ernnavigation.ern.model.NavigationBarButton; /** * Click listener that a fragment can implement if it want to handle a action bar menu item click inside a fragment. diff --git a/android/lib/src/main/java/com/ern/api/impl/navigation/ReactNavigationViewModel.java b/android/lib/src/main/java/com/ern/api/impl/navigation/ReactNavigationViewModel.java index dd73093..f36d381 100644 --- a/android/lib/src/main/java/com/ern/api/impl/navigation/ReactNavigationViewModel.java +++ b/android/lib/src/main/java/com/ern/api/impl/navigation/ReactNavigationViewModel.java @@ -25,8 +25,8 @@ import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; -import com.ernnavigationApi.ern.api.EnNavigationApi; -import com.ernnavigationApi.ern.model.ErnNavRoute; +import com.ernnavigation.ern.api.EnNavigationApi; +import com.ernnavigation.ern.model.ErnNavRoute; import com.walmartlabs.electrode.reactnative.bridge.BridgeFailureMessage; import com.walmartlabs.electrode.reactnative.bridge.ElectrodeBridgeRequestHandler; import com.walmartlabs.electrode.reactnative.bridge.ElectrodeBridgeResponseListener; diff --git a/android/lib/src/test/java/com/ern/api/impl/navigation/NavUtilTest.java b/android/lib/src/test/java/com/ern/api/impl/navigation/NavUtilTest.java index 22f28a4..b841c4b 100644 --- a/android/lib/src/test/java/com/ern/api/impl/navigation/NavUtilTest.java +++ b/android/lib/src/test/java/com/ern/api/impl/navigation/NavUtilTest.java @@ -2,7 +2,7 @@ import android.os.Bundle; -import com.ernnavigationApi.ern.model.NavigationBar; +import com.ernnavigation.ern.model.NavigationBar; import org.json.JSONException; import org.json.JSONObject; diff --git a/android/moviesreloaded/ern.gradle b/android/moviesreloaded/ern.gradle index fe2208f..2f4cb2a 100644 --- a/android/moviesreloaded/ern.gradle +++ b/android/moviesreloaded/ern.gradle @@ -15,14 +15,74 @@ task copyApiImplSrc(type: Copy) { into "$CONTAINER_PATH/lib/src/main/java/com/ern/api/impl" } +// Patch container sources for in-progress androidx migration (Jan 2022) - Remove later + +task patchApiSrc(type: Copy) { + from "$CONTAINER_PATH/lib/src/main/java/com/ernnavigationApi/ern" + into "$buildDir/tmp/patched-api" + filter { line -> line.replaceAll('android\\.support', 'androidx') } + filter { line -> line.replaceAll('ernnavigationApi', 'ernnavigation') } +} +task deleteApiSrc(type: Delete) { + delete "$CONTAINER_PATH/lib/src/main/java/com/ernnavigationApi" +} +task replaceApiSrc(type: Copy) { + from "$buildDir/tmp/patched-api" + into "$CONTAINER_PATH/lib/src/main/java/com/ernnavigation/ern" +} + +task patchBridgeSrc(type: Copy) { + from "$CONTAINER_PATH/lib/src/main/java/com/walmartlabs/electrode/reactnative/bridge" + into "$buildDir/tmp/patched-bridge" + filter { line -> line.replaceAll('android\\.support', 'androidx') } +} +task deleteBridgeSrc(type: Delete) { + delete "$CONTAINER_PATH/lib/src/main/java/com/walmartlabs/electrode/reactnative/bridge" +} +task replaceBridgeSrc(type: Copy) { + from "$buildDir/tmp/patched-bridge" + into "$CONTAINER_PATH/lib/src/main/java/com/walmartlabs/electrode/reactnative/bridge" +} + +task patchPluginsSrc(type: Copy) { + from "$CONTAINER_PATH/lib/src/main/java/com/walmartlabs/ern/container/plugins" + into "$buildDir/tmp/patched-plugins" + filter { line -> line.replaceAll('android\\.support', 'androidx') } +} +task deletePluginsSrc(type: Delete) { + delete "$CONTAINER_PATH/lib/src/main/java/com/walmartlabs/ern/container/plugins" +} +task replacePluginsSrc(type: Copy) { + from "$buildDir/tmp/patched-plugins" + into "$CONTAINER_PATH/lib/src/main/java/com/walmartlabs/ern/container/plugins" +} + task patchContainer { dependsOn deleteApiImplSrc dependsOn copyApiImplSrc + dependsOn patchApiSrc + dependsOn deleteApiSrc + dependsOn replaceApiSrc + dependsOn patchBridgeSrc + dependsOn deleteBridgeSrc + dependsOn replaceBridgeSrc + dependsOn patchPluginsSrc + dependsOn deletePluginsSrc + dependsOn replacePluginsSrc tasks.findByName('copyApiImplSrc').mustRunAfter 'deleteApiImplSrc' + tasks.findByName('patchApiSrc').mustRunAfter 'copyApiImplSrc' + tasks.findByName('deleteApiSrc').mustRunAfter 'patchApiSrc' + tasks.findByName('replaceApiSrc').mustRunAfter 'deleteApiSrc' + tasks.findByName('patchBridgeSrc').mustRunAfter 'replaceApiSrc' + tasks.findByName('deleteBridgeSrc').mustRunAfter 'patchBridgeSrc' + tasks.findByName('replaceBridgeSrc').mustRunAfter 'deleteBridgeSrc' + tasks.findByName('patchPluginsSrc').mustRunAfter 'replaceBridgeSrc' + tasks.findByName('deletePluginsSrc').mustRunAfter 'patchPluginsSrc' + tasks.findByName('replacePluginsSrc').mustRunAfter 'deletePluginsSrc' } task publishErnContainer(type: Exec) { - commandLine "ern", "publish-container", "-p", "ern-container-publisher-maven@1.0.5", "-u", "file://$HOMEDIR/.m2/repository", "--platform", "android", "-e", '{"artifactId":"container-movies-reloaded","groupId":"com.walmartlabs.ern"}' + commandLine "ern", "publish-container", "-p", "maven", "-u", "file://$HOMEDIR/.m2/repository", "--platform", "android", "-e", '{"artifactId":"container-movies-reloaded","groupId":"com.walmartlabs.ern"}' } task createAndPublishErnDevContainer() { diff --git a/android/moviesreloaded/src/main/java/com/walmartlabs/moviesreloaded/demo/navmenuhandler/MenuItemDemoFragment.java b/android/moviesreloaded/src/main/java/com/walmartlabs/moviesreloaded/demo/navmenuhandler/MenuItemDemoFragment.java index f452a0e..fd47b24 100644 --- a/android/moviesreloaded/src/main/java/com/walmartlabs/moviesreloaded/demo/navmenuhandler/MenuItemDemoFragment.java +++ b/android/moviesreloaded/src/main/java/com/walmartlabs/moviesreloaded/demo/navmenuhandler/MenuItemDemoFragment.java @@ -12,7 +12,7 @@ import com.ern.api.impl.navigation.MenuItemProperties; import com.ern.api.impl.navigation.MiniAppNavigationFragment; import com.ern.api.impl.navigation.OnNavBarItemClickListener; -import com.ernnavigationApi.ern.model.NavigationBarButton; +import com.ernnavigation.ern.model.NavigationBarButton; import com.walmartlabs.moviesreloaded.R; public class MenuItemDemoFragment extends MiniAppNavigationFragment implements OnNavBarItemClickListener {