Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start using the project accessors plugin #147

Merged
merged 1 commit into from
Mar 29, 2024
Merged
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
2 changes: 2 additions & 0 deletions gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ plugins {
kotlin("jvm") version embeddedKotlinVersion
`kotlin-dsl`
`version-catalog`
alias(libs.plugins.projectAccessors)
}

dependencies {
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
implementation(libs.projectAccessors)
api(libs.shadow)
api(libs.android.gradlePlugin)
api(libs.dokka.gradlePlugin)
Expand Down
7 changes: 5 additions & 2 deletions gradle-plugin/src/main/kotlin/library.compiler.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

import co.hinge.gradle.projectaccessors.copy
import org.gradle.accessors.dm.LibrariesForLibs

plugins {
Expand All @@ -16,7 +17,9 @@ tasks.withType<Test>().configureEach {
}

dependencies {
implementation(project(":compiler:common", configuration = "shadow"))
implementation(projects.compiler.common.copy(
targetConfiguration = "shadow"
))
implementation(libs.javapoet)
implementation(libs.bundles.kotlinpoet)
implementation(libs.dagger)
Expand All @@ -30,5 +33,5 @@ dependencies {
implementation(libs.incap)
kapt(libs.incap.compiler)

testImplementation(project(":compiler:common:test-utils"))
testImplementation(projects.compiler.common.testUtils)
}
7 changes: 7 additions & 0 deletions gradle-plugin/src/main/kotlin/library.publishing.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -205,5 +205,12 @@ afterEvaluate {
dependsOn("classes")
from(project.extensions.getByType<SourceSetContainer>().getByName("main").allSource)
}
if (pluginManager.hasPlugin("java-test-fixture")) {
// Disables publishing test fixtures:
// https://docs.gradle.org/current/userguide/java_testing.html#ex-disable-publishing-of-test-fixtures-variants
val javaComponent = components["java"] as AdhocComponentWithVariants
javaComponent.withVariantsFromConfiguration(configurations["testFixturesApiElements"]) { skip() }
javaComponent.withVariantsFromConfiguration(configurations["testFixturesRuntimeElements"]) { skip() }
}
}
}
14 changes: 9 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ androidx-test = "1.5.0"
kotlinpoet = "1.16.0"
room = "2.6.1"
retrofit = "2.11.0"
projectAccessors = "1.1.0"

[plugins]
dagger-hilt = { id = "com.google.dagger.hilt.android", version.ref = "dagger" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
binaryCompatibilityValidator = "org.jetbrains.kotlinx.binary-compatibility-validator:0.14.0"
mkdocs = "ru.vyarus.mkdocs:3.0.0"
projectAccessors = { id = "co.hinge.gradle.project-accessors", version.ref = "projectAccessors" }

[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
Expand Down Expand Up @@ -59,13 +61,13 @@ dagger-hilt-android-testing = { module = "com.google.dagger:hilt-android-testing
dagger-hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "dagger" }
dagger-hilt-compiler = { module = "com.google.dagger:hilt-compiler", version.ref = "dagger" }

ksp-api = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp"}
ksp-api = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" }

incap = { module = "net.ltgt.gradle.incap:incap", version.ref = "incap" }
incap-compiler = { module = "net.ltgt.gradle.incap:incap-processor", version.ref = "incap" }

compileTesting = { module ="dev.zacsweers.kctfork:core", version.ref = "compileTesting" }
compileTesting-ksp = { module ="dev.zacsweers.kctfork:ksp", version.ref = "compileTesting" }
compileTesting = { module = "dev.zacsweers.kctfork:core", version.ref = "compileTesting" }
compileTesting-ksp = { module = "dev.zacsweers.kctfork:ksp", version.ref = "compileTesting" }

junit = "junit:junit:4.13.2"
junit-jupiter = "org.junit.jupiter:junit-jupiter:5.10.2"
Expand All @@ -78,8 +80,10 @@ testLogger = "com.adarshr:gradle-test-logger-plugin:4.0.0"

shadow = "com.github.johnrengelman:shadow:8.1.1"

room = { module ="androidx.room:room-ktx", version.ref = "room" }
room-compiler = { module ="androidx.room:room-compiler", version.ref = "room" }
room = { module = "androidx.room:room-ktx", version.ref = "room" }
room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }

projectAccessors = { module = "co.hinge.gradle.project-accessors:project-accessors", version.ref = "projectAccessors" }

[bundles]
compileTesting = ["compileTesting", "compileTesting-ksp"]
Expand Down
Loading