fix: Set correct namespace in build.gradle
(#2104)
* fix: set correct namespace in build.gradle * chore: refactor Android project for compatibility with multiple Gradle versions --------- Co-authored-by: Marc Rousavy <me@mrousavy.com>
This commit is contained in:
parent
cc65ec26a9
commit
8f986a45ea
@ -1,4 +1,8 @@
|
|||||||
import java.nio.file.Paths
|
import java.nio.file.Paths
|
||||||
|
import com.android.Version
|
||||||
|
|
||||||
|
def agpVersion = Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()
|
||||||
|
def androidManifestPath = agpVersion >= 7 ? 'src/main/AndroidManifest.xml' : 'src/hasNamespace/AndroidManifest.xml'
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["VisionCamera_kotlinVersion"]
|
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["VisionCamera_kotlinVersion"]
|
||||||
@ -73,7 +77,9 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
if (agpVersion >= 7) {
|
||||||
namespace "com.mrousavy.camera"
|
namespace "com.mrousavy.camera"
|
||||||
|
}
|
||||||
|
|
||||||
// Used to override the NDK path/version on internal CI or by allowing
|
// Used to override the NDK path/version on internal CI or by allowing
|
||||||
// users to customize the NDK path/version from their root project (e.g. for M1 support)
|
// users to customize the NDK path/version from their root project (e.g. for M1 support)
|
||||||
@ -107,6 +113,12 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
manifest.srcFile androidManifestPath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
4
package/android/src/hasNamespace/AndroidManifest.xml
Normal file
4
package/android/src/hasNamespace/AndroidManifest.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.mrousavy.camera">
|
||||||
|
|
||||||
|
</manifest>
|
@ -1,4 +1,3 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
package="com.mrousavy.camera">
|
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
Loading…
Reference in New Issue
Block a user