All Products
Search
Document Center

Compile and package

Last Updated: Mar 10, 2021

This topic describes how to compile and package mPaaS Inside projects.

Configure the packaging plug-in

mPaaS supports a near-native packaging mode by providing mPaaS Gradle plug-in. The mPaaS Gradle plug-in has two versions: the stable version and the beta version.

  • The stable version of the mPaaS Gradle plug-in is based on Android Gradle Plugin V3.0.1 and requires Gradle V4.4.

    1. classpath 'com.alipay.android:android-gradle-plugin:3.0.0.9.13
  • The beta version of the mPaaS Gradle plug-in is based on Android Gradle Plugin V3.5.3. mPaaS Gradle V3.5.x is provided.

  1. classpath 'com.alipay.android:android-gradle-plugin:3.5.14'
Note: Use the beta version only when necessary. When you use the beta version, remove apply plugin:'com.android.application'.

Introduce plug-ins

If your project is created by using the Android Studio mPaaS plug-in or converted from a native project, you only need to check whether the following steps are already completed.

  1. Introduce the following plug-ins to the build.gradle file in the root directory of your project.
  1. classpath 'com.android.boost.easyconfig:easyconfig:2.4.8'
  2. classpath 'com.alipay.android:android-gradle-plugin:3.0.0.9.13' // You can also use the beta version.
  1. Use the plug-ins in the main project.

    ```

apply plugin: ‘com.alipay.portal’apply plugin: ‘com.alipay.apollo.baseline.update’portal {allSlinks truemergeAssets true}mpaascomponents{// Add the mPaaS bundles that you do not need (if any) to this array.excludeDependencies=[“com.alipay.android.phone.thirdparty:androidsupport-build”]}

  1. Step 3: Make sure that the gradle.properties file contains `quinoxless=true`.
  2. Step 4: Make sure that the root directory contains the mpaas_packages.json file. If the root directory does not contain the file, use the Android Studio mPaaS plug-in to install the baseline. For more information, see **mPaaS** > **Upgrade the baseline**.
  3. ## Package
  4. You can use the Build button provided by Android Studio to directly package, or you can use Gradle Wrapper to run the following command to package in script mode.

./gradlew clean assembleDebug

```