init
This commit is contained in:
commit
dc7af87493
132 changed files with 5659 additions and 0 deletions
48
android/build.gradle
Normal file
48
android/build.gradle
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = "../build"
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
}
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
project.evaluationDependsOn(':app') // Ensure dependencies are evaluated correctly
|
||||
|
||||
plugins.withId('com.android.library') {
|
||||
extensions.configure(com.android.build.gradle.LibraryExtension) { android ->
|
||||
|
||||
// Retrieve the manifest file path
|
||||
def manifestFile = android.sourceSets.main.manifest.srcFile
|
||||
|
||||
// Attempt to retrieve the package name from AndroidManifest.xml
|
||||
def packageName = null
|
||||
|
||||
if (manifestFile.exists()) {
|
||||
def manifestContent = new XmlParser().parse(file(manifestFile))
|
||||
packageName = manifestContent.@package
|
||||
}
|
||||
|
||||
// Ensure namespace is set with fallback logic
|
||||
if (!android.hasProperty("namespace") || android.namespace == null || android.namespace.isEmpty()) {
|
||||
if (packageName) {
|
||||
println ">> Derived Namespace for: '${project.name}' to '${packageName}'"
|
||||
android.namespace = packageName
|
||||
} else {
|
||||
// Set a default namespace if packageName is null
|
||||
def defaultNamespace = "com.example.${project.name}"
|
||||
println "?? Made up Namespace for: '${project.name}' to '${defaultNamespace}'"
|
||||
android.namespace = defaultNamespace
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("clean", Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue