Skip to content

Commit

Permalink
Release 1.0.0-beta1 (#44)
Browse files Browse the repository at this point in the history
Merge Release 1.0.0-beta1
  • Loading branch information
janbarari authored Sep 27, 2022
1 parent fce3ce5 commit 4c7114a
Show file tree
Hide file tree
Showing 377 changed files with 34,969 additions and 39 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ orbs:
codecov: codecov/codecov@3.2.2
executor: machine
jobs:
test:
build:
machine:
image: ubuntu-2004:202201-02
steps:
- checkout
- run:
name: build
command: ./gradlew test
command: ./gradlew detekt assemble test --info --stacktrace
- codecov/upload:
file: build/reports/jacoco/test/*.xml
workflows:
build-workflow:
jobs:
- test
- build
41 changes: 41 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!-- Enter the issue number(ex: Issue-1) or task number(ex: R-8, F-1) -->
>
### Related Issue
<!--- If it fixes an open issue, please link to the issue here. -->
[Issue-X](https://github.com/janbarari/gradle-analytics-plugin/issues/X)

### Motivation and Context
<!--- Why is this change required? What problem does it solve? -->

### Description
<!-- Summarize the change and help the reviewer on important points -->

### Type of change
<!-- Choose the PR type, you can choose multiple types -->
- [ ] Feature
- [ ] POC
- [ ] Bug fix
- [ ] Hot fix
- [ ] Optimization
- [ ] Refactor
- [ ] Noref

### Checklist
- [ ] Are local unit tests passed?
- [ ] Is Detekt passed?
- [ ] Is code coverage affected?
- [ ] Is any new test added?
- [ ] Is CI workflow affected?
- [ ] Is a next refactor needed?

### How has this been tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

### Screenshots
<!-- Please put the screenshots here if it's exists -->
<!-- Use this template to scale down big images. -->
<!-- You'll get the link after image upload with Drag & Drop -->
<!-- <img src="https://img.png" width=45% height=45%> -->
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
.idea/
build/
.DS_Store
temporary-notes.txt
site/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Mehdi
Copyright (c) 2022 Mehdi Janbarari (@janbarari)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
17 changes: 5 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
<img src="plugin-logo.png" alt="plugin logo" width="128"/>

# Gradle Analytics Plugin
## Gradle Analytics Plugin
[![CircleCI](https://circleci.com/gh/janbarari/gradle-analytics-plugin/tree/develop.svg?style=svg)](https://circleci.com/gh/janbarari/gradle-analytics-plugin/tree/develop)
[![codecov](https://codecov.io/gh/janbarari/gradle-analytics-plugin/branch/develop/graph/badge.svg)](https://codecov.io/gh/janbarari/gradle-analytics-plugin)
<img src="https://img.shields.io/github/license/janbarari/gradle-analytics-plugin.svg?label=License"/>
<a href="https://github.com/janbarari/gradle-analytics-plugin">
<img src="https://img.shields.io/github/stars/janbarari/gradle-analytics-plugin.svg?label=Stars"/>
</a>
<a href="https://github.com/janbarari/gradle-analytics-plugin/issues/new?title=RF:">Request Feature</a> or <a href="https://github.com/janbarari/gradle-analytics-plugin/issues/new?title=RB:">Report Bug</a>
<br />
Hey 👋, Mark this repo in your browser, see you soon ;D
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=janbarari_gradle-analytics-plugin&metric=alert_status)](https://sonarcloud.io/dashboard?id=janbarari_gradle-analytics-plugin)

License
---
Copyright © 2022 [Janbarari](https://github.com/janbarari)
This project binaries and source code can be used according to the [MIT LICENSE](https://github.com/janbarari/gradle-analytics-plugin/blob/main/LICENSE).
A free Gradle plugin to analyze your project builds. It provides unique visual and text metrics in HTML format.

### Documentation is at <a href="https://janbarari.github.io/gradle-analytics-plugin">janbarari.github.io/gradle-analytics-plugin</a>
102 changes: 98 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,63 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

val pluginId: String by project
val pluginDisplayName: String by project
val pluginDescription: String by project
val pluginImplementationClass: String by project
val pluginDeclarationName: String by project
val pluginGroupPackageName: String by project
val pluginVersion: String by project
val pluginWebsite: String by project
val pluginVcsUrl: String by project
val pluginTags: String by project

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
kotlin("jvm") version "1.6.10"
kotlin("jvm") version(libs.versions.kotlin)
alias(libs.plugins.detekt)
`java-gradle-plugin`
`maven-publish`
jacoco
kotlin("kapt") version(libs.versions.kotlin)
id("com.gradle.plugin-publish") version "1.0.0-rc-1"
}

group = pluginGroupPackageName
version = pluginVersion

repositories {
mavenCentral()
}

dependencies {
testImplementation(kotlin("test"))
testImplementation(libs.mockk)

compileOnly(gradleApi())

implementation(kotlin("stdlib-jdk8"))
implementation(libs.sqlite.driver)
implementation(libs.mysql.driver)
implementation(libs.jetbrains.exposed.core)
implementation(libs.jetbrains.exposed.jdbc)
implementation(libs.moshi)
kapt(libs.moshi.codegen)
implementation(libs.commons.io)
implementation(libs.coroutines)
testImplementation(libs.coroutines.test)
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString()
plugins.withType<JavaPlugin>().configureEach {
extensions.configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

tasks.test {
Expand All @@ -28,4 +71,55 @@ tasks.jacocoTestReport {
csv.required.set(true)
html.required.set(true)
}
}
}

publishing {
publications {
repositories {
mavenLocal()
}
}
}

pluginBundle {
website = pluginWebsite
vcsUrl = pluginVcsUrl
tags = "$pluginTags".split(",")
}

gradlePlugin {
plugins {
create(pluginDeclarationName) {
id = pluginId
displayName = pluginDisplayName
description = pluginDescription
implementationClass = pluginImplementationClass
}
}
}

tasks.wrapper {
distributionType = Wrapper.DistributionType.BIN
}

tasks.register("publishToLocal") {
doLast {
exec {
commandLine(
"./gradlew",
"detekt",
"build",
"test",
"publishToMavenLocal"
).args("--info")
}
}
}

detekt {
config = files("detekt-config.yml")
buildUponDefaultConfig = true
source = files(
"src/main/kotlin"
)
}
9 changes: 9 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
codecov:
require_ci_to_pass: yes
notify:
wait_for_ci: yes

coverage:
precision: 2
round: down
range: 65...100
Binary file added console-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions detekt-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
complexity:
active: true
TooManyFunctions:
active: true
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ]
thresholdInFiles: 50
thresholdInClasses: 50
thresholdInInterfaces: 50
thresholdInObjects: 50
thresholdInEnums: 50
ignoreDeprecated: false
ignorePrivate: false
ignoreOverridden: false
LongParameterList:
active: false
NestedBlockDepth:
active: true
threshold: 6
LongMethod:
active: true
threshold: 75
ComplexMethod:
active: true
threshold: 25

exceptions:
active: true
SwallowedException:
active: false
TooGenericExceptionCaught:
active: false

style:
active: true
SerialVersionUIDInSerializableClass:
active: false
MagicNumber:
active: false
ReturnCount:
active: false
FunctionOnlyReturningConstant:
active: false
MaxLineLength:
active: true
maxLineLength: 128
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 1.0.0-beta1
* Hello World :)

2 changes: 2 additions & 0 deletions docs/contribution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Contribution
Gradle Analytics Plugin is Open Source and accepts contributions of new members, feel free to submit your PR and stay connected on the PR page and I will be glad to finalize and merge your PR in the upcoming release.
29 changes: 29 additions & 0 deletions docs/getting-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Getting Report
Gradle Analytics Plugin uses daily basis data to generate reports. So you could use the below instructions to generate your build analysis.

<strong>Execute Gradle Task</strong><br/>
```Gradle
./gradlew reportAnalytics --task="REQUESTED_TASK" --branch="BRANCH_NAME" --period="can be like today, s:yyyy/MM/dd,e:yyyy/MM/dd, 1y, 4m, 38d, 3m 06d"
```

<br/>
!!! Note ""

<strong>--period Examples</strong><br/>

- <strong>today</strong> - Generates report only for the current day.
- <strong>1d</strong> - Generates report from 1 day ago till now.
- <strong>1m 3d</strong> - Generates report from 1 month and 3 days ago till now.
- <strong>1y</strong> - Generates report from 1 year ago till now.
- <strong>s:2022/03/24,e:2022/04/25</strong> - Generates report from `2022/03/24` till `2022/04/25`.


Plugin only holds the metrics results in the caching database up to one year.

<br/>

To understand the metrics and report that plugin provides, It is required to understand Gradle basics and how this build
system works.<br /><a href="https://docs.gradle.org/current/userguide/what_is_gradle.html" target="_blank">https://docs.gradle.org/current/userguide/what_is_gradle.html</a>
<br/>

<br/>
Binary file added docs/img/build-status.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/cache-hit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/configuration-process.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/dependency-details.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/dependency-resolve-process.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/execution-process.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/initialization-process.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/module-execution-process-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/module-execution-process-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/modules-build-heatmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/modules-crash-count.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/modules-dependency-graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/modules-execution-timeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/modules-method-count.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/modules-source-count.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/modules-source-size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/non-cacheable-tasks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/overall-build-process.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/parallel-execution-rate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/plugin-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/successful-build-rate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4c7114a

Please sign in to comment.