-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move configuration of generator modules to precompiled script plugin (#3
- Loading branch information
1 parent
8ed2059
commit 6db8234
Showing
10 changed files
with
75 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...tlin/src/main/kotlin/ru.pixnews.anvil.codegen.build-logic.project.auto.service.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (c) 2024, the pixnews-anvil-codegen project authors and contributors. | ||
* Please see the AUTHORS file for details. | ||
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
*/ | ||
|
||
import org.jetbrains.kotlin.gradle.plugin.KotlinBasePlugin | ||
|
||
/** | ||
* Convention plugin that adds Auto-Service | ||
*/ | ||
plugins { | ||
`java-library` | ||
kotlin("kapt") | ||
} | ||
|
||
plugins.withType<KotlinBasePlugin> { | ||
dependencies { | ||
val libs = versionCatalogs.named("libs") | ||
compileOnly(libs.findLibrary("auto.service.annotations").get()) | ||
add("kapt", libs.findLibrary("auto.service.compiler").get()) | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
.../kotlin/src/main/kotlin/ru.pixnews.anvil.codegen.build-logic.project.generator.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2024, the pixnews-anvil-codegen project authors and contributors. | ||
* Please see the AUTHORS file for details. | ||
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
*/ | ||
|
||
import org.gradle.kotlin.dsl.accessors.runtime.addDependencyTo | ||
|
||
/** | ||
* Convention plugin for use in kotlin generator modules | ||
*/ | ||
plugins { | ||
id("ru.pixnews.anvil.codegen.build-logic.project.auto.service") | ||
id("ru.pixnews.anvil.codegen.build-logic.project.kotlin.library") | ||
id("ru.pixnews.anvil.codegen.build-logic.project.publish") | ||
id("ru.pixnews.anvil.codegen.build-logic.project.test") | ||
} | ||
|
||
dependencies { | ||
val libs = versionCatalogs.named("libs") | ||
|
||
api(libs.findLibrary("anvil.compiler.api").get()) | ||
addDependencyTo<ModuleDependency>( | ||
this, | ||
"implementation", | ||
libs.findLibrary("kotlinpoet").get().get(), | ||
) { | ||
exclude(module = "kotlin-reflect") | ||
} | ||
implementation(project(":common")) | ||
|
||
testImplementation(libs.findLibrary("anvil.annotations.optional").get()) | ||
testImplementation(libs.findLibrary("assertk").get()) | ||
testImplementation(libs.findLibrary("dagger").get()) | ||
testImplementation(project(":test-utils")) | ||
testImplementation(testFixtures(libs.findLibrary("anvil.compiler.utils").get())) | ||
} |
5 changes: 5 additions & 0 deletions
5
...in/src/main/kotlin/ru.pixnews.anvil.codegen.build-logic.project.kotlin.library.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters