Skip to content

Commit a85e48a

Browse files
fix. update issue
1 parent 0d3e009 commit a85e48a

File tree

3 files changed

+86
-3
lines changed

3 files changed

+86
-3
lines changed

scripts/build.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ try {
112112

113113
execSync("node ./utils/loadStyles.js", { stdio: "inherit" });
114114

115-
//syncing is not important
116-
//execSync("npm run sync", { stdio: "inherit" });
115+
execSync("npm run sync", { stdio: "inherit" });
117116

118117
// Final Gradle command
119118
const gradleTask = `assemble${normalizedType}${normalizedMode}`;

scripts/correct-build.gradle

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
//do not edit this file if you are seeing this in the adroid project instead edit the file in $(npm prefix)/scripts/correct-build.gradle
2+
3+
4+
ext {
5+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
6+
cordovaAndroidVersion = project.hasProperty('cordovaAndroidVersion') ? rootProject.ext.cordovaAndroidVersion : '10.1.1'
7+
}
8+
9+
buildscript {
10+
repositories {
11+
google()
12+
mavenCentral()
13+
}
14+
dependencies {
15+
classpath 'com.android.tools.build:gradle:8.7.2'
16+
}
17+
}
18+
19+
apply plugin: 'com.android.library'
20+
21+
android {
22+
buildFeatures {
23+
buildConfig true
24+
}
25+
namespace "capacitor.cordova.android.plugins"
26+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
27+
defaultConfig {
28+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
29+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
30+
versionCode 1
31+
versionName "1.0"
32+
}
33+
lintOptions {
34+
abortOnError false
35+
}
36+
compileOptions {
37+
sourceCompatibility JavaVersion.VERSION_21
38+
targetCompatibility JavaVersion.VERSION_21
39+
}
40+
}
41+
42+
repositories {
43+
google()
44+
mavenCentral()
45+
flatDir{
46+
dirs 'src/main/libs', 'libs'
47+
}
48+
}
49+
50+
dependencies {
51+
implementation 'com.sshtools:maverick-synergy-client:3.1.2'
52+
implementation fileTree(dir: 'src/main/libs', include: ['*.jar'])
53+
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
54+
implementation "org.apache.cordova:framework:$cordovaAndroidVersion"
55+
// SUB-PROJECT DEPENDENCIES START
56+
implementation "androidx.webkit:webkit:1.4.0"
57+
implementation "commons-net:commons-net:3.11.1"
58+
implementation "com.android.billingclient:billing:6.0.1"
59+
implementation "commons-io:commons-io:2.11.0"
60+
implementation "commons-codec:commons-codec:1.10"
61+
implementation "androidx.documentfile:documentfile:1.0.1"
62+
implementation "org.nanohttpd:nanohttpd:+"
63+
implementation "androidx.documentfile:documentfile:1.0.1"
64+
implementation "androidx.core:core:1.6.0"
65+
implementation "androidx.core:core-google-shortcuts:1.0.0"
66+
// SUB-PROJECT DEPENDENCIES END
67+
}
68+
69+
// PLUGIN GRADLE EXTENSIONS START
70+
apply from: "cordova.variables.gradle"
71+
apply from: "../../node_modules/cordova-plugin-buildinfo/src/android/BuildInfo.gradle"
72+
// PLUGIN GRADLE EXTENSIONS END
73+
74+
for (def func : cdvPluginPostBuildExtras) {
75+
func()
76+
}

scripts/postSync.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
const fs = require('fs');
22
const path = require('path');
3+
const { execSync } = require("child_process");
4+
5+
36

47
/**
58
* Recursively find all `build.gradle` files in the `android/` directory
@@ -29,6 +32,7 @@ function patchBuildGradle(filePath) {
2932
if(filePath.includes("/app/")){
3033
return
3134
}
35+
3236
let contents = fs.readFileSync(filePath, 'utf8');
3337

3438
if (!contents.includes('android {')) {
@@ -50,7 +54,11 @@ function patchBuildGradle(filePath) {
5054
console.log(`✅ Patched ${filePath}`);
5155
}
5256

53-
// Run it
57+
// Run
58+
execSync("cp -r $(npm prefix)/scripts/correct-build.gradle $(npm prefix)/android/capacitor-cordova-android-plugins/build.gradle", { stdio: "inherit" });
59+
console.log("Replaced build gradle file")
60+
61+
5462
const gradleFiles = findBuildGradleFiles(path.resolve('android'));
5563

5664
if (gradleFiles.length === 0) {

0 commit comments

Comments
 (0)