Project reorganization (#5096)
* Rename AndroidConfig to Config * Move base AndroidManifest.xml * Make fallback icons into an Android module * Add example of how to only load a single extension in Gradle project
|
@ -1,4 +1,4 @@
|
|||
object AndroidConfig {
|
||||
object Config {
|
||||
const val compileSdk = 29
|
||||
const val minSdk = 16
|
||||
const val targetSdk = 29
|
|
@ -1,8 +1,8 @@
|
|||
apply plugin: 'org.jmailen.kotlinter'
|
||||
|
||||
android {
|
||||
compileSdkVersion AndroidConfig.compileSdk
|
||||
buildToolsVersion AndroidConfig.buildTools
|
||||
compileSdkVersion Config.compileSdk
|
||||
buildToolsVersion Config.buildTools
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
|
@ -12,27 +12,21 @@ android {
|
|||
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile "$rootDir/AndroidManifest.xml"
|
||||
manifest.srcFile "$rootDir/src/AndroidManifest.xml"
|
||||
java.srcDirs = ['src']
|
||||
resources.srcDirs = ['src']
|
||||
aidl.srcDirs = ['src']
|
||||
renderscript.srcDirs = ['src']
|
||||
res.srcDirs = ["$rootDir/res"]
|
||||
assets.srcDirs = ['assets']
|
||||
res.srcDirs = ['res']
|
||||
}
|
||||
release {
|
||||
res.srcDirs = ['res']
|
||||
manifest.srcFile "AndroidManifest.xml"
|
||||
}
|
||||
debug {
|
||||
res.srcDirs = ['res']
|
||||
manifest.srcFile "AndroidManifest.xml"
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion AndroidConfig.minSdk
|
||||
targetSdkVersion AndroidConfig.targetSdk
|
||||
minSdkVersion Config.minSdk
|
||||
targetSdkVersion Config.targetSdk
|
||||
applicationIdSuffix pkgNameSuffix
|
||||
versionCode extVersionCode
|
||||
versionName "$libVersion.$extVersionCode"
|
||||
|
@ -64,6 +58,7 @@ repositories {
|
|||
|
||||
dependencies {
|
||||
implementation project(":annotations")
|
||||
implementation project(":defaultRes")
|
||||
|
||||
// Lib 1.2, but using specific commit so we don't need to bump up the version
|
||||
compileOnly "com.github.tachiyomiorg:extensions-lib:a596412"
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<manifest package="eu.kanade.tachiyomi.extension.defaultres" />
|
|
@ -0,0 +1,24 @@
|
|||
plugins {
|
||||
id("com.android.library")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion(Config.compileSdk)
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion(Config.minSdk)
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
named("main") {
|
||||
manifest.srcFile("AndroidManifest.xml")
|
||||
res.setSrcDirs(listOf("res"))
|
||||
}
|
||||
}
|
||||
|
||||
libraryVariants.all {
|
||||
generateBuildConfigProvider?.configure {
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
|
@ -4,12 +4,12 @@ plugins {
|
|||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion(AndroidConfig.compileSdk)
|
||||
buildToolsVersion(AndroidConfig.buildTools)
|
||||
compileSdkVersion(Config.compileSdk)
|
||||
buildToolsVersion(Config.buildTools)
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion(AndroidConfig.minSdk)
|
||||
targetSdkVersion(AndroidConfig.targetSdk)
|
||||
minSdkVersion(Config.minSdk)
|
||||
targetSdkVersion(Config.targetSdk)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,12 +4,12 @@ plugins {
|
|||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion(AndroidConfig.compileSdk)
|
||||
buildToolsVersion(AndroidConfig.buildTools)
|
||||
compileSdkVersion(Config.compileSdk)
|
||||
buildToolsVersion(Config.buildTools)
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion(AndroidConfig.minSdk)
|
||||
targetSdkVersion(AndroidConfig.targetSdk)
|
||||
minSdkVersion(Config.minSdk)
|
||||
targetSdkVersion(Config.targetSdk)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
include(":annotations")
|
||||
include(":defaultRes")
|
||||
|
||||
include(":lib-ratelimit")
|
||||
project(":lib-ratelimit").projectDir = File("lib/ratelimit")
|
||||
|
@ -9,6 +10,7 @@ project(":duktape-stub").projectDir = File("lib/duktape-stub")
|
|||
include(":lib-dataimage")
|
||||
project(":lib-dataimage").projectDir = File("lib/dataimage")
|
||||
|
||||
// Loads all extensions
|
||||
File(rootDir, "src").eachDir { dir ->
|
||||
dir.eachDir { subdir ->
|
||||
val name = ":${dir.name}-${subdir.name}"
|
||||
|
@ -17,6 +19,12 @@ File(rootDir, "src").eachDir { dir ->
|
|||
}
|
||||
}
|
||||
|
||||
// Use this to load a single extension during development
|
||||
// val lang = "all"
|
||||
// val name = "mmrcms"
|
||||
// include(":${lang}-${name}")
|
||||
// project(":${lang}-${name}").projectDir = File("src/${lang}/${name}")
|
||||
|
||||
inline fun File.eachDir(block: (File) -> Unit) {
|
||||
listFiles()?.filter { it.isDirectory }?.forEach { block(it) }
|
||||
}
|
||||
|
|