Skip to content

Commit

Permalink
Merge branch 'release/4.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrimaeon committed Jun 13, 2022
2 parents de2c3e2 + 1dd53e3 commit f381fd2
Show file tree
Hide file tree
Showing 36 changed files with 725 additions and 353 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
create-github-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Create Release Notes
run: ./gradlew --quiet getChangelog --no-header > ./RELEASE_NOTES.md
- name: Create Release
id: create_release
uses: chrimaeon/github-create-release-action@0.2.0
uses: chrimaeon/github-create-release-action@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
- name: Gradle Cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('**/build.gradle.kts', '**/Deps.kt') }}
- name: Gradle Wrapper Cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
Expand All @@ -39,12 +39,12 @@ jobs:

- name: Archive Test results
if: ${{ failure() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: test-results
path: |
build/reports/*
build/test-results/*
- name: Upload Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
19 changes: 14 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,31 @@

### Security

## [4.4.0]
## [4.5.0]
### Added
- [SPDX License Identifier](https://spdx.org/licenses/) for various reports
- Better support for Android Variants

### Changed
- HTML and Markdown reports merge licenses with a more sophisticated algorithm
- Internal handling of the license mappings

### Deprecated

### Removed

### Fixed
- CSV Reporter reports all licenses not only the first one

### Security

## [4.4.0]
### Added
- [SPDX License Identifier](https://spdx.org/licenses/) for various reports

### Changed
- HTML and Markdown reports merge licenses with a more sophisticated algorithm

### Fixed
- CSV Reporter reports all licenses not only the first one

## [4.3.0]
### Changed
- add maven coordinates to Library model
Expand Down Expand Up @@ -75,4 +84,4 @@
## [3.1.0]
### Changed
- All public properties are now provided Properties
- Use Kotlin Serialization instead of Moshi
- Use Kotlin Serialization instead of Moshi
8 changes: 4 additions & 4 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.4.0"
id("com.cmgapps.licenses") version "4.5.0"
}
```
</details>
Expand All @@ -28,7 +28,7 @@ plugins {

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

Expand All @@ -65,7 +65,7 @@ buildscript {
}
}
dependencies {
classpath 'com.cmgapps:gradle-licenses-plugin:4.4.0'
classpath 'com.cmgapps:gradle-licenses-plugin:4.5.0'
}
}
Expand Down
72 changes: 36 additions & 36 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import com.cmgapps.gradle.logResults
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import com.github.benmanes.gradle.versions.updates.gradle.GradleReleaseChannel
import kotlinx.kover.api.VerificationValueType.COVERED_LINES_PERCENTAGE
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.util.Date
Expand All @@ -16,18 +17,13 @@ plugins {
`java-gradle-plugin`
`maven-publish`
signing
id("com.github.ben-manes.versions") version Deps.Plugins.versionsVersion
kotlin("jvm") version Deps.kotlinVersion
id("com.gradle.plugin-publish") version Deps.Plugins.pluginPublishVersion
id("org.jetbrains.dokka") version Deps.Plugins.dokkaVersion
kotlin("plugin.serialization") version Deps.kotlinVersion
id("org.jetbrains.changelog") version Deps.Plugins.changelogPluginVersion
id("org.jetbrains.kotlinx.kover") version Deps.Plugins.koverVersion
}

repositories {
mavenCentral()
google()
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.versions)
alias(libs.plugins.gradle.pluginPublish)
alias(libs.plugins.jetbrains.dokka)
alias(libs.plugins.jetbrains.changelog)
alias(libs.plugins.kotlinx.kover)
}

val functionalTestSourceSet: SourceSet = sourceSets.create("functionalTest") {
Expand Down Expand Up @@ -221,7 +217,7 @@ tasks {
"Built-Date" to Date(),
"Built-JDK" to System.getProperty("java.version"),
"Built-Gradle" to gradle.gradleVersion,
"Built-Kotlin" to Deps.kotlinVersion
"Built-Kotlin" to libs.versions.kotlin
)
)
}
Expand All @@ -230,6 +226,8 @@ tasks {
named<DependencyUpdatesTask>("dependencyUpdates") {
revision = "release"

gradleReleaseChannel = GradleReleaseChannel.CURRENT.id

rejectVersionIf {
listOf("alpha", "beta", "rc", "cr", "m", "preview")
.map { qualifier -> Regex("(?i).*[.-]$qualifier[.\\d-]*") }
Expand All @@ -244,7 +242,7 @@ tasks {

withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + "-Xopt-in=kotlin.RequiresOptIn"
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn"
jvmTarget = "1.8"
}
}
Expand All @@ -267,9 +265,10 @@ tasks {

doLast {
val content = readmeFile.readText()
val oldVersion = """id\("com.cmgapps.licenses"\) version "(.*)"""".toRegex(RegexOption.MULTILINE).find(content)?.let {
it.groupValues[1]
} ?: error("Cannot find oldVersion")
val oldVersion =
"""id\("com.cmgapps.licenses"\) version "(.*)"""".toRegex(RegexOption.MULTILINE).find(content)?.let {
it.groupValues[1]
} ?: error("Cannot find oldVersion")

logger.info("Updating README.md version $oldVersion to $version")

Expand All @@ -293,34 +292,35 @@ tasks {
}
}

@Suppress("UnstableApiUsage")
dependencies {
compileOnly(Deps.androidGradlePlugin)
compileOnly(Deps.kotlinMultiplatformPlugin)

val kotlinReflect = kotlin("reflect", Deps.kotlinVersion)
compileOnly(libs.android.gradlePlugin)
compileOnly(libs.kotlin.multiplatformPlugin)
// Necessary to bump a transitive dependency.
compileOnly(kotlinReflect)
compileOnly(libs.kotlin.reflect)

implementation(kotlin("stdlib-jdk8", Deps.kotlinVersion))
implementation(Deps.mavenModel)
implementation(Deps.mavenArtifact)
implementation(Deps.kotlinSerialization)
implementation(Deps.apacheCommonsCsv)
implementation(libs.kotlin.stdlib.jdk8)
implementation(libs.maven.model)
implementation(libs.maven.artifact)
implementation(libs.kotlin.serialization)
implementation(libs.apache.commonsCsv)

ktlint(Deps.ktlint)
ktlint(libs.ktlint)

testImplementation(Deps.jUnit) {
testImplementation(libs.jUnit) {
exclude(group = "org.hamcrest")
}
testImplementation(Deps.hamcrest)
testImplementation(kotlinReflect)
testImplementation(Deps.mockitoKotlin)
testImplementation(libs.hamcrest)
testImplementation(libs.kotlin.reflect)
testImplementation(libs.mockito.kotlin)

"functionalTestImplementation"(Deps.jUnit) {
"functionalTestImplementation"(libs.jUnit) {
exclude(group = "org.hamcrest")
}
"functionalTestImplementation"(Deps.kotlinMultiplatformPlugin)
"functionalTestImplementation"(Deps.hamcrest)
"functionalTestImplementation"(libs.kotlin.multiplatformPlugin)
"functionalTestImplementation"(libs.hamcrest)
"functionalTestImplementation"(gradleTestKit())
"functionalTestImplementation"(kotlinReflect)
"functionalTestImplementation"(libs.kotlin.reflect)
"functionalTestImplementation"(libs.xmlunit.core)
"functionalTestImplementation"(libs.xmlunit.matchers)
}
16 changes: 4 additions & 12 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
/*
* Copyright (c) 2019. Christian Grach <christian.grach@cmgapps.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* SPDX-License-Identifier: Apache-2.0
*/

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`kotlin-dsl`
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + "-Xopt-in=kotlin.RequiresOptIn"
}
Expand Down
38 changes: 0 additions & 38 deletions buildSrc/src/main/kotlin/Deps.kt

This file was deleted.

28 changes: 28 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[versions]
kotlin = "1.7.0"
xmlunit = "2.9.0"

[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
versions = "com.github.ben-manes.versions:0.42.0"
gradle-pluginPublish = "com.gradle.plugin-publish:0.21.0"
kotlinx-kover = "org.jetbrains.kotlinx.kover:0.5.1"
jetbrains-dokka = "org.jetbrains.dokka:1.6.21"
jetbrains-changelog = "org.jetbrains.changelog:1.3.1"

[libraries]
android-gradlePlugin = "com.android.tools.build:gradle:7.2.1"
kotlin-multiplatformPlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-serialization = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3"
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
apache-commonsCsv = "org.apache.commons:commons-csv:1.9.0"
maven-model = "org.apache.maven:maven-model:3.8.5"
maven-artifact = "org.apache.maven:maven-artifact:3.8.6"
jUnit = "org.junit.jupiter:junit-jupiter:5.8.2"
hamcrest = "org.hamcrest:hamcrest:2.2"
ktlint = "com.pinterest:ktlint:0.45.2"
mockito-kotlin = "org.mockito.kotlin:mockito-kotlin:4.0.0"
xmlunit-core = { module = "org.xmlunit:xmlunit-core", version.ref = "xmlunit" }
xmlunit-matchers = { module = "org.xmlunit:xmlunit-matchers", version.ref = "xmlunit" }
2 changes: 1 addition & 1 deletion pom.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: Apache-2.0
#
group=com.cmgapps
versionName=4.4.0
versionName=4.5.0
pomName=Gradle Licenses Plugin
pomArtifactId=gradle-licenses-plugin
pomDescription=Gradle plugin that provides a task to generate a license report for the dependencies used in your project Java/Kotlin project.
Expand Down
Loading

0 comments on commit f381fd2

Please sign in to comment.