Skip to content

Commit

Permalink
Merge branch 'release/4.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrimaeon committed Jan 2, 2022
2 parents 806457b + 128e1bd commit 0ae09e7
Show file tree
Hide file tree
Showing 33 changed files with 708 additions and 380 deletions.
70 changes: 0 additions & 70 deletions .circleci/config.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Create Github Release

on:
push:
tags:
- '**'
workflow_dispatch:

jobs:
create-github-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create Release Notes
run: ./gradlew --quiet getChangelog --no-header > ./RELEASE_NOTES.md
- name: Create Release
uses: chrimaeon/github-create-release-action@0.2.0
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ github.ref }}
body_file: ./RELEASE_NOTES.md
draft: false
50 changes: 50 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build & Test

on:
push:
branches:
- main
- develop
- 'release/**'
- 'hotfix/**'

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 11
- name: Gradle Cache
uses: actions/cache@v2
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
with:
path: ~/.gradle/wrapper
key: gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: Download dependencies
run: ./gradlew dependencies

- name: Build & Test
run: ./gradlew check koverHtmlReport koverVerify

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

### Security

## [4.0.0]
## [4.1.0]
### Added

- Kotlin Multiplatform support

### Changed

- Extension property to set `enabled` and `destination`
- Sort dependencies by name and version

### Deprecated

Expand All @@ -30,25 +27,27 @@

### Security

## [3.3.0]
## [4.0.0]
### Added
- Kotlin Multiplatform support

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

## [3.3.0]
### Changed
- Update Android Gradle plugin to version 7+
- Warning when license has no mapping for html reports

## [3.2.0]

### Added

- set task outputs to report files
- add DSL to configure reports

### Changed

- use library to create CSV report

