Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrimaeon committed Jan 2, 2022
2 parents 95bde93 + 6d5df54 commit c0ddd81
Show file tree
Hide file tree
Showing 18 changed files with 229 additions and 131 deletions.
65 changes: 0 additions & 65 deletions .circleci/config.yml

This file was deleted.

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

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

jobs:
create-github-release:
runs-on: ubuntu-latest
steps:
- name: Create Release
uses: chrimaeon/github-create-release-action@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ github.ref }}
publish: false
- name: Notify Slack
uses: chrimaeon/github-slack-action@v1
with:
slack_token: ${{ secrets.SLACK_TOKEN }}
channel: ${{ secrets.SLACK_CHANNEL }}
text: "New draft release created for ${{ github.repository }}"
blocks: |
[
{
"type": "header",
"text": {
"type": "plain_text",
"text": "New draft release created for ${{ github.repository }}"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Version*\n${{ github.ref_name }}"
},
{
"type": "mrkdwn",
"text": "*URL*\n${{ steps.create_release.outputs.html_url }}"
}
]
}
]
52 changes: 52 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build & Test

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

jobs:
build-and-test:
runs-on: ubuntu-latest
env:
DEVEO_USERNAME: ${{ secrets.DEVEO_USERNAME }}
DEVEO_PASSWORD: ${{ secrets.DEVEO_PASSWORD }}

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 koverReport 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
35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Log TAG Annotation Processor [![CircleCI](https://circleci.com/gh/chrimaeon/logtag-kapt.svg?style=svg)](https://circleci.com/gh/chrimaeon/logtag-kapt)
# Log TAG Annotation Processor [![Build & Test](https://github.com/chrimaeon/logtag-kapt/actions/workflows/main.yml/badge.svg)](https://github.com/chrimaeon/logtag-kapt/actions/workflows/main.yml) [![codecov](https://codecov.io/gh/chrimaeon/logtag-kapt/branch/main/graph/badge.svg?token=QH5OYAQUX3)](https://codecov.io/gh/chrimaeon/logtag-kapt)

[![License](https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg?style=for-the-badge)](http://www.apache.org/licenses/LICENSE-2.0)
[![MavenCentral](https://img.shields.io/maven-central/v/com.cmgapps.logtag/log-tag?style=for-the-badge)](https://repo1.maven.org/maven2/com/cmgapps/logtag/)
Expand All @@ -11,47 +11,50 @@ This is an annotation processor that will generate an appropriate log tag for An

<details open>

<summary>using KAPT</summary>
<summary>using KSP</summary>

The library supports KSP ([Kotlin Symbol Processing API])

Add the processor and annotation libraries to the projects dependencies

```kotlin
dependencies {
implementation("com.cmgapps:log-tag:0.3.0")
kapt("com.cmgapps:log-tag-processor:0.3.0")
implementation("com.cmgapps:log-tag:1.0.0")
ksp("com.cmgapps:log-tag-processor:1.0.0")
}
```

also get sure to apply the Annotation Processor Plugin
also get sure to apply the KSP Gradle Plugin

```kotlin
plugins {
kotlin("kapt")
id("com.google.devtools.ksp") version "<latest version>"
}
```

</details>

<details>
<summary>using KSP</summary>

The library also supports KSP ([Kotlin Symbol Processing API]), which is currently in a beta state, when you projects kotin version is `1.5.10` or higher
<summary>using KAPT</summary>

Add the processor and annotation libraries to the projects dependencies

```kotlin
dependencies {
implementation("com.cmgapps:log-tag:0.3.0")
ksp("com.cmgapps:log-tag-processor:0.3.0")
implementation("com.cmgapps:log-tag:1.0.0")
kapt("com.cmgapps:log-tag-processor:1.0.0")
}
```

also get sure to apply the KSP Gradle Plugin
also get sure to apply the Annotation Processor Plugin

```kotlin
plugins {
id("com.google.devtools.ksp") version "<latest version>"
kotlin("kapt")
}
```

</details>

### Code
Expand All @@ -65,13 +68,13 @@ class SuperImportantClass
```

* For **Kotlin** classes this will generate an extension property to you class called `LOG_TAG`
you can then use as the tag for your android log messages.
you can then use as the tag for your android log messages.

* For **Java** it will generate a class called &lt;Classname&gt;LogTag which has a constant field called `LOG_TAG` you can
then import to tag your android log messages
* For **Java** it will generate a class called `<Classname>LogTag` which has a constant field called `LOG_TAG` you can
then import to tag your android log messages

* For **Jetpack Compose** you can annotate the `@Composable` function for the processor to generate a class called
`Composable<Composable function name>` with a companion object property `LOG_TAG`
`Composable<Composable function name>` with a companion object property `LOG_TAG`

## License

Expand Down
34 changes: 32 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,23 @@
* limitations under the License.
*/

import com.cmgapps.gradle.VersionsExtension
import com.cmgapps.gradle.VersionsPlugin
import kotlinx.kover.api.CoverageEngine.JACOCO

buildscript {
repositories {
google()
mavenCentral()
helixTeamHubRepo(project)
helixTeamHubRepo {
if (project.hasProperty("DEVEO_USERNAME")) {
username = project.property("DEVEO_USERNAME") as String
password = project.property("DEVEO_PASSWORD") as String
} else {
username = System.getenv("DEVEO_USERNAME")
password = System.getenv("DEVEO_PASSWORD")
}
}
gradlePluginPortal()
}

Expand All @@ -29,7 +41,25 @@ buildscript {
}
}

apply(plugin = "com.cmgapps.versions")
repositories {
google()
mavenCentral()
}

apply<VersionsPlugin>()

plugins {
id("org.jetbrains.kotlinx.kover") version
"org.jetbrains.kotlinx.kover:org.jetbrains.kotlinx.kover.gradle.plugin".version()
}

extensions.configure(VersionsExtension::class.java) {
skipGroups.addAll("org.jetbrains.kotlin", "org.junit.jupiter", "org.jetbrains.intellij.deps", "org.jacoco")
}

kover {
coverageEngine.set(JACOCO)
}

subprojects {
repositories {
Expand Down
9 changes: 7 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@ plugins {
}

repositories {
jcenter()
mavenCentral()
}

tasks {
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}

withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
}
}
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/DefaultVersions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
* limitations under the License.
*/

const val KOTLIN_VERSION = "1.5.21"
const val KOTLIN_VERSION = "1.6.10"
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fun DependencyHandlerScope.addProcessorDependencies() {

junit()
testImplementation("org.mockito:mockito-junit-jupiter".withVersion())
testImplementation("org.mockito.kotlin:mockito-kotlin:3.2.0")
testImplementation("org.mockito.kotlin:mockito-kotlin".withVersion())
testImplementation("org.hamcrest:hamcrest".withVersion())

junit("functionalTestImplementation")
Expand Down
15 changes: 5 additions & 10 deletions buildSrc/src/main/kotlin/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,19 @@
import org.gradle.api.Project
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.artifacts.repositories.ArtifactRepository
import org.gradle.api.artifacts.repositories.PasswordCredentials
import org.gradle.kotlin.dsl.DependencyHandlerScope
import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.plugin.use.PluginDependenciesSpec
import org.gradle.plugin.use.PluginDependencySpec
import java.net.URI

fun RepositoryHandler.helixTeamHubRepo(project: Project): ArtifactRepository {
fun RepositoryHandler.helixTeamHubRepo(credentials: PasswordCredentials.() -> Unit): ArtifactRepository {
return maven {
credentials {
if (project.hasProperty("DEVEO_USERNAME")) {
username = project.property("DEVEO_USERNAME") as String
password = project.property("DEVEO_PASSWORD") as String
} else {
username = System.getenv("DEVEO_USERNAME")
password = System.getenv("DEVEO_PASSWORD")
}
credentials(this)
}
url =
project.uri("https://helixteamhub.cloud/cmgapps/projects/cmgapp-libs/repositories/maven/libraries")
url = URI("https://helixteamhub.cloud/cmgapps/projects/cmgapp-libs/repositories/maven/libraries")
}
}

Expand Down
Loading

0 comments on commit c0ddd81

Please sign in to comment.