Skip to content

Commit

Permalink
fix: IssueLinkTask cannot be registered in project with android-modul…
Browse files Browse the repository at this point in the history
…e parent (#75)

* fix: IssueLinkTask cannot be registered in project with android module parent

* chore: Update Gradle version to 6.6-rc-5
  • Loading branch information
mateuszkwiecinski authored Aug 4, 2020
1 parent 71697ab commit 4210fa8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## Changed
- Update _Detekt_ to version _1.11.0-RC1_ see [release notes](https://github.com/detekt/detekt/releases/tag/v1.11.0-RC1)
- Update _Android Gradle Plugin_ to 4.0.2, see [release notes](https://developer.android.com/studio/releases/gradle-plugin)

## Fixed
- IssueLinkTask cannot be registered in project with android-module parent

## [0.14.0] - 2020-08-01
## Changed
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-rc-4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-rc-5-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ internal fun Project.configureAndroidProject(variants: DomainObjectSet<out BaseV
internal inline fun <reified T> ExtensionContainer.getByType() =
getByType(T::class.java)

internal inline fun <reified T> ExtensionContainer.findByType() =
findByType(T::class.java)

internal inline fun <reified T> Project.withExtension(crossinline action: Project.(T) -> Unit) =
afterEvaluate {
it.action(it.extensions.getByType<T>())
it.action(it.extensions.getByType())
}

private fun BaseExtension.addKotlinSourceSets() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.project.starter.quality.plugins
import com.android.build.gradle.BaseExtension
import com.android.build.gradle.internal.tasks.factory.dependsOn
import com.project.starter.config.plugins.rootConfig
import com.project.starter.modules.internal.findByType
import com.project.starter.modules.internal.getByType
import com.project.starter.quality.tasks.IssueLinksTask.Companion.registerIssueCheckerTask
import com.project.starter.quality.internal.configureCheckstyle
Expand Down Expand Up @@ -32,8 +33,8 @@ class QualityPlugin : Plugin<Project> {

private fun Project.configureIssueCheckerTask() {
registerIssueCheckerTask {
if (project.hasProperty("android")) {
val extension = project.extensions.getByType<BaseExtension>()
val extension = project.extensions.findByType<BaseExtension>()
if (extension != null) {
extension.sourceSets.configureEach { sourceSet ->
source += sourceSet.java.srcDirs
.map { dir -> project.fileTree(dir) }
Expand Down

0 comments on commit 4210fa8

Please sign in to comment.