You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/07/04 15:30:57 UTC
[GitHub] [cordova-plugin-camera] davidschreiber edited a comment on issue
#418: refactor: Migrate to AndroidX
davidschreiber edited a comment on issue #418: refactor: Migrate to AndroidX
URL: https://github.com/apache/cordova-plugin-camera/pull/418#issuecomment-508519820
This is great @janpio! Thanks a lot for the update. Work on this PR has long been overdue on my end 🙈
The easiest way to manually test the plugin is using the projects `tests/` sub projects. You can quickly create a test application using this:
```shell
# Clone the project, since cordova CLI does not support plugins from sub directories.
git clone https://github.com/davidschreiber/cordova-plugin-camera.git && cd cordova-plugin-camera && git checkout davidschreiber/androidx-migration && cd ..
# Create a test project.
cordova create androidx-camera-test com.example.cordovacameratest androidx-camera-test
cd androidx-camera-test
# Add Android platform support
cordova platform add android
# Add the test dependencies
cordova plugin add cordova-plugin-test-framework
cordova plugin add ../cordova-plugin-camera/tests
# Add the plugin itself
cordova plugin add ../cordova-plugin-camera
# Enable AndroidX inside the project
cordova plugin add cordova-plugin-androidx
# Set the entrypoint of the app to start the tests.
sed -i '' 's/index.html/cdvtests\/index.html/g' config.xml
# Build and run
cordova run android
```
You should now see the Jasmine test framework and can run the automated and manual tests of the plugin and verify that stuff behaves as it should.
Alternatively, if you want to test the current stable version of the plugin, you can run it like so:
```shell
git clone https://github.com/apache/cordova-plugin-camera.git && cd cordova-plugin-camera && git checkout 4.1.0 && cd ..
cordova create androidx-camera-test com.example.cordovacameratest androidx-camera-test
cd androidx-camera-test
cordova platform add android
cordova plugin add cordova-plugin-test-framework
cordova plugin add ../cordova-plugin-camera/tests
cordova plugin add ../cordova-plugin-camera
cordova plugin add cordova-plugin-androidx
sed -i '' 's/index.html/cdvtests\/index.html/g' config.xml
cordova run android
```
This will yield a build error due to the sources of the stable version still referencing old Support Library classes
```
...
> Task :app:compileDebugJavaWithJavac FAILED
/Users/davidschreiber-ranner/temp/androidx-update-test/platforms/android/app/src/main/java/org/apache/cordova/camera/CameraLauncher.java:64: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
...
```
I hope this helps to verify that the changes in this PR are good to go. Please let me know if I can do anything else here.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org