Skip to content

Commit 1632b06

Browse files
committed
Android plugin restructure: link local plugin, update Gradle include, Vite alias, and gitignore
- package.json: use link:./capacitor-plugins/betaflight-serial - vite.config.js: alias to local plugin ESM - .gitignore: ignore capacitor-plugins/*/android/bin/ - android/capacitor.settings.gradle: include :capacitor-plugin-betaflight-serial at ../capacitor-plugins/betaflight-serial/android - ran yarn android:sync to update settings
1 parent a0b1093 commit 1632b06

File tree

22 files changed

+69
-6
lines changed

22 files changed

+69
-6
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ capacitor.config.json
4848
# Ignore Gradle build output directory
4949
build
5050

51-
# Ignore capcitor android build output directory
52-
capacitor-plugin-betaflight-serial/android/bin/
51+
# Ignore Capacitor Android build output directories for local plugins
52+
capacitor-plugins/*/android/bin/
5353

android/capacitor.settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ include ':capacitor-android'
33
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
44

55
include ':capacitor-plugin-betaflight-serial'
6-
project(':capacitor-plugin-betaflight-serial').projectDir = new File('../capacitor-plugin-betaflight-serial/android')
6+
project(':capacitor-plugin-betaflight-serial').projectDir = new File('../capacitor-plugins/betaflight-serial/android')
File renamed without changes.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
ext {
2+
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
4+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
5+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
6+
}
7+
8+
buildscript {
9+
repositories {
10+
google()
11+
mavenCentral()
12+
}
13+
dependencies {
14+
classpath 'com.android.tools.build:gradle:8.2.1'
15+
}
16+
}
17+
18+
apply plugin: 'com.android.library'
19+
20+
android {
21+
namespace "com.betaflight.plugin.serial"
22+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
23+
defaultConfig {
24+
minSdk project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
25+
targetSdk project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
26+
versionCode 1
27+
versionName "1.0"
28+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
29+
}
30+
buildTypes {
31+
release {
32+
minifyEnabled false
33+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
34+
}
35+
}
36+
lintOptions {
37+
abortOnError false
38+
}
39+
compileOptions {
40+
sourceCompatibility JavaVersion.VERSION_17
41+
targetCompatibility JavaVersion.VERSION_17
42+
}
43+
}
44+
45+
repositories {
46+
google()
47+
mavenCentral()
48+
maven { url 'https://jitpack.io' }
49+
}
50+
51+
dependencies {
52+
implementation fileTree(dir: 'libs', include: ['*.jar'])
53+
implementation project(':capacitor-android')
54+
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
55+
56+
// USB Serial for Android library - provides comprehensive USB-to-serial driver support
57+
implementation 'com.github.mik3y:usb-serial-for-android:3.8.0'
58+
59+
testImplementation "junit:junit:$junitVersion"
60+
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
61+
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
62+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-keep class com.betaflight.plugin.serial.** { *; }

0 commit comments

Comments
 (0)