Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	docs/changelog.md
#	docs/setup.md
#	gradle.properties
#	src/main/kotlin/io/github/janbarari/gradle/analytics/GradleAnalyticsPlugin.kt
#	src/main/resources/res/styles.css
  • Loading branch information
janbarari committed Dec 4, 2022
2 parents 19227d7 + 44ac1a7 commit d778522
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 13 deletions.
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

# Changelog

## HotFix - 1.0.0-beta5
* [Issue 77](https://github.com/janbarari/gradle-analytics-plugin/issues/77)

## 1.0.0-beta4
* [Feature 45](https://github.com/janbarari/gradle-analytics-plugin/issues/45)
* [Issue 61](https://github.com/janbarari/gradle-analytics-plugin/issues/61)
Expand Down
4 changes: 2 additions & 2 deletions docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ Apply the Gradle Plugin to the root of your project.
=== "Kotlin"
``` kotlin
plugins {
id("io.github.janbarari.gradle-analytics-plugin") version "1.0.0-beta4"
id("io.github.janbarari.gradle-analytics-plugin") version "1.0.0-beta5"
}
```
=== "Groovy"
``` groovy
plugins {
id 'io.github.janbarari.gradle-analytics-plugin' version '1.0.0-beta4'
id 'io.github.janbarari.gradle-analytics-plugin' version '1.0.0-beta5'
}
```
[For legacy plugin application, see the Gradle Plugin Portal.](https://plugins.gradle.org/plugin/io.github.janbarari.gradle-analytics-plugin)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ pluginTags = kotlin,plugin,analytics,analysis,gradle,gradle-plugin,gradle-plugin
pluginImplementationClass = io.github.janbarari.gradle.analytics.GradleAnalyticsPlugin
pluginDeclarationName = gradleAnalyticsPlugin
pluginGroupPackageName = io.github.janbarari
pluginVersion = 1.0.0-beta4
pluginVersion = 1.0.0-beta5
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class GradleAnalyticsPlugin @Inject constructor(

companion object {
const val PLUGIN_NAME = "gradleAnalyticsPlugin"
const val PLUGIN_VERSION = "1.0.0-beta4"
const val PLUGIN_VERSION = "1.0.0-beta5"
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ package io.github.janbarari.gradle.analytics.scanner

import io.github.janbarari.gradle.analytics.domain.model.ModuleDependency
import io.github.janbarari.gradle.analytics.domain.model.ModulesDependencyGraph
import io.github.janbarari.gradle.extension.isDependingOnOtherProject
import io.github.janbarari.gradle.extension.isModuleProject
import org.gradle.api.Project
import org.gradle.api.artifacts.ProjectDependency

Expand All @@ -34,7 +34,7 @@ object DependencyGraphGenerator {
val dependencies = mutableListOf<ModuleDependency>()

project.subprojects.filter {
it.isDependingOnOtherProject()
it.isModuleProject()
}.forEach { subProject ->
subProject.configurations.forEach { configuration ->
configuration.dependencies.withType(ProjectDependency::class.java).forEach { dependency ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import io.github.janbarari.gradle.analytics.scanner.initialization.BuildInitiali
import io.github.janbarari.gradle.extension.envCI
import io.github.janbarari.gradle.extension.getNonCacheableTasks
import io.github.janbarari.gradle.extension.getRequestedTasks
import io.github.janbarari.gradle.extension.isDependingOnOtherProject
import io.github.janbarari.gradle.extension.isModuleProject
import io.github.janbarari.gradle.extension.whenEach
import io.github.janbarari.gradle.extension.whenNotNull
import org.gradle.api.Project
Expand Down Expand Up @@ -67,7 +67,7 @@ object ScannerUtils {
}

val modules = project.subprojects
.filter { it.isDependingOnOtherProject() }
.filter { it.isModuleProject() }
.map { it.toModule() }

val modulesDependencyGraph = DependencyGraphGenerator.generate(project)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ class BuildExecutionLogicImp(
if (buildMetric.modulesTimelineMetric.isNotNull())
upsertModulesTimelineUseCase.execute(buildInfo.branch to buildMetric.modulesTimelineMetric!!)

printBuildInfo(buildMetric)
if (isSuccessful) {
printBuildInfo(buildMetric)
}
}

private fun printBuildInfo(buildMetric: BuildMetric) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import io.github.janbarari.gradle.ExcludeJacocoGenerated
import org.gradle.api.DefaultTask
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.invocation.Gradle
import java.util.*

Expand Down Expand Up @@ -54,8 +53,15 @@ fun envCI(): Boolean {
* Check is project dependency has dependency to ProjectDependency type.
*/
@ExcludeJacocoGenerated
fun Project.isDependingOnOtherProject(): Boolean {
return configurations.any { configuration -> configuration.dependencies.any { it is ProjectDependency } }
fun Project.isModuleProject(): Boolean {
return plugins.hasPlugin("com.android.application") ||
plugins.hasPlugin("com.android.library") ||
plugins.hasPlugin("jvm") ||
plugins.hasPlugin("org.jetbrains.kotlin.jvm") ||
plugins.hasPlugin("java-library") ||
plugins.hasPlugin("org.gradle.java-library") ||
plugins.hasPlugin("org.gradle.java")

}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/res/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ td {
}

#container {
max-width: 1200px;
max-width: 1280px;
margin: auto;
}

Expand Down

0 comments on commit d778522

Please sign in to comment.