## [3.1.0]
### Changed
- All public properties are now provided Properties
- Use Kotlin Serialization instead of Moshi
- Use Kotlin Serialization instead of Moshi
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Gradle Licenses Plugin [![CircleCI](https://circleci.com/gh/chrimaeon/gradle-licenses-plugin.svg?style=svg)](https://circleci.com/gh/chrimaeon/gradle-licenses-plugin)
# Gradle Licenses Plugin [![Build & Test](https://github.com/chrimaeon/gradle-licenses-plugin/actions/workflows/main.yml/badge.svg)](https://github.com/chrimaeon/gradle-licenses-plugin/actions/workflows/main.yml) [![codecov](https://codecov.io/gh/chrimaeon/gradle-licenses-plugin/branch/master/graph/badge.svg?token=XY0G488B3B)](https://codecov.io/gh/chrimaeon/gradle-licenses-plugin)

[![License](https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg?style=for-the-badge)](http://www.apache.org/licenses/LICENSE-2.0)
[![Gradle Plugin](https://img.shields.io/badge/Gradle-6.8%2B-%2302303A.svg?style=for-the-badge&logo=Gradle)](https://gradle.org/)
Expand All @@ -13,7 +13,7 @@ Using the plugins DSL

```groovy
plugins {
id "com.cmgapps.licenses" version "4.0.0"
id "com.cmgapps.licenses" version "4.1.0"
}
```

Expand All @@ -26,7 +26,7 @@ buildscript {
}
dependencies {
classpath("com.cmgapps:gradle-licenses-plugin:4.0.0")
classpath("com.cmgapps:gradle-licenses-plugin:4.1.0")
}
}
Expand Down
78 changes: 27 additions & 51 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import com.cmgapps.gradle.logResults
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import kotlinx.kover.api.VerificationValueType.COVERED_LINES_PERCENTAGE
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.util.Date
import java.util.Properties
Expand All @@ -25,13 +26,13 @@ plugins {
`java-gradle-plugin`
`maven-publish`
signing
jacoco
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 "0.4.4"
}

repositories {
Expand All @@ -44,21 +45,13 @@ val functionalTestSourceSet: SourceSet = sourceSets.create("functionalTest") {
java {
srcDir("src/$sourceSetName/kotlin")
}

compileClasspath += sourceSets.main.get().output + configurations.testRuntimeClasspath.get()
runtimeClasspath += output + compileClasspath
resources {
srcDirs(sourceSets.main.get().resources.srcDirs)
}
}

val ktlint: Configuration by configurations.creating

configurations {
named("functionalTestImplementation") {
extendsFrom(testImplementation.get())
}

register("jacocoRuntime")
}

idea {
module {
testSourceDirs = testSourceDirs + functionalTestSourceSet.allJava.srcDirs
Expand Down Expand Up @@ -152,7 +145,7 @@ publishing {
licenses {
license {
name.set("Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
}
Expand All @@ -167,14 +160,14 @@ publishing {
url = if (versionName.endsWith("SNAPSHOT")) snapshotUrl else releaseUrl

val credentials = Properties().apply {
val credFile = file("./credentials.properties")
val credFile = projectDir.resolve("credentials.properties")
if (credFile.exists()) {
load(credFile.inputStream())
}
}
credentials {
username = credentials.getProperty("sonaUsername")
password = credentials.getProperty("sonaPassword")
username = credentials.getProperty("username")
password = credentials.getProperty("password")
}
}
}
Expand All @@ -188,25 +181,15 @@ changelog {
version.set(versionName)
}

jacoco {
toolVersion = Deps.jacocoAgentVersion
kover {
coverageEngine.set(kotlinx.kover.api.CoverageEngine.JACOCO)
}

tasks {
val setupJacocoRuntime by registering(WriteProperties::class) {
outputFile =
functionalTestSourceSet.output.resourcesDir!!.resolve("testkit/testkit-gradle.properties")
property(
"org.gradle.jvmargs",
"-javaagent:${configurations["jacocoRuntime"].asPath}=destfile=$buildDir/jacoco/functionalTest.exec"
)
}

val functionalTest by registering(Test::class) {
group = "verification"
testClassesDirs = functionalTestSourceSet.output.classesDirs
classpath = functionalTestSourceSet.runtimeClasspath
dependsOn(setupJacocoRuntime)
}

val ktlint by registering(JavaExec::class) {
Expand All @@ -221,26 +204,6 @@ tasks {
dependsOn(functionalTest, ktlint)
}

val jacocoExecData = fileTree("$buildDir/jacoco").include("*.exec")

jacocoTestReport {
executionData(jacocoExecData)
dependsOn(test, functionalTest)
}

jacocoTestCoverageVerification {
inputs.dir(buildDir.resolve("jacoco"))
executionData(jacocoExecData)
violationRules {
rule {
limit {
counter = "INSTRUCTION"
minimum = "0.8".toBigDecimal()
}
}
}
}

jar {
manifest {
attributes(
Expand Down Expand Up @@ -287,7 +250,7 @@ tasks {

wrapper {
distributionType = Wrapper.DistributionType.ALL
gradleVersion = "7.2"
gradleVersion = "7.3.3"
}

val updateReadme by registering {
Expand All @@ -313,6 +276,16 @@ tasks {
patchChangelog {
dependsOn(updateReadme)
}

koverVerify {
rule {
name = "Minimal Line coverage"
bound {
minValue = 80
valueType = COVERED_LINES_PERCENTAGE
}
}
}
}

dependencies {
Expand All @@ -325,6 +298,7 @@ dependencies {

implementation(kotlin("stdlib-jdk8", Deps.kotlinVersion))
implementation(Deps.mavenModel)
implementation(Deps.mavenArtifact)
implementation(Deps.kotlinSerialization)
implementation(Deps.apacheCommonsCsv)

Expand All @@ -338,10 +312,12 @@ dependencies {
testImplementation(kotlinReflect)
testImplementation(Deps.mockitoKotlin)

"functionalTestImplementation"(Deps.jUnit) {
exclude(group = "org.hamcrest")
}
"functionalTestImplementation"(Deps.androidGradlePlugin)
"functionalTestImplementation"(Deps.kotlinMultiplatformPlugin)
"functionalTestImplementation"(Deps.hamcrest)
"functionalTestImplementation"(gradleTestKit())
"functionalTestImplementation"(kotlinReflect)

"jacocoRuntime"("org.jacoco:org.jacoco.agent:${jacoco.toolVersion}:runtime")
}
Loading

0 comments on commit 0ae09e7

Please sign in to comment.