avoiding versioned plugins and making the buildSrc the main plugin classloader

This commit is contained in:
Adam Brown 2022-12-11 15:06:05 +00:00
parent 7e1ff25968
commit 5ddd407884
34 changed files with 128 additions and 98 deletions

View File

@ -6,66 +6,16 @@ plugins {
applyCrashlyticsIfRelease() applyCrashlyticsIfRelease()
android { android {
ndkVersion "25.0.8141415" namespace "app.dapk.st"
defaultConfig {
applicationId "app.dapk.st"
def versionJson = new groovy.json.JsonSlurper().parseText(rootProject.file('version.json').text)
versionCode versionJson.code
versionName versionJson.name
if (isDebugBuild) {
resConfigs "en", "xxhdpi"
} else {
resConfigs "en"
}
if (isFoss()) {
archivesBaseName = "$archivesBaseName-foss"
}
}
bundle {
abi.enableSplit true
density.enableSplit true
language.enableSplit true
}
buildTypes { buildTypes {
debug {
versionNameSuffix = " [debug]"
matchingFallbacks = ['release']
signingConfig.storeFile rootProject.file("tools/debug.keystore")
}
release { release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
'proguard/app.pro', 'proguard/app.pro',
"proguard/serializationx.pro", "proguard/serializationx.pro",
"proguard/olm.pro" "proguard/olm.pro"
if (project.hasProperty("unsigned")) {
// releases are signed externally
} else {
signingConfig = buildTypes.debug.signingConfig
}
} }
} }
compileOptions {
coreLibraryDesugaringEnabled true
}
packagingOptions {
resources.excludes += "DebugProbesKt.bin"
}
}
if (isDebugBuild) {
androidComponents {
def release = selector().withBuildType("release")
beforeVariants(release) { it.enabled = false }
}
} }
dependencies { dependencies {

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="app.dapk.st">
<application> <application>
<meta-data <meta-data

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="app.dapk.st">
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/> <uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>

View File

@ -6,6 +6,18 @@ def launchTask = getGradle()
ext.isReleaseBuild = launchTask.contains("bundlerelease") || launchTask.contains("assemblerelease") ext.isReleaseBuild = launchTask.contains("bundlerelease") || launchTask.contains("assemblerelease")
ext.isDebugBuild = !isReleaseBuild ext.isDebugBuild = !isReleaseBuild
subprojects {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = [
'-opt-in=kotlin.contracts.ExperimentalContracts',
'-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi',
]
}
}
}
task clean(type: Delete) { task clean(type: Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }

View File

@ -8,7 +8,6 @@ repositories {
} }
dependencies { dependencies {
println(libs.versions.android.gp.get()) implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${libs.versions.kotlin.get()}")
implementation "com.android.tools.build:gradle:${libs.versions.android.gp.get()}" implementation "com.android.tools.build:gradle:${libs.versions.android.gp.get()}"
// implementation "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20"
} }

View File

