Skip to content

Commit d59cd41

Browse files
dynamically find capacitor/android for build
1 parent 0fdc512 commit d59cd41

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1+
def capacitorAndroidPath = new ByteArrayOutputStream()
2+
exec {
3+
commandLine 'node', '-p', "require.resolve('@capacitor/android/package.json')"
4+
standardOutput = capacitorAndroidPath
5+
}
6+
def resolvedPath = capacitorAndroidPath.toString().trim().replaceAll('/package\\.json$', '')
7+
println "Resolved Capacitor Android path: ${resolvedPath}"
18
include ':capacitor-android'
2-
project(':capacitor-android').projectDir = new File('../../../node_modules/@capacitor/android/capacitor')
9+
project(':capacitor-android').projectDir = new File(resolvedPath + '/capacitor')

0 commit comments

Comments
 (0)