Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.publish)
alias(libs.plugins.spotless)
alias(libs.plugins.wire) apply false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Convention : Plugin<Project> {
}

private companion object {
const val TOOLCHAIN_JDK = 17
const val TARGET_JDK = 11
const val TOOLCHAIN_JDK = 21
const val TARGET_JDK = 21
}
}
10 changes: 5 additions & 5 deletions gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.google.devtools.ksp.gradle.KspTaskJvm
import com.google.devtools.ksp.gradle.KspAATask
import com.squareup.wire.gradle.WireTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

Expand Down Expand Up @@ -72,15 +72,15 @@ val KOTLIN_VERSION = "${libs.versions.kotlin.get()}"
}

tasks.withType(KotlinCompile).configureEach { dependsOn(pluginVersion) }
tasks.withType(KspTaskJvm).configureEach { dependsOn(pluginVersion) }
tasks.withType(KspAATask).configureEach { dependsOn(pluginVersion) }

wire {
kotlin {}
}

// https://github.com/square/wire/issues/2335
afterEvaluate {
tasks.withType(KspTaskJvm).configureEach {
dependsOn(tasks.withType(WireTask))
}
tasks.withType(KspAATask).configureEach {
dependsOn(tasks.withType(WireTask))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ import com.android.build.api.variant.Variant
import com.android.build.gradle.internal.publishing.AndroidArtifacts
import com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask
import com.android.build.gradle.internal.tasks.factory.dependsOn
import com.google.devtools.ksp.gradle.KspTask
import com.google.devtools.ksp.gradle.KspTaskJvm
import com.google.devtools.ksp.gradle.KspAATask
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.ArtifactCollection
Expand Down Expand Up @@ -374,7 +373,7 @@ class BetterDynamicFeaturesPlugin : Plugin<Project> {
artifact.type = ARTIFACT_TYPE_FEATURE_IMPLEMENTATION_REPORT

// TODO: Try and do this lazily
tasks.withType(KspTaskJvm::class.java) { task ->
tasks.withType(KspAATask::class.java) { task ->
if (!kspTaskMatchesVariant(task, androidVariant)) return@withType

logger.debug("Configuring KSP task ${task.path} for variant ${androidVariant.name}")
Expand Down Expand Up @@ -468,6 +467,7 @@ class BetterDynamicFeaturesPlugin : Plugin<Project> {
taskName("compile", androidVariant, "Implementations"),
TypesafeImplementationsCompilationTask::class.java,
) { task ->
task.dependsOn(implementationsTask)
task.generatedSources.set(implementationsTask.flatMap { it.generatedFilesDirectory })
val compileConfiguration = setupVariantCodegenDependencies(androidVariant.buildType!!)
task.compileClasspath.setFrom(project.provider { compileConfiguration.files })
Expand All @@ -485,7 +485,7 @@ class BetterDynamicFeaturesPlugin : Plugin<Project> {
}
}

private fun kspTaskMatchesVariant(task: KspTask, variant: Variant): Boolean {
private fun kspTaskMatchesVariant(task: KspAATask, variant: Variant): Boolean {
return task.name.contains(variant.name, ignoreCase = true) && !task.name.contains("UnitTest", ignoreCase = true)
}

Expand Down
10 changes: 4 additions & 6 deletions gradle-plugin/src/test/fixtures/buildscript.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ project.buildscript.dependencies {
}

subprojects {
extensions.findByName("kotlin")?.jvmToolchain(17)

pluginManager.withPlugin("com.android.application") {
android.compileOptions {
sourceCompatibility(JavaVersion.VERSION_17)
targetCompatibility(JavaVersion.VERSION_17)
sourceCompatibility(JavaVersion.VERSION_21)
targetCompatibility(JavaVersion.VERSION_21)
}
}
pluginManager.withPlugin("com.android.dynamic-feature") {
android.compileOptions {
sourceCompatibility(JavaVersion.VERSION_17)
targetCompatibility(JavaVersion.VERSION_17)
sourceCompatibility(JavaVersion.VERSION_21)
targetCompatibility(JavaVersion.VERSION_21)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int

defaultConfig {
versionCode 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.dynamic-feature'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration.feature"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int

defaultConfig {
minSdk 24
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int
defaultConfig {
minSdk = 24

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.dynamic-feature'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration.feature"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int
defaultConfig {
minSdk = 24
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int

dynamicFeatures = [':feature']
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.dynamic-feature'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration.feature"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int

dynamicFeatures = [':feature']
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.dynamic-feature'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration.feature"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int

dynamicFeatures = [':feature']
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
apply plugin: 'com.android.dynamic-feature'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration.feature"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int

dynamicFeatures = [':feature']
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.dynamic-feature'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration.feature"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int

dynamicFeatures = [':feature']
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.dynamic-feature'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration.feature"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int

dynamicFeatures = [':feature']
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.dynamic-feature'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration.feature"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'
apply plugin: 'app.cash.better.dynamic.features.agp-patch'

android {
namespace "app.cash.better.dynamic.features.integration"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int
defaultConfig {
minSdk = 24

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ com.google.android.play:feature-delivery-ktx:2.1.0=debugCompileClasspath,debugRu
com.google.android.play:feature-delivery:2.1.0=debugCompileClasspath,debugRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath
com.squareup.okhttp3:okhttp:5.0.0-alpha.2=debugCompileClasspath,debugRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath
com.squareup.okio:okio:2.9.0=debugCompileClasspath,debugRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-common:2.1.20=debugCompileClasspath,debugRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-common:2.2.20=debugCompileClasspath,debugRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0=debugCompileClasspath,debugRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0=debugCompileClasspath,debugRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib:2.1.20=debugCompileClasspath,debugRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib:2.2.20=debugCompileClasspath,debugRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0=debugCompileClasspath,debugRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0=debugCompileClasspath,debugRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0=debugCompileClasspath,debugRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.dynamic-feature'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration.feature"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int
defaultConfig {
minSdk = 24
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int

dynamicFeatures = [':feature']
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.dynamic-feature'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'app.cash.better.dynamic.features'

android {
namespace "app.cash.better.dynamic.features.integration.feature"

compileSdk 32
compileSdk libs.versions.compileSdk.get() as int
}

dependencies {
Expand Down
Loading
Loading