Commit Graph

3 Commits

Author SHA1 Message Date
Jose Olarte III
83ec604a4b fix(build): resolve Android build failures with Java 21 and Capacitor context
Fixed two build issues preventing Android plugin compilation:

1. Build script now builds from test app context instead of standalone
   - Capacitor Android is only available as a project dependency, not from Maven
   - Plugin must be built within a Capacitor app's Android project
   - Changed build_plugin_for_test_app() to build from test app's android/
     directory where Capacitor is available as :capacitor-android project

2. Added JVM arguments for Java 17+ KAPT compatibility
   - Java 21's module system blocks KAPT from accessing internal compiler classes
   - Added --add-opens flags to both org.gradle.jvmargs and kotlin.daemon.jvmargs
   - Kotlin compiler daemon runs separately and needs its own configuration
   - Applied to both plugin and test app gradle.properties files

These changes allow the plugin to build successfully with Java 21 and ensure
it's built in the correct context where Capacitor dependencies are available.
2025-12-31 12:53:02 +08:00
Matthew Raymer
d9bdeb6d02 refactor(android)!: restructure to standard Capacitor plugin layout
Restructure Android project from nested module layout to standard
Capacitor plugin structure following community conventions.

Structure Changes:
- Move plugin code from android/plugin/ to android/src/main/java/
- Move test app from android/app/ to test-apps/android-test-app/app/
- Remove nested android/plugin module structure
- Remove nested android/app test app structure

Build Infrastructure:
- Add Gradle wrapper files (gradlew, gradlew.bat, gradle/wrapper/)
- Transform android/build.gradle from root project to library module
- Update android/settings.gradle for standalone plugin builds
- Add android/gradle.properties with AndroidX configuration
- Add android/consumer-rules.pro for ProGuard rules

Configuration Updates:
- Add prepare script to package.json for automatic builds on npm install
- Update package.json version to 1.0.1
- Update android/build.gradle to properly resolve Capacitor dependencies
- Update test-apps/android-test-app/settings.gradle with correct paths
- Remove android/variables.gradle (hardcode values in build.gradle)

Documentation:
- Update BUILDING.md with new structure and build process
- Update INTEGRATION_GUIDE.md to reflect standard structure
- Update README.md to remove path fix warnings
- Add test-apps/BUILD_PROCESS.md documenting test app build flows

Test App Configuration:
- Fix android-test-app to correctly reference plugin and Capacitor
- Remove capacitor-cordova-android-plugins dependency (not needed)
- Update capacitor.settings.gradle path verification in fix script

BREAKING CHANGE: Plugin now uses standard Capacitor Android structure.
Consuming apps must update their capacitor.settings.gradle to reference
android/ instead of android/plugin/. This is automatically handled by
Capacitor CLI for apps using standard plugin installation.
2025-11-05 08:08:37 +00:00
Matthew Raymer
71e0f297ff refactor: improve build configuration and code organization
- Add build scripts for Android and iOS platforms
- Remove duplicate web implementation (src/web.ts)
- Add proper TypeScript configuration
- Add module documentation to index.ts
- Clean up package.json scripts

This commit improves the project structure and build process by:
1. Adding dedicated build scripts for native platforms
2. Removing redundant web implementation
3. Adding proper TypeScript configuration with strict mode
4. Improving code documentation
5. Organizing package.json scripts

The changes maintain backward compatibility while improving
the development experience and code quality.
2025-03-25 13:13:55 +00:00