diff --git a/.circleci/config.yml b/.circleci/config.yml index bd9b0ae96cbf..b0981777d1a4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,38 +11,33 @@ commands: - run: name: Setup gradle.properties command: cp gradle.properties-example gradle.properties - yarn-install: + npm-install: steps: - restore_cache: - name: Restore Yarn Cache + name: Restore NPM Cache keys: - - yarn-i18n-v4-cache-v{{ .Environment.CACHE_TRIGGER_VERSION }}-job-{{ .Environment.CIRCLE_JOB }}-{{ checksum "libs/gutenberg-mobile/yarn.lock" }} + - npm-i18n-v1-cache-v{{ .Environment.CACHE_TRIGGER_VERSION }}-job-{{ .Environment.CIRCLE_JOB }}-{{ checksum "libs/gutenberg-mobile/package-lock.json" }} - run: - name: Yarn Install + name: NPM Install working_directory: libs/gutenberg-mobile - command: yarn install --frozen-lockfile --prefer-offline --network-concurrency 1 + command: npm ci --prefer-offline - save_cache: - name: Save Yarn Cache - key: yarn-i18n-v4-cache-v{{ .Environment.CACHE_TRIGGER_VERSION }}-job-{{ .Environment.CIRCLE_JOB }}-{{ checksum "libs/gutenberg-mobile/yarn.lock" }} + name: Save NPM Cache + key: npm-i18n-v1-cache-v{{ .Environment.CACHE_TRIGGER_VERSION }}-job-{{ .Environment.CIRCLE_JOB }}-{{ checksum "libs/gutenberg-mobile/package-lock.json" }} paths: - - libs/gutenberg-mobile/node_modules + - ~/.npm - libs/gutenberg-mobile/i18n-cache/data checkout-submodules: steps: - run: name: Checkout submodules - command: git submodule update --init --recursive - checkout-gutenberg-mobile-submodule-only: + command: git submodule update --init --recursive --depth 1 + npm-bundle-android: steps: - run: - name: Checkout gutenberg-mobile submodule (no recursive) - command: git submodule update --init - yarn-bundle-android: - steps: - - run: - name: Yarn bundle Android + name: Npm bundle Android working_directory: libs/gutenberg-mobile - command: yarn bundle:android + command: npm run bundle:android save-gutenberg-bundle-cache: steps: - run: @@ -54,7 +49,7 @@ commands: name: Cache JS Bundle key: android-js-bundle-{{ checksum "gutenberg_submodule_hash" }} paths: - - libs/gutenberg-mobile/react-native-gutenberg-bridge/android/build/assets/index.android.bundle + - libs/gutenberg-mobile/gutenberg/packages/react-native-bridge/android/build/assets/index.android.bundle restore-gutenberg-bundle-cache: steps: - run: @@ -77,21 +72,21 @@ jobs: - run: name: Abort If JS Bundle Exists command: | - if [ -f "libs/gutenberg-mobile/react-native-gutenberg-bridge/android/build/assets/index.android.bundle" ]; then + if [ -f "libs/gutenberg-mobile/gutenberg/packages/react-native-bridge/android/build/assets/index.android.bundle" ]; then echo "Gutenberg-Mobile bundle already in cache, no need to create a new one." circleci-agent step halt else echo "Gutenberg-Mobile bundle not found in cache. Proceeding to generate new bundle" fi - checkout-submodules - - yarn-install - - yarn-bundle-android + - npm-install + - npm-bundle-android - run: name: Ensure assets folder exists - command: mkdir -p libs/gutenberg-mobile/react-native-gutenberg-bridge/android/build/assets + command: mkdir -p libs/gutenberg-mobile/gutenberg/packages/react-native-bridge/android/build/assets - run: name: Move bundle to assets folder - command: mv libs/gutenberg-mobile/bundle/android/App.js libs/gutenberg-mobile/react-native-gutenberg-bridge/android/build/assets/index.android.bundle + command: mv libs/gutenberg-mobile/bundle/android/App.js libs/gutenberg-mobile/gutenberg/packages/react-native-bridge/android/build/assets/index.android.bundle - save-gutenberg-bundle-cache test: executor: @@ -99,15 +94,15 @@ jobs: api-version: "28" steps: - git/shallow-checkout - - checkout-gutenberg-mobile-submodule-only + - checkout-submodules - android/restore-gradle-cache - copy-gradle-properties - restore-gutenberg-bundle-cache - run: name: Ensure assets folder exists - command: mkdir -p libs/gutenberg-mobile/react-native-gutenberg-bridge/android/src/main/assets + command: mkdir -p libs/gutenberg-mobile/gutenberg/packages/react-native-bridge/android/src/main/assets - attach_workspace: - at: libs/gutenberg-mobile/react-native-gutenberg-bridge/android/src/main/assets + at: libs/gutenberg-mobile/gutenberg/packages/react-native-bridge/android/src/main/assets - run: name: Test WordPress environment: @@ -126,15 +121,15 @@ jobs: api-version: "28" steps: - git/shallow-checkout - - checkout-gutenberg-mobile-submodule-only + - checkout-submodules - android/restore-gradle-cache - copy-gradle-properties - restore-gutenberg-bundle-cache - run: name: Ensure assets folder exists - command: mkdir -p libs/gutenberg-mobile/react-native-gutenberg-bridge/android/src/main/assets + command: mkdir -p libs/gutenberg-mobile/gutenberg/packages/react-native-bridge/android/src/main/assets - attach_workspace: - at: libs/gutenberg-mobile/react-native-gutenberg-bridge/android/src/main/assets + at: libs/gutenberg-mobile/gutenberg/packages/react-native-bridge/android/src/main/assets - run: name: Checkstyle environment: @@ -169,7 +164,7 @@ jobs: api-version: "28" steps: - git/shallow-checkout - - checkout-gutenberg-mobile-submodule-only + - checkout-submodules - bundle-install/bundle-install: cache_key_prefix: installable-build - run: @@ -179,9 +174,9 @@ jobs: - restore-gutenberg-bundle-cache - run: name: Ensure assets folder exists - command: mkdir -p libs/gutenberg-mobile/react-native-gutenberg-bridge/android/src/main/assets + command: mkdir -p libs/gutenberg-mobile/gutenberg/packages/react-native-bridge/android/src/main/assets - attach_workspace: - at: libs/gutenberg-mobile/react-native-gutenberg-bridge/android/src/main/assets + at: libs/gutenberg-mobile/gutenberg/packages/react-native-bridge/android/src/main/assets - run: name: Build APK environment: @@ -218,15 +213,15 @@ jobs: api-version: "28" steps: - git/shallow-checkout - - checkout-gutenberg-mobile-submodule-only + - checkout-submodules - android/restore-gradle-cache - copy-gradle-properties - restore-gutenberg-bundle-cache - run: name: Ensure assets folder exists - command: mkdir -p libs/gutenberg-mobile/react-native-gutenberg-bridge/android/src/main/assets + command: mkdir -p libs/gutenberg-mobile/gutenberg/packages/react-native-bridge/android/src/main/assets - attach_workspace: - at: libs/gutenberg-mobile/react-native-gutenberg-bridge/android/src/main/assets + at: libs/gutenberg-mobile/gutenberg/packages/react-native-bridge/android/src/main/assets - run: name: Build environment: @@ -261,15 +256,15 @@ jobs: api-version: "28" steps: - git/shallow-checkout - - checkout-gutenberg-mobile-submodule-only + - checkout-submodules - android/restore-gradle-cache - copy-gradle-properties - restore-gutenberg-bundle-cache - run: name: Ensure assets folder exists - command: mkdir -p libs/gutenberg-mobile/react-native-gutenberg-bridge/android/src/main/assets + command: mkdir -p libs/gutenberg-mobile/gutenberg/packages/react-native-bridge/android/src/main/assets - attach_workspace: - at: libs/gutenberg-mobile/react-native-gutenberg-bridge/android/src/main/assets + at: libs/gutenberg-mobile/gutenberg/packages/react-native-bridge/android/src/main/assets - run: name: Build environment: @@ -293,7 +288,7 @@ jobs: - image: circleci/ruby:2.6.4 steps: - git/shallow-checkout - - checkout-gutenberg-mobile-submodule-only + - checkout-submodules - run: name: Install bundler command: gem install bundler --version 2.0.2 diff --git a/WordPress/build.gradle b/WordPress/build.gradle index faca61addfe9..63905365011f 100644 --- a/WordPress/build.gradle +++ b/WordPress/build.gradle @@ -147,6 +147,9 @@ android { exclude '**/libjscexecutor.so' exclude '**/libhermes-inspector.so' exclude '**/libhermes-executor-debug.so' + + pickFirst 'META-INF/-no-jdk.kotlin_module' + } bundle { diff --git a/WordPress/lint-baseline.xml b/WordPress/lint-baseline.xml index 42c2fd629297..023d9ff9aabc 100644 --- a/WordPress/lint-baseline.xml +++ b/WordPress/lint-baseline.xml @@ -57,7 +57,7 @@ errorLine1=" view.setPadding(" errorLine2=" ^"> @@ -3927,7 +3927,7 @@ errorLine1=" Layout.BREAK_STRATEGY_SIMPLE : Layout.BREAK_STRATEGY_HIGH_QUALITY;" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3943,7 +3943,7 @@ errorLine1=" Layout.BREAK_STRATEGY_SIMPLE : Layout.BREAK_STRATEGY_HIGH_QUALITY;" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3959,7 +3959,7 @@ errorLine1=" view.setJustificationMode(Layout.JUSTIFICATION_MODE_INTER_WORD);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3975,7 +3975,7 @@ errorLine1=" view.setJustificationMode(Layout.JUSTIFICATION_MODE_NONE);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3991,7 +3991,7 @@ errorLine1=" classpath 'com.android.tools.build:gradle:3.4.2'" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -4007,7 +4007,7 @@ errorLine1=" implementation 'androidx.appcompat:appcompat:1.0.0'" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -4023,7 +4023,7 @@ errorLine1=" implementation 'androidx.appcompat:appcompat:1.0.0'" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -4039,7 +4039,7 @@ errorLine1=" implementation 'androidx.recyclerview:recyclerview:1.0.0'" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -4055,7 +4055,7 @@ errorLine1=" @ReactProp(name = PROP_TEXT)" errorLine2=" ~~~~~~~~~"> @@ -4071,7 +4071,7 @@ errorLine1=" private HashMap<Integer, Media> mMediaToAddAfterMounting = new HashMap<>();" errorLine2=" ~~~~~~~~~~~~~~~"> @@ -4087,7 +4087,7 @@ url="http://developer.android.com/design/style/iconography.html" urls="http://developer.android.com/design/style/iconography.html"> + file="../libs/gutenberg-mobile/gutenberg/packages/react-native-aztec/android/src/main/res/drawable-hdpi/ic_launcher.png"/> + file="../libs/gutenberg-mobile/gutenberg/packages/react-native-aztec/android/src/main/res/drawable-mdpi/ic_launcher.png"/> + file="../libs/gutenberg-mobile/gutenberg/packages/react-native-aztec/android/src/main/res/drawable-xhdpi/ic_launcher.png"/> + file="../libs/gutenberg-mobile/gutenberg/packages/react-native-aztec/android/src/main/res/drawable-xxhdpi/ic_launcher.png"/> @@ -4159,7 +4159,7 @@ errorLine1=" (int) update.getPaddingLeft()," errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> @@ -4175,7 +4175,7 @@ errorLine1=" (int) update.getPaddingRight()," errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~"> diff --git a/build.gradle b/build.gradle index 6df4d73b7add..8f166a958803 100644 --- a/build.gradle +++ b/build.gradle @@ -55,7 +55,7 @@ allprojects { maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm - url "$rootDir/libs/gutenberg-mobile/node_modules/react-native/android" + url "$rootDir/libs/gutenberg-mobile/gutenberg/node_modules/react-native/android" } } else { maven { url "https://dl.bintray.com/wordpress-mobile/react-native-mirror/" } diff --git a/libs/editor/WordPressEditor/build.gradle b/libs/editor/WordPressEditor/build.gradle index 82b331424e77..552088701691 100644 --- a/libs/editor/WordPressEditor/build.gradle +++ b/libs/editor/WordPressEditor/build.gradle @@ -75,7 +75,7 @@ dependencies { api ("com.github.wordpress-mobile.WordPress-Aztec-Android:wordpress-shortcodes:$aztecVersion") api ("com.github.wordpress-mobile.WordPress-Aztec-Android:wordpress-comments:$aztecVersion") - implementation (project(':react-native-gutenberg-bridge')) { + implementation (project(':@wordpress_react-native-bridge')) { exclude group: 'com.squareup.okhttp3' exclude group: "com.android.volley" exclude group: 'com.google.code.findbugs' diff --git a/libs/gutenberg-mobile b/libs/gutenberg-mobile index a6e1740addf5..41f12f65649b 160000 --- a/libs/gutenberg-mobile +++ b/libs/gutenberg-mobile @@ -1 +1 @@ -Subproject commit a6e1740addf5db29c9c49f9314a21ad0bb2beebb +Subproject commit 41f12f65649bb86ffa3de2ebb0046a96065e18ee diff --git a/settings.gradle b/settings.gradle index c93240da283e..ab82586cd6bf 100644 --- a/settings.gradle +++ b/settings.gradle @@ -9,25 +9,25 @@ include ':libs:login:WordPressLoginFlow' include ':WordPressMocks' project(':WordPressMocks').projectDir = new File(rootProject.projectDir, properties.getOrDefault('wp.wordpress_mocks_path', 'libs/mocks') + '/WordPressMocks') -include ':react-native-aztec' -project(':react-native-aztec').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/react-native-aztec/android') +include ':@wordpress_react-native-aztec' +project(':@wordpress_react-native-aztec').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/gutenberg/packages/react-native-aztec/android') -include ':react-native-gutenberg-bridge' -project(':react-native-gutenberg-bridge').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/react-native-gutenberg-bridge/android') +include ':@wordpress_react-native-bridge' +project(':@wordpress_react-native-bridge').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/gutenberg/packages/react-native-bridge/android') if (properties.getOrDefault('wp.BUILD_GUTENBERG_FROM_SOURCE', false).toBoolean()) { include ':react-native-linear-gradient' - project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/node_modules/react-native-linear-gradient/android') + project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/gutenberg/node_modules/react-native-linear-gradient/android') include ':react-native-svg' - project(':react-native-svg').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/node_modules/react-native-svg/android') + project(':react-native-svg').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/gutenberg/node_modules/react-native-svg/android') include ':react-native-aztec' - project(':react-native-aztec').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/react-native-aztec/android') - include ':react-native-recyclerview-list' - project(':react-native-recyclerview-list').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/node_modules/react-native-recyclerview-list/android') + project(':react-native-aztec').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/gutenberg/packages/react-native-aztec/android') include ':react-native-gutenberg-bridge' - project(':react-native-gutenberg-bridge').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/react-native-gutenberg-bridge/android') + project(':react-native-gutenberg-bridge').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/gutenberg/packages/react-native-bridge/android') include ':react-native-video' - project(':react-native-video').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/node_modules/react-native-video/android-exoplayer') + project(':react-native-video').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/gutenberg/node_modules/react-native-video/android-exoplayer') include ':@react-native-community_slider' - project(':@react-native-community_slider').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/node_modules/@react-native-community/slider/src/android') + project(':@react-native-community_slider').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/gutenberg/node_modules/@react-native-community/slider/src/android') + include ':react-native-get-random-values' + project(':react-native-get-random-values').projectDir = new File(rootProject.projectDir, 'libs/gutenberg-mobile/gutenberg/node_modules/react-native-get-random-values/android') }