Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various updates #31

Merged
merged 4 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .github/workflows/gradle-wrapper-validation.yml

This file was deleted.

79 changes: 30 additions & 49 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,81 +1,62 @@
name: "Main CI"
on:
push:
pull_request:
branches: [ main ]
name: Main CI
on: [push]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
spotless:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Run Spotless
run: ./gradlew spotlessCheck

build:
runs-on: macos-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
runs-on: macos-12
steps:
- uses: actions/checkout@v1
- name: set up JDK 17
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Build with Gradle
run: ./gradlew build -x spotlessCheck
- name: Archive .gradle folder
uses: actions/upload-artifact@v1
with:
name: .gradle
path: .gradle
- name: Archive build folder
uses: actions/upload-artifact@v1
with:
name: build
path: build
- name: Archive log4k/build folder
uses: actions/upload-artifact@v1
run: ./gradlew build
- name: Archive build artifacts
uses: actions/upload-artifact@v3
with:
name: log4k_build
path: log4k/build
path: |
.gradle
build
log4k/build
log4k-slf4j/build

publish:
needs: build
runs-on: macos-latest
if: github.ref == 'refs/heads/master'
runs-on: macos-12
if: github.ref == 'refs/heads/main'
environment: Sonatype
env:
SONATYPE_GPG_KEY: ${{ secrets.SONATYPE_GPG_KEY }}
SONATYPE_GPG_KEY_PASSWORD: ${{ secrets.SONATYPE_GPG_KEY_PASSWORD }}
SECRETS_KEY: ${{ secrets.SECRETS_KEY }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v1
- name: set up JDK 17
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Download .gradle folder
uses: actions/download-artifact@v1
with:
name: .gradle
- name: Download build folder
uses: actions/download-artifact@v1
with:
name: build
- name: Download log4k/build folder
uses: actions/download-artifact@v1
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: log4k_build
- name: Publish to Sonatype (Maven Central)
Expand Down
41 changes: 0 additions & 41 deletions .github/workflows/mobsf.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Security
on: [push]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
mobfs:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Run mobsfscan
uses: MobSF/[email protected]
with:
args: . --sarif --output results.sarif || true
- name: Upload mobsfscan report
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif

gradle-validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Dependency update:
- [Kotlin 1.9.10](https://kotlinlang.org/docs/whatsnew19.html)

## [1.2.3] - 2022-10-12
### Changed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Log4K
[![Build Status](https://github.com/saschpe/log4k/workflows/Main%20CI/badge.svg)](https://github.com/saschpe/log4k/actions)
[![Maven Central](https://img.shields.io/maven-central/v/de.peilicke.sascha/log4k.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22de.peilicke.sascha%22%20AND%20a:%22log4k%22)
![Kotlin Version](https://img.shields.io/badge/Kotlin-v1.7.10-purple?style=flat&logo=kotlin)
![Kotlin Version](https://img.shields.io/badge/Kotlin-v1.9.10-purple?style=flat&logo=kotlin)
[![GitHub license](https://img.shields.io/badge/License-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)

![badge-android](http://img.shields.io/badge/Platform-Android-brightgreen.svg?style=flat)
Expand Down
29 changes: 6 additions & 23 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,36 +1,19 @@
plugins {
kotlin("jvm") version "1.7.20"
kotlin("jvm") version "1.9.10"
id("com.android.library") version "7.3.0" apply false
id("com.diffplug.spotless") version "6.11.0"
id("com.github.ben-manes.versions") version "0.42.0"
id("com.diffplug.spotless") version "6.21.0"
id("com.github.ben-manes.versions") version "0.48.0"
}

spotless {
format("misc") {
target("**/*.gradle", "*.md", "**/.gitignore")
trimTrailingWhitespace()
endWithNewline()
}
freshmark {
target("*.md")
target("**/*.md")
propertiesFile("gradle.properties")
}
kotlin {
target("source/**/src/**/*.kt")
targetExclude("**/build/**/*.kt")
ktlint().editorConfigOverride(
mapOf("disabled_rules" to "filename,no-wildcard-imports", "insert_final_newline" to false)
)
ktlint()
}
kotlinGradle {
target("**/*.gradle.kts")
ktlint().editorConfigOverride(mapOf("insert_final_newline" to false))
ktlint()
}
}

tasks.withType<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask> {
rejectVersionIf {
fun isStable(version: String) = Regex("^[0-9,.v-]+(-r)?$").matches(version)
!isStable(candidate.version) && isStable(currentVersion)
}
}
13 changes: 6 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Project-wide Gradle settings.
org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
# Gradle
file.encoding=utf-8
org.gradle.caching=true
org.gradle.configuration-cache=true
org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true

# Kotlin
kotlin.code.style=official
kotlin.mpp.stability.nowarn=true
# https://blog.jetbrains.com/kotlin/2019/01/kotlin-1-3-20-released
kotlin.parallel.tasks.in.project=true

# Android
android.enableJetifier=true
android.testConfig.useRelativePath=true
android.injected.testOnly=false
android.useAndroidX=true
11 changes: 2 additions & 9 deletions log4k-slf4j/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

kotlin {
android { publishAllLibraryVariants() }
androidTarget { publishAllLibraryVariants() }
ios()
iosSimulatorArm64()
js {
Expand All @@ -33,15 +33,8 @@ kotlin {
implementation("org.slf4j:slf4j-api:1.7.36")
}

sourceSets { // https://issuetracker.google.com/issues/152187160
remove(sourceSets["androidAndroidTestRelease"])
remove(sourceSets["androidTestFixtures"])
remove(sourceSets["androidTestFixturesDebug"])
remove(sourceSets["androidTestFixturesRelease"])
}

targets.withType(org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithSimulatorTests::class.java) {
testRuns["test"].deviceId = "iPhone 13"
testRuns["test"].deviceId = "iPhone 14"
}
}

Expand Down
11 changes: 2 additions & 9 deletions log4k/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

kotlin {
android { publishAllLibraryVariants() }
androidTarget { publishAllLibraryVariants() }
ios()
iosSimulatorArm64()
js {
Expand All @@ -24,15 +24,8 @@ kotlin {
sourceSets["iosSimulatorArm64Main"].dependsOn(sourceSets["iosMain"])
sourceSets["iosSimulatorArm64Test"].dependsOn(sourceSets["iosTest"])

sourceSets { // https://issuetracker.google.com/issues/152187160
remove(sourceSets["androidAndroidTestRelease"])
remove(sourceSets["androidTestFixtures"])
remove(sourceSets["androidTestFixturesDebug"])
remove(sourceSets["androidTestFixturesRelease"])
}

targets.withType(org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithSimulatorTests::class.java) {
testRuns["test"].deviceId = "iPhone 13"
testRuns["test"].deviceId = "iPhone 14"
}
}

Expand Down
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
google()
}
}

dependencyResolutionManagement {
@Suppress("UnstableApiUsage")
repositories {
mavenCentral()
google()
Expand All @@ -16,4 +16,4 @@ dependencyResolutionManagement {
rootProject.name = "Log4K"

include(":log4k")
include(":log4k-slf4j")
include(":log4k-slf4j")