Skip to content

Commit

Permalink
[HotFix] Release/1.0.0-beta9 (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarari authored Apr 1, 2023
1 parent fec4471 commit 66752eb
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 30 deletions.
27 changes: 27 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,37 @@ jobs:
- run:
name: publish
command: ./gradlew publishToGradlePortal --info --stacktrace
deploy-docs:
machine:
image: ubuntu-2004:202201-02
steps:
- checkout
- run:
name: deploy-docs
command: |
printf "\n\n\n --------- update apt --------- \n"
sudo apt update
printf "\n\n\n --------- install python3 ---------- \n"
sudo apt install python3-pip
pip3 --version
printf "\n\n\n --------- install git --------- \n"
sudo apt install git
printf "\n\n\n --------- install mkdocs -------- \n"
pip3 install mkdocs
mkdocs --version
printf "\n\n\n --------- install mkdocs-material --------- \n"
pip3 install mkdocs-material
printf "\n\n\n --------- deploy --------- \n"
mkdocs gh-deploy
workflows:
build-workflow:
jobs:
- build
- deploy-docs:
filters:
branches:
only:
- main
- publish:
filters:
branches:
Expand Down
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

## 1.0.0-beta9
* Fix critical issues

## 1.0.0-beta8
* [Feature 81](https://github.com/janbarari/gradle-analytics-plugin/issues/81)
* Used/Available worker count added in console report
Expand Down
12 changes: 6 additions & 6 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-beta8"
id("io.github.janbarari.gradle-analytics-plugin") version "1.0.0-beta9"
}
```
=== "Groovy"
``` groovy
plugins {
id 'io.github.janbarari.gradle-analytics-plugin' version '1.0.0-beta8'
id 'io.github.janbarari.gradle-analytics-plugin' version '1.0.0-beta9'
}
```
[For legacy plugin application, see the Gradle Plugin Portal.](https://plugins.gradle.org/plugin/io.github.janbarari.gradle-analytics-plugin)
Expand All @@ -56,7 +56,7 @@ Add plugin configuration in the root of your project.
=== "Kotlin"
``` kotlin
gradleAnalyticsPlugin {
isEnabled = true // Optional: By default it's True.
enabled = true // Optional: By default it's True.

database {
local = sqlite {
Expand Down Expand Up @@ -90,15 +90,15 @@ Add plugin configuration in the root of your project.
// Optional: Exclude modules that are not necessary like test or demo modules
excludeModules = setOf()

isTrackAllBranchesEnabled = false // Optional: Default is False.
trackAllBranchesEnabled = false // Optional: Default is False.

outputPath = "OUTPUT_REPORT_PATH" // Optional: Default is project /build/ dir.
}
```
=== "Groovy"
``` groovy
gradleAnalyticsPlugin {
isEnabled = true // Optional: By default it's True.
enabled = true // Optional: By default it's True.

database {
local = sqlite {
Expand Down Expand Up @@ -132,7 +132,7 @@ Add plugin configuration in the root of your project.
// Optional: Exclude modules that are not necessary like test or demo modules
excludeModules = []

isTrackAllBranchesEnabled = false // Optional: Default is False.
trackAllBranchesEnabled = false // Optional: Default is False.

outputPath = 'OUTPUT_REPORT_PATH' // Optional: Default is project /build/ dir.
}
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-beta8
pluginVersion = 1.0.0-beta9
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class GradleAnalyticsPlugin @Inject constructor(

companion object {
const val PLUGIN_NAME = "gradleAnalyticsPlugin"
const val PLUGIN_VERSION = "1.0.0-beta8"
const val PLUGIN_VERSION = "1.0.0-beta9"
const val OUTPUT_DIRECTORY_NAME = "gradle-analytics-plugin"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ open class GradleAnalyticsPluginConfig(val project: Project) {

private var databaseConfig: DatabaseConfig = DatabaseConfig()

var isEnabled: Boolean = true
var enabled: Boolean = true

var trackingTasks: Set<String> = setOf()

Expand All @@ -46,7 +46,7 @@ open class GradleAnalyticsPluginConfig(val project: Project) {
* Tracing all branches has disabled by default during to the significant drawback
* it creates in the database, especially for temporary branches.
*/
var isTrackAllBranchesEnabled: Boolean = false
var trackAllBranchesEnabled: Boolean = false

var outputPath: String = project.rootProject.buildDir.absolutePath

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ data class BuildMetric(
var modulesTimelineMetric: ModulesTimelineMetric? = null

@Transient
var gradleWorkers: Pair<Int, Int> = 0 to 0
var maximumWorkerCount: Int = 0

fun getLog(): String {
return buildString {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import io.github.janbarari.gradle.utils.DependencyGraphGenerator
import org.gradle.api.Project
import org.gradle.api.internal.GradleInternal
import org.gradle.build.event.BuildEventsListenerRegistry
import oshi.SystemInfo
import java.util.*

@ExcludeJacocoGenerated
Expand All @@ -60,9 +59,7 @@ object BuildScanner {
registry: BuildEventsListenerRegistry,
configuration: GradleAnalyticsPluginConfig
) {
val systemProcessor = SystemInfo().hardware.processor
val availableWorkerCount = project.gradle.startParameter.maxWorkerCount
val maximumWorkerCount = systemProcessor.logicalProcessorCount + systemProcessor.physicalProcessorCount
val maximumWorkerCount = project.gradle.startParameter.maxWorkerCount

project.gradle.projectsEvaluated {
val nonCacheableTasks = Collections.synchronizedList(mutableListOf<String>())
Expand All @@ -84,16 +81,15 @@ object BuildScanner {
BuildExecutionService::class.java
) { spec ->
with(spec.parameters) {
enabled.set(configuration.isEnabled)
enabled.set(configuration.enabled)
databaseConfig.set(configuration.getDatabaseConfig())
envCI.set(envCI())
requestedTasks.set(project.gradle.getRequestedTasks())
trackingTasks.set(configuration.trackingTasks)
trackingBranches.set(configuration.trackingBranches)
trackAllBranchesEnabled.set(configuration.isTrackAllBranchesEnabled)
trackAllBranchesEnabled.set(configuration.trackAllBranchesEnabled)
outputPath.set(configuration.outputPath)
this.maximumWorkerCount.set(maximumWorkerCount)
this.availableWorkerCount.set(availableWorkerCount)
this.modules.set(modules)
this.modulesDependencyGraph.set(modulesDependencyGraph)
this.nonCacheableTasks.set(nonCacheableTasks)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ fun BuildExecutionInjector.provideBuildExecutionLogic(): BuildExecutionLogic {
tower = provideTower(),
requestedTasks = parameters.requestedTasks.get(),
modules = parameters.modules.get(),
gradleWorker = parameters.availableWorkerCount.get() to parameters.maximumWorkerCount.get(),
maximumWorkerCount = parameters.maximumWorkerCount.get(),
saveMetricUseCase = provideSaveMetricUseCase(),
saveTemporaryMetricUseCase = provideSaveTemporaryMetricUseCase(),
upsertModulesTimelineUseCase = provideUpsertModulesTimelineUseCase(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class BuildExecutionLogicImp(
private val tower: Tower,
private val requestedTasks: List<String>,
private val modules: Set<Module>,
private val gradleWorker: Pair<Int, Int>,
private val maximumWorkerCount: Int,
private val saveMetricUseCase: SaveMetricUseCase,
private val saveTemporaryMetricUseCase: SaveTemporaryMetricUseCase,
private val upsertModulesTimelineUseCase: UpsertModulesTimelineUseCase,
Expand Down Expand Up @@ -171,7 +171,7 @@ class BuildExecutionLogicImp(
)
)

buildMetric.gradleWorkers = gradleWorker
buildMetric.maximumWorkerCount = maximumWorkerCount

saveTemporaryMetricUseCase.execute(buildMetric)
saveMetricUseCase.execute(buildMetric)
Expand Down Expand Up @@ -209,10 +209,7 @@ class BuildExecutionLogicImp(
printLine(left = "Overall Build Process:", right = "${buildMetric.overallBuildProcessMetric?.median}ms")
printLine(left = "Cache Hit:", right = "${buildMetric.cacheHitMetric?.rate}%")
printLine(left = "Parallel Execution Rate:", right = "${buildMetric.parallelExecutionRateMetric?.medianRate}%")
printLine(
left = "Used/Available Worker Count:",
right = "${buildMetric.gradleWorkers.first}/${buildMetric.gradleWorkers.second}"
)
printLine(left = "Maximum Worker Count:", right = "${buildMetric.maximumWorkerCount}")
printBreakLine(char = '-')
printLine(left = "Datetime:", right = DateTimeUtils.formatToDateTime(buildMetric.createdAt))
printBreakLine(char = '-')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ abstract class BuildExecutionService : BuildService<BuildExecutionService.Params
val modulesDependencyGraph: Property<ModulesDependencyGraph>
val nonCacheableTasks: SetProperty<String>
val outputPath: Property<String>
val availableWorkerCount: Property<Int>
val maximumWorkerCount: Property<Int>
}

Expand Down Expand Up @@ -181,8 +180,7 @@ abstract class BuildExecutionService : BuildService<BuildExecutionService.Params
tower.r("ci: ${parameters.envCI.get()}")
tower.r("tracking tasks count: ${parameters.trackingTasks.get().size}")
tower.r("tracking branches count: ${parameters.trackingBranches.get().size}")
tower.r("available/maximum worker count: " +
"${parameters.availableWorkerCount.get()}/${parameters.maximumWorkerCount.get()}")
tower.r("maximum worker count: " + "${parameters.maximumWorkerCount.get()}")

printConfigurationNotices()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ class BuildExecutionLogicTest {
override val nonCacheableTasks: SetProperty<String>
get() = MockSetProperty(mutableSetOf())
override val outputPath: Property<String> = MockProperty("./build")
override val availableWorkerCount: Property<Int>
get() = MockProperty(0)
override val maximumWorkerCount: Property<Int>
get() = MockProperty(0)
}
Expand Down

0 comments on commit 66752eb

Please sign in to comment.