@ -3,7 +3,9 @@ plugins {
} }
android { android {
buildFeatures.compose = true buildFeatures {
compose = true
}
composeOptions { composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
} }

View File

@ -1,18 +1,7 @@
plugins { plugins {
// id "kotlin-android" id "kotlin-android"
} }
//
//tasks.withType(Class.forName("org.jetbrains.kotlin.gradle.tasks.KotlinCompile.KotlinCompile")).configureEach {
// kotlinOptions {
// jvmTarget = "1.8"
// freeCompilerArgs = [
// '-opt-in=kotlin.contracts.ExperimentalContracts',
// '-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi',
// ]
// }
//}
def androidSdkVersion = 33 def androidSdkVersion = 33
android { android {

View File

@ -2,3 +2,63 @@ plugins {
id "com.android.application" id "com.android.application"
id "st-android-conventions" id "st-android-conventions"
} }
android {
ndkVersion "25.0.8141415"
defaultConfig {
applicationId "app.dapk.st"
def versionJson = new groovy.json.JsonSlurper().parseText(rootProject.file('version.json').text)
versionCode versionJson.code
versionName versionJson.name
if (isDebugBuild) {
resConfigs "en", "xxhdpi"
} else {
resConfigs "en"
}
if (isFoss()) {
archivesBaseName = "$archivesBaseName-foss"
}
}
bundle {
abi.enableSplit true
density.enableSplit true
language.enableSplit true
}
buildTypes {
debug {
versionNameSuffix = " [debug]"
matchingFallbacks = ['release']
signingConfig.storeFile rootProject.file("tools/debug.keystore")
}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
if (project.hasProperty("unsigned")) {
// releases are signed externally
} else {
signingConfig = buildTypes.debug.signingConfig
}
}
}
compileOptions {
coreLibraryDesugaringEnabled true
}
packagingOptions {
resources.excludes += "DebugProbesKt.bin"
}
}
if (isDebugBuild) {
androidComponents {
def release = selector().withBuildType("release")
beforeVariants(release) { it.enabled = false }
}
}

@ -1 +1 @@
Subproject commit 3c8d06ad1c22bbca69718e9b9eef3c053b1a7c2d Subproject commit 8139eaaf57cee4ce9d0616d617e8aff7eb1480e3

View File

@ -1,5 +1,5 @@
plugins { plugins {
alias libs.plugins.kotlin id 'kotlin'
id 'java-test-fixtures' id 'java-test-fixtures'
} }

View File

@ -2,6 +2,10 @@ plugins {
id "st-android-compose-library-conventions" id "st-android-compose-library-conventions"
} }
android {
namespace "app.dapk.st.design"
}
dependencies { dependencies {
implementation project(":core") implementation project(":core")
implementation libs.compose.coil implementation libs.compose.coil

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="app.dapk.st.design"/>

View File

@ -1,5 +1,5 @@
plugins { plugins {
alias libs.plugins.kotlin id "kotlin"
} }
dependencies { dependencies {

View File

@ -1,5 +1,5 @@
plugins { plugins {
alias libs.plugins.kotlin id "kotlin"
id 'java-test-fixtures' id 'java-test-fixtures'
} }

View File

@ -1,3 +1,3 @@
plugins { plugins {
alias libs.plugins.kotlin id "kotlin"
} }

View File

@ -1,5 +1,5 @@
plugins { plugins {
alias libs.plugins.kotlin id "kotlin"
id 'java-test-fixtures' id 'java-test-fixtures'
} }

View File

@ -1,5 +1,5 @@
plugins { plugins {
alias libs.plugins.kotlin id "kotlin"
} }
dependencies { dependencies {

View File

@ -1,5 +1,5 @@
plugins { plugins {
alias libs.plugins.kotlin id 'kotlin'
alias libs.plugins.kotlin.serialization alias libs.plugins.kotlin.serialization
alias libs.plugins.sqldelight alias libs.plugins.sqldelight
id 'java-test-fixtures' id 'java-test-fixtures'

View File

@ -2,6 +2,10 @@ plugins {
id "st-feature-conventions" id "st-feature-conventions"
} }
android {
namespace "app.dapk.st.directory"
}
dependencies { dependencies {
implementation project(":domains:android:compose-core") implementation project(":domains:android:compose-core")
implementation "chat-engine:chat-engine" implementation "chat-engine:chat-engine"

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="app.dapk.st.directory"/>

View File

@ -2,6 +2,10 @@ plugins {
id "st-feature-conventions" id "st-feature-conventions"
} }
android {
namespace "app.dapk.st.home"
}
dependencies { dependencies {
implementation "chat-engine:chat-engine" implementation "chat-engine:chat-engine"
implementation project(":features:directory") implementation project(":features:directory")

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="app.dapk.st.home"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application> <application>
<activity android:name="app.dapk.st.home.MainActivity"/> <activity android:name="app.dapk.st.home.MainActivity"/>

View File

@ -2,6 +2,10 @@ plugins {
id "st-feature-conventions" id "st-feature-conventions"
} }
android {
namespace "app.dapk.st.login"
}
dependencies { dependencies {
implementation "chat-engine:chat-engine" implementation "chat-engine:chat-engine"
implementation project(":domains:android:compose-core") implementation project(":domains:android:compose-core")

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="app.dapk.st.login"/>

View File

@ -1,6 +1,10 @@
plugins { plugins {
id "st-feature-conventions" id "st-feature-conventions"
alias libs.plugins.kotlin.parcelize id "org.jetbrains.kotlin.plugin.parcelize"
}
android {
namespace "app.dapk.st.messenger"
} }
dependencies { dependencies {

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="app.dapk.st.messenger">
<application> <application>

View File

@ -1,6 +1,10 @@
plugins { plugins {
id "st-feature-conventions" id "st-feature-conventions"
alias libs.plugins.kotlin.parcelize id "org.jetbrains.kotlin.plugin.parcelize"
}
android {
namespace "app.dapk.st.navigator"
} }
dependencies { dependencies {

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="app.dapk.st.navigator"/>

View File

@ -2,9 +2,12 @@ plugins {
id "st-android-library-conventions" id "st-android-library-conventions"
} }
android {
namespace "app.dapk.st.notifications"
}
dependencies { dependencies {
implementation "chat-engine:chat-engine" implementation "chat-engine:chat-engine"
// implementation project(':domains:store')
implementation project(":domains:android:work") implementation project(":domains:android:work")
implementation project(':domains:android:push') implementation project(':domains:android:push')
implementation project(":domains:android:core") implementation project(":domains:android:core")
@ -13,7 +16,6 @@ dependencies {
implementation project(":features:messenger") implementation project(":features:messenger")
implementation project(":features:navigator") implementation project(":features:navigator")
implementation libs.kotlin.serialization implementation libs.kotlin.serialization
kotlinTest(it) kotlinTest(it)

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="app.dapk.st.notifications"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
</manifest> </manifest>

View File

@ -2,6 +2,10 @@ plugins {
id "st-feature-conventions" id "st-feature-conventions"
} }
android {
namespace "app.dapk.st.profile"
}
dependencies { dependencies {
implementation "chat-engine:chat-engine" implementation "chat-engine:chat-engine"
implementation project(":features:settings") implementation project(":features:settings")

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="app.dapk.st.profile"/>

@ -1 +1 @@
Subproject commit adb986fdfd81011978785de08b6faf37adba08aa Subproject commit 088fd0e720acf5bc23eb8458469e782c5c10fcc7

View File

@ -9,6 +9,7 @@ dependencyResolutionManagement {
apply from: "dependencies.gradle" apply from: "dependencies.gradle"
applyRepositories(it) applyRepositories(it)
} }
rootProject.name = "SmallTalk" rootProject.name = "SmallTalk"
includeBuild 'screen-state' includeBuild 'screen-state'