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()
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
}
namespace "app.dapk.st"
buildTypes {
debug {
versionNameSuffix = " [debug]"
matchingFallbacks = ['release']
signingConfig.storeFile rootProject.file("tools/debug.keystore")
}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
'proguard/app.pro',
"proguard/serializationx.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 {

View File

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

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="app.dapk.st">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<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.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) {
delete rootProject.buildDir
}

View File

@ -8,7 +8,6 @@ repositories {
}
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 "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20"
}

View File

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

View File

@ -1,18 +1,7 @@
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
android {

View File

@ -2,3 +2,63 @@ plugins {
id "com.android.application"
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 {
alias libs.plugins.kotlin
id 'kotlin'
id 'java-test-fixtures'
}

View File

@ -2,6 +2,10 @@ plugins {
id "st-android-compose-library-conventions"
}
android {
namespace "app.dapk.st.design"
}
dependencies {
implementation project(":core")
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 {
alias libs.plugins.kotlin
id "kotlin"
}
dependencies {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,6 +2,10 @@ plugins {
id "st-feature-conventions"
}
android {
namespace "app.dapk.st.directory"
}
dependencies {
implementation project(":domains:android:compose-core")
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"
}
android {
namespace "app.dapk.st.home"
}
dependencies {
implementation "chat-engine:chat-engine"
implementation project(":features:directory")

View File

@ -1,5 +1,5 @@
<?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>
<activity android:name="app.dapk.st.home.MainActivity"/>

View File

@ -2,6 +2,10 @@ plugins {
id "st-feature-conventions"
}
android {
namespace "app.dapk.st.login"
}
dependencies {
implementation "chat-engine:chat-engine"
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 {
id "st-feature-conventions"
alias libs.plugins.kotlin.parcelize
id "org.jetbrains.kotlin.plugin.parcelize"
}
android {
namespace "app.dapk.st.messenger"
}
dependencies {

View File

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

View File

@ -1,6 +1,10 @@
plugins {
id "st-feature-conventions"
alias libs.plugins.kotlin.parcelize
id "org.jetbrains.kotlin.plugin.parcelize"
}
android {
namespace "app.dapk.st.navigator"
}
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"
}
android {
namespace "app.dapk.st.notifications"
}
dependencies {
implementation "chat-engine:chat-engine"
// implementation project(':domains:store')
implementation project(":domains:android:work")
implementation project(':domains:android:push')
implementation project(":domains:android:core")
@ -13,7 +16,6 @@ dependencies {
implementation project(":features:messenger")
implementation project(":features:navigator")
implementation libs.kotlin.serialization
kotlinTest(it)

View File

@ -1,4 +1,4 @@
<?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"/>
</manifest>

View File

@ -2,6 +2,10 @@ plugins {
id "st-feature-conventions"
}
android {
namespace "app.dapk.st.profile"
}
dependencies {
implementation "chat-engine:chat-engine"
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"
applyRepositories(it)
}
rootProject.name = "SmallTalk"
includeBuild 'screen-state'