Skip to content

Commit

Permalink
Merge branch 'release/5.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrimaeon committed Jan 5, 2025
2 parents 8d91921 + 7071d93 commit ec3e371
Show file tree
Hide file tree
Showing 56 changed files with 1,642 additions and 1,212 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
run: ./gradlew --quiet getChangelog --no-header > ./RELEASE_NOTES.md
- name: Create Release
id: create_release
uses: chrimaeon/github-create-release-action@v1
uses: chrimaeon/github-create-release-action@v2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ github.ref }}
body_file: ./RELEASE_NOTES.md
publish: true
- name: Notify Slack
uses: chrimaeon/github-slack-action@v1
uses: chrimaeon/github-slack-action@v2
with:
slack_token: ${{ secrets.SLACK_TOKEN }}
channel: ${{ secrets.SLACK_CHANNEL }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
build/test-results/*
- name: Upload Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: ./build/reports/kover/report.xml
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
61 changes: 44 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## Unreleased
## [Unreleased]

### Added

Expand All @@ -14,7 +14,17 @@

### Security

## 4.8.0
## [5.0.0]

Use Gradle's Reports API to generate reports

### Changed

- `text` report renamed to `plainText`
- `destination` is now `outputLocation`
- Extension values are now `org.gradle.api.provider.Property`

## [4.8.0]

### Changed

Expand All @@ -24,21 +34,21 @@

- Android Gradle Plugin **4.x**

## 4.7.0
## [4.7.0]

### Added

- EPL v1.0 License - #15
- Additional URL for LGPL-2.1

## 4.6.1
## [4.6.1]

### Changed

- update AGP version
- update maven model library

## 4.6.0
## [4.6.0]

### Added

Expand All @@ -48,7 +58,7 @@

- Sort libraries by name or maven coordinated on HTML report

## 4.5.0
## [4.5.0]

### Added

Expand All @@ -58,7 +68,7 @@

- Internal handling of the license mappings

## 4.4.0
## [4.4.0]

### Added

Expand All @@ -72,37 +82,38 @@

- CSV Reporter reports all licenses not only the first one

## 4.3.0
## [4.3.0]

### Changed

- add maven coordinates to Library model
- `version` is not part of the `mavenCoordinates` in the Library model
- Improved Markdown reporter

## 4.2.0
## [4.2.0]

### Added

- XSD Schema for the XML reporter

### Changed

- - `<version>` is now attribute to `<library>`
- `<url>` is now a attribute to `<license>`
- `<library>` has an `id` attribute now
-
- `<version>` is now attribute to `<library>`
- `<url>` is now a attribute to `<license>`
- `<library>` has an `id` attribute now

### Fixed

- HTML Reports includes all libraries again

## 4.1.0
## [4.1.0]

### Changed

- Sort dependencies by name and version

## 4.0.0
## [4.0.0]

### Added

Expand All @@ -112,14 +123,14 @@

- Extension property to set `enabled` and `destination`

## 3.3.0
## [3.3.0]

### Changed

- Update Android Gradle plugin to version 7+
- Warning when license has no mapping for html reports

## 3.2.0
## [3.2.0]

### Added

Expand All @@ -130,9 +141,25 @@

- use library to create CSV report

## 3.1.0
## [3.1.0]

### Changed

- All public properties are now provided Properties
- Use Kotlin Serialization instead of Moshi

[Unreleased]: https://github.com/chrimaeon/gradle-licenses-plugin/compare/5.0.0...HEAD
[5.0.0]: https://github.com/chrimaeon/gradle-licenses-plugin/compare/4.8.0...5.0.0
[4.8.0]: https://github.com/chrimaeon/gradle-licenses-plugin/compare/4.7.0...4.8.0
[4.7.0]: https://github.com/chrimaeon/gradle-licenses-plugin/compare/4.6.1...4.7.0
[4.6.1]: https://github.com/chrimaeon/gradle-licenses-plugin/compare/4.6.0...4.6.1
[4.6.0]: https://github.com/chrimaeon/gradle-licenses-plugin/compare/4.5.0...4.6.0
[4.5.0]: https://github.com/chrimaeon/gradle-licenses-plugin/compare/4.4.0...4.5.0
[4.4.0]: https://github.com/chrimaeon/gradle-licenses-plugin/compare/4.3.0...4.4.0
[4.3.0]: https://github.com/chrimaeon/gradle-licenses-plugin/compare/4.2.0...4.3.0
[4.2.0]: https://github.com/chrimaeon/gradle-licenses-plugin/compare/4.1.0...4.2.0
[4.1.0]: https://github.com/chrimaeon/gradle-licenses-plugin/compare/4.0.0...4.1.0
[4.0.0]: https://github.com/chrimaeon/gradle-licenses-plugin/compare/3.3.0...4.0.0
[3.3.0]: https://github.com/chrimaeon/gradle-licenses-plugin/compare/3.2.0...3.3.0
[3.2.0]: https://github.com/chrimaeon/gradle-licenses-plugin/compare/3.1.0...3.2.0
[3.1.0]: https://github.com/chrimaeon/gradle-licenses-plugin/commits/3.1.0
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This Gradle plugin provides tasks to generate a file with the licenses used from

```kotlin
plugins {
id("com.cmgapps.licenses") version "4.8.0"
id("com.cmgapps.licenses") version "5.0.0"
}
```
</details>
Expand All @@ -28,7 +28,7 @@ plugins {

```groovy
plugins {
id 'com.cmgapps.licenses' version '4.8.0'
id 'com.cmgapps.licenses' version '5.0.0'
}
```
</details>
Expand All @@ -46,7 +46,7 @@ buildscript {
}
}
dependencies {
classpath("com.cmgapps:gradle-licenses-plugin:4.8.0")
classpath("com.cmgapps:gradle-licenses-plugin:5.0.0")
}
}

Expand All @@ -65,7 +65,7 @@ buildscript {
}
}
dependencies {
classpath 'com.cmgapps:gradle-licenses-plugin:4.8.0'
classpath 'com.cmgapps:gradle-licenses-plugin:5.0.0'
}
}
Expand Down Expand Up @@ -99,10 +99,10 @@ Example:
```kotlin
licenses {
reports {
html.enabled = false // html is enabled by default
html.enabled.set(false) // html is enabled by default
xml {
enabled = true
destination = file("$buildDir/reports/licenses.xml")
enabled.set(true)
outputFile.set(file("$buildDir/reports/licenses.xml"))
}
}
}
Expand All @@ -126,7 +126,7 @@ The plugin can output different formats.
```kotlin
licenses {
reports {
html.stylesheet(file("$projectDir/styles/licenses.css"))
html.stylesheet.set(file("$projectDir/styles/licenses.css"))
}
}
```
Expand Down Expand Up @@ -158,9 +158,9 @@ The plugin can output different formats.
```kotlin
licenses {
custom {
enabled = true
destination = buildDir.resolve("reports").resolve("licenses.txt")
generate { list -> list.map { it.name }.joinToString() }
enabled.set(true)
outputFile.set(buildDir.resolve("reports").resolve("licenses.txt"))
generateor.set { list -> list.map { it.name }.joinToString() }
}
}
```
Expand All @@ -172,9 +172,10 @@ The plugin can output different formats.
```groovy
licenses {
custom {
enabled = true
destination = file("$buildDir/reports/licenses/licenses.txt")
generate { list -> list.collect { it.name }.join(', ') }
enabled.set(true)
outputFile.set(file("$buildDir/reports/licenses/licenses.txt"))
def builder = { list -> list.collect { it.name }.join(', ') } as com.cmgapps.license.reporter.CustomReportGenerator
generator.set(builder)
}
}
```
Expand Down Expand Up @@ -207,7 +208,7 @@ licenses {
## License

```text
Copyright (c) 2018. Christian Grach <christian.grach@cmgapps.com>
Copyright (c) 2018-2024. Christian Grach <christian.grach@cmgapps.com>
SPDX-License-Identifier: Apache-2.0
```
Expand Down
11 changes: 11 additions & 0 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2025. Christian Grach <christian.grach@cmgapps.com>
*
* SPDX-License-Identifier: Apache-2.0
*/

group = "com.cmgapps.gradle.convention"

plugins {
`kotlin-dsl`
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,27 @@

package com.cmgapps.gradle

import org.gradle.api.Project
import org.gradle.api.logging.Logger
import org.gradle.api.tasks.testing.Test
import org.gradle.api.tasks.testing.TestDescriptor
import org.gradle.api.tasks.testing.TestResult
import org.gradle.api.tasks.testing.TestResult.ResultType
import org.gradle.kotlin.dsl.KotlinClosure2
import org.gradle.kotlin.dsl.withType

const val CSI = "\u001B["
const val ANSI_RED = "31"
const val ANSI_GREEN = "32"
const val ANSI_YELLOW = "33"
const val ANSI_BOLD = "1"
private const val CSI = "\u001B["
private const val ANSI_RED = "31"
private const val ANSI_GREEN = "32"
private const val ANSI_YELLOW = "33"
private const val ANSI_BOLD = "1"

fun Logger.logResults(
private fun Logger.logResults(
desc: TestDescriptor,
result: TestResult,
) {
val message = "{} > {} {}" + if (result.exception != null) "\n>\t{}\n" else "\n"

@OptIn(ExperimentalStdlibApi::class)
val params =
buildList<String> {
add(desc.className?.substringAfterLast('.') ?: "")
Expand All @@ -51,8 +54,8 @@ fun Logger.logResults(
}
}

private fun getFormattedResult(result: TestResult): String {
return buildString {
private fun getFormattedResult(result: TestResult): String =
buildString {
val isAnsiColorTerm = System.getenv("TERM")?.lowercase()?.contains("color") ?: false
val (color, text) =
when (result.resultType) {
Expand All @@ -73,4 +76,9 @@ private fun getFormattedResult(result: TestResult): String {
append("0m")
}
}

fun Project.configureTestLogging() {
tasks.withType<Test> {
afterTest(KotlinClosure2(logger::logResults))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2025. Christian Grach <christian.grach@cmgapps.com>
*
* SPDX-License-Identifier: Apache-2.0
*/

package com.cmgapps.gradle

configureTestLogging()
1 change: 1 addition & 0 deletions build-logic/plugins/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
11 changes: 11 additions & 0 deletions build-logic/plugins/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2025. Christian Grach <christian.grach@cmgapps.com>
*
* SPDX-License-Identifier: Apache-2.0
*/

plugins {
`kotlin-dsl`
}

group = "com.cmgapps.gradle.plugins"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2025. Christian Grach <christian.grach@cmgapps.com>
*
* SPDX-License-Identifier: Apache-2.0
*/

package com.cmgapps.gradle

import configureKtlint

configureKtlint()
Loading

0 comments on commit ec3e371

Please sign in to comment.