microsoftconnect / ms-intune-app-sdk-android

Intune App SDK for Android enables data protection features and mobile app management via Microsoft Intune
41 stars 17 forks source link

[Question] How to force verification problems (so the tool can be integrated into CI pipeline)? #229

Closed sn-michiyo closed 2 months ago

sn-michiyo commented 2 months ago

Intune Android App SDK [Gradle Build Plugin] Issue

Questions to Ask Before Submission

  1. Does your app compile and launch successfully without the Intune App SDK? Yes
  2. Have you checked the [Microsoft Intune App SDK for Android] repository for similar issues? Yes
  3. Are you using the latest version of the [SDK and Plugin]? version 10.0.0 of both

Summary

Our app integrates the Android Intune SDK. We saw the verification tool. This looks extremely useful; we would like to integrate it into our CI pipeline. To do so, we need to force it to detect an error so we can make sure that CI will report the error to us.

We have been unable to get verify to fail. We learned in https://github.com/msintuneappsdk/ms-intune-app-sdk-android/issues/225 that using the incorrect javassist version will not be detected by this plugin. How can we force a problem that verify is able to detect?

Details

Logs

NA

ChismanRaheem commented 2 months ago

Hi @sn-michiyo Thank you for reaching out on this topic I have confirmed that the option "Verify" is intended to detect potential plugin bugs, and not application bugs. So, enabling this feature will result in a build time error, instead of a runtime crash. As of now you are not able to manually generate a failed verify. ref: https://learn.microsoft.com/en-us/mem/intune/developer/app-sdk-android-phase3#verification

intunemam {
    verify = true
}

**Example Sequence/response from Gradle Build output --debug:

2024-04-30T12:39:37.203-0700 [WARN] [com.microsoft.intune.mam.BuildTimeMamifier] **Verifying classes**
2024-04-30T12:39:37.203-0700 [INFO] [com.microsoft.intune.mam.TransformationUnit] **Verifying classes for** C:\Users\ChismanRaheem\.gradle\<plugins*>
2024-04-30T12:39:45.647-0700 [INFO] [com.microsoft.intune.mam.BuildTimeMamifier] **verification took 8 seconds**