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 compileSdk = 29
|
||||||
const val minSdk = 16
|
const val minSdk = 16
|
||||||
const val targetSdk = 29
|
const val targetSdk = 29
|
|
@ -1,8 +1,8 @@
|
||||||
apply plugin: 'org.jmailen.kotlinter'
|
apply plugin: 'org.jmailen.kotlinter'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion AndroidConfig.compileSdk
|
compileSdkVersion Config.compileSdk
|
||||||
buildToolsVersion AndroidConfig.buildTools
|
buildToolsVersion Config.buildTools
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
@ -12,27 +12,21 @@ android {
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
manifest.srcFile "$rootDir/AndroidManifest.xml"
|
manifest.srcFile "$rootDir/src/AndroidManifest.xml"
|
||||||
java.srcDirs = ['src']
|
java.srcDirs = ['src']
|
||||||
resources.srcDirs = ['src']
|
res.srcDirs = ['res']
|
||||||
aidl.srcDirs = ['src']
|
|
||||||
renderscript.srcDirs = ['src']
|
|
||||||
res.srcDirs = ["$rootDir/res"]
|
|
||||||
assets.srcDirs = ['assets']
|
|
||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
res.srcDirs = ['res']
|
|
||||||
manifest.srcFile "AndroidManifest.xml"
|
manifest.srcFile "AndroidManifest.xml"
|
||||||
}
|
}
|
||||||
debug {
|
debug {
|
||||||
res.srcDirs = ['res']
|
|
||||||
manifest.srcFile "AndroidManifest.xml"
|
manifest.srcFile "AndroidManifest.xml"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion AndroidConfig.minSdk
|
minSdkVersion Config.minSdk
|
||||||
targetSdkVersion AndroidConfig.targetSdk
|
targetSdkVersion Config.targetSdk
|
||||||
applicationIdSuffix pkgNameSuffix
|
applicationIdSuffix pkgNameSuffix
|
||||||
versionCode extVersionCode
|
versionCode extVersionCode
|
||||||
versionName "$libVersion.$extVersionCode"
|
versionName "$libVersion.$extVersionCode"
|
||||||
|
@ -64,6 +58,7 @@ repositories {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(":annotations")
|
implementation project(":annotations")
|
||||||
|
implementation project(":defaultRes")
|
||||||
|
|
||||||
// Lib 1.2, but using specific commit so we don't need to bump up the version
|
// Lib 1.2, but using specific commit so we don't need to bump up the version
|
||||||
compileOnly "com.github.tachiyomiorg:extensions-lib:a596412"
|
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 {
|
android {
|
||||||
compileSdkVersion(AndroidConfig.compileSdk)
|
compileSdkVersion(Config.compileSdk)
|
||||||
buildToolsVersion(AndroidConfig.buildTools)
|
buildToolsVersion(Config.buildTools)
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion(AndroidConfig.minSdk)
|
minSdkVersion(Config.minSdk)
|
||||||
targetSdkVersion(AndroidConfig.targetSdk)
|
targetSdkVersion(Config.targetSdk)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,12 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion(AndroidConfig.compileSdk)
|
compileSdkVersion(Config.compileSdk)
|
||||||
buildToolsVersion(AndroidConfig.buildTools)
|
buildToolsVersion(Config.buildTools)
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion(AndroidConfig.minSdk)
|
minSdkVersion(Config.minSdk)
|
||||||
targetSdkVersion(AndroidConfig.targetSdk)
|
targetSdkVersion(Config.targetSdk)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
include(":annotations")
|
include(":annotations")
|
||||||
|
include(":defaultRes")
|
||||||
|
|
||||||
include(":lib-ratelimit")
|
include(":lib-ratelimit")
|
||||||
project(":lib-ratelimit").projectDir = File("lib/ratelimit")
|
project(":lib-ratelimit").projectDir = File("lib/ratelimit")
|
||||||
|
@ -9,6 +10,7 @@ project(":duktape-stub").projectDir = File("lib/duktape-stub")
|
||||||
include(":lib-dataimage")
|
include(":lib-dataimage")
|
||||||
project(":lib-dataimage").projectDir = File("lib/dataimage")
|
project(":lib-dataimage").projectDir = File("lib/dataimage")
|
||||||
|
|
||||||
|
// Loads all extensions
|
||||||
File(rootDir, "src").eachDir { dir ->
|
File(rootDir, "src").eachDir { dir ->
|
||||||
dir.eachDir { subdir ->
|
dir.eachDir { subdir ->
|
||||||
val name = ":${dir.name}-${subdir.name}"
|
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) {
|
inline fun File.eachDir(block: (File) -> Unit) {
|
||||||
listFiles()?.filter { it.isDirectory }?.forEach { block(it) }
|
listFiles()?.filter { it.isDirectory }?.forEach { block(it) }
|
||||||
}
|
}
|
||||||
|
|