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:
		| @@ -1,4 +1,8 @@ | ||||
| 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 { | ||||
|   def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["VisionCamera_kotlinVersion"] | ||||
| @@ -73,7 +77,9 @@ repositories { | ||||
| } | ||||
|  | ||||
| android { | ||||
|   namespace "com.mrousavy.camera" | ||||
|   if (agpVersion >= 7) { | ||||
|     namespace "com.mrousavy.camera" | ||||
|   } | ||||
|  | ||||
|   // 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) | ||||
| @@ -107,6 +113,12 @@ android { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   sourceSets { | ||||
|     main { | ||||
|       manifest.srcFile androidManifestPath | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   compileOptions { | ||||
|     sourceCompatibility JavaVersion.VERSION_1_8 | ||||
|     targetCompatibility JavaVersion.VERSION_1_8 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user