Skip to content

Commit b9589eb

Browse files
committed
Refactor tinylog 3
1 parent 6433767 commit b9589eb

File tree

514 files changed

+16818
-17720
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

514 files changed

+16818
-17720
lines changed

.github/renovate.json

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": [ "config:base" ],
3+
"extends": [
4+
"config:recommended"
5+
],
46
"packageRules": [
57
{
6-
"matchUpdateTypes": [ "minor", "patch" ],
8+
"matchUpdateTypes": [
9+
"minor",
10+
"patch"
11+
],
712
"automerge": true,
813
"automergeType": "branch",
914
"automergeStrategy": "rebase"
1015
},
1116
{
12-
"matchPackagePatterns": ["^org.tinylog:"],
17+
"matchUpdateTypes": [
18+
"major",
19+
"minor"
20+
],
21+
"enabled": false,
22+
"matchPackageNames": [
23+
"/^org.robolectric:android-all/"
24+
]
25+
},
26+
{
1327
"matchCurrentValue": "/-SNAPSHOT$/",
14-
"enabled": false
28+
"enabled": false,
29+
"matchPackageNames": [
30+
"/^org.tinylog:/"
31+
]
1532
}
1633
]
1734
}

.github/workflows/build.yaml

Lines changed: 15 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,27 @@ name: Build Repository
22

33
on:
44
push:
5-
branches: [ "v*" ]
6-
pull_request:
75
branches: [ "**" ]
6+
pull_request:
7+
branches-ignore: [ "renovate/**" ]
88

99
jobs:
1010

1111
build:
1212

1313
name: Build with JDK ${{ matrix.jdk }}
14-
runs-on: ubuntu-22.04
14+
runs-on: ubuntu-24.04
1515

1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
jdk: [ 11, 17 ]
19+
jdk: [ 11, 17, 21 ]
2020

2121
steps:
2222

2323
- name: Checkout Git repository
2424
uses: actions/checkout@v4
2525

26-
- name: Restore local Maven repository
27-
uses: actions/cache@v4
28-
with:
29-
path: ~/.m2/repository
30-
key: tinylog3-jvm-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
31-
restore-keys: |
32-
tinylog3-jvm-${{ runner.os }}-maven-
33-
3426
- name: Download and install JDK ${{ matrix.jdk }}
3527
uses: actions/setup-java@v4
3628
with:
@@ -49,78 +41,41 @@ jobs:
4941
android-tests:
5042

5143
name: Tests on Android (API level ${{ matrix.api-level }})
52-
runs-on: macos-13
53-
timeout-minutes: 60
44+
runs-on: ubuntu-24.04
45+
timeout-minutes: 30
5446

5547
strategy:
5648
fail-fast: false
5749
matrix:
58-
api-level: [ 26, 33 ]
50+
api-level: [ 26, 35 ]
5951

6052
steps:
6153

6254
- name: Checkout Git repository
6355
uses: actions/checkout@v4
6456

65-
- name: Restore local Maven repository
66-
uses: actions/cache@v4
67-
with:
68-
path: ~/.m2/repository
69-
key: tinylog3-android-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
70-
restore-keys: |
71-
tinylog3-android-${{ runner.os }}-maven-
72-
73-
- name: Restore Gradle caches and wrapper
74-
uses: actions/cache@v4
75-
with:
76-
path: |
77-
~/.gradle/caches
78-
~/.gradle/wrapper
79-
key: tinylog3-android-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
80-
restore-keys: |
81-
tinylog3-android-${{ runner.os }}-gradle-
82-
83-
- name: Restore Android virtual device
84-
id: avd-cache
85-
uses: actions/cache@v4
86-
with:
87-
path: |
88-
~/.android/avd/*
89-
~/.android/adb*
90-
key: tinylog3-${{ runner.os }}-avd${{ matrix.api-level }}
91-
9257
- name: Download and install JDK 17
9358
uses: actions/setup-java@v4
9459
with:
9560
distribution: zulu
9661
java-version: 17
9762

98-
- name: Install core and impl artifacts via Maven
63+
- name: Install tinylog artifacts via Maven
9964
run: mvn --batch-mode --update-snapshots --also-make --projects :tinylog-core,:tinylog-impl install -DskipTests
10065

101-
- name: Set up Android virtual device if not cached
102-
uses: reactivecircus/android-emulator-runner@v2
103-
if: steps.avd-cache.outputs.cache-hit != 'true'
104-
with:
105-
api-level: ${{ matrix.api-level }}
106-
arch: x86_64
107-
target: ${{ matrix.api-level >= 30 && 'google_apis' || 'default' }}
108-
force-avd-creation: false
109-
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
110-
disable-animations: false
111-
script: echo "Generated AVD snapshot for caching."
66+
- name: Enable KVM
67+
run: |
68+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
69+
sudo udevadm control --reload-rules
70+
sudo udevadm trigger --name-match=kvm
11271
11372
- name: Run instrumented tests on Android virtual device
11473
uses: reactivecircus/android-emulator-runner@v2
11574
with:
11675
api-level: ${{ matrix.api-level }}
11776
arch: x86_64
118-
target: ${{ matrix.api-level >= 30 && 'google_apis' || 'default' }}
119-
force-avd-creation: false
120-
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
121-
disable-animations: true
122-
working-directory: ./tinylog-android-tests
123-
script: chmod +x ./gradlew && ./gradlew createDebugCoverageReport spotbugsDebug checkstyle
77+
working-directory: ./android-tests
78+
script: ./gradlew createDebugCoverageReport spotbugsDebug checkstyle --no-daemon --no-build-cache
12479

12580
- name: Upload code coverage report
12681
uses: codecov/codecov-action@v4

tinylog-android-tests/build.gradle renamed to android-tests/build.gradle

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ buildscript {
1313
}
1414

1515
dependencies {
16-
classpath "com.android.tools.build:gradle:8.3.2"
17-
classpath "com.github.spotbugs.snom:spotbugs-gradle-plugin:6.0.2"
18-
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.10.0.0"
19-
classpath "org.jacoco:org.jacoco.core:0.8.12"
16+
classpath "com.android.tools.build:gradle:8.9.1"
17+
classpath "com.github.spotbugs.snom:spotbugs-gradle-plugin:6.1.7"
18+
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.12.0.0"
19+
classpath "org.jacoco:org.jacoco.core:0.8.13"
2020
}
2121
}
2222

@@ -30,33 +30,21 @@ repositories {
3030
dependencies {
3131
implementation "org.tinylog:tinylog-core:${version}"
3232
implementation "org.tinylog:tinylog-impl:${version}"
33-
androidTestImplementation "androidx.test:runner:1.5.2"
34-
androidTestImplementation "de.mannodermaus.junit5:android-test-core:1.4.0"
35-
androidTestImplementation "javax.inject:javax.inject:1"
36-
androidTestImplementation "org.assertj:assertj-core:3.25.3"
37-
androidTestImplementation "org.junit.jupiter:junit-jupiter-api:5.10.2"
38-
androidTestImplementation "org.junit.jupiter:junit-jupiter-params:5.10.2"
39-
androidTestImplementation "org.mockito:mockito-android:5.11.0"
33+
androidTestImplementation "androidx.test:runner:1.6.2"
34+
androidTestImplementation "de.mannodermaus.junit5:android-test-core:1.7.0"
35+
androidTestImplementation "jakarta.inject:jakarta.inject-api:2.0.1"
36+
androidTestImplementation "org.assertj:assertj-core:3.27.3"
37+
androidTestImplementation "org.junit.jupiter:junit-jupiter-api:5.12.2"
38+
androidTestImplementation "org.junit.jupiter:junit-jupiter-params:5.12.2"
39+
androidTestImplementation "org.mockito:mockito-android:5.17.0"
4040
androidTestImplementation "org.tinylog:tinylog-core:${version}:tests"
41-
androidTestImplementation "org.tinylog:tinylog-impl:${version}:tests"
42-
androidTestRuntimeOnly "de.mannodermaus.junit5:android-test-runner:1.4.0"
41+
androidTestRuntimeOnly "de.mannodermaus.junit5:android-test-runner:1.7.0"
4342
}
4443

4544
android {
46-
namespace "tinylog"
47-
buildToolsVersion "30.0.3"
45+
namespace = "tinylog"
4846

49-
sourceSets {
50-
main {
51-
java {
52-
srcDirs += "../tinylog-core/src/main/java"
53-
srcDirs += "../tinylog-impl/src/main/java"
54-
exclude "**/JavaRuntime.java", "**/JdbcWriter*.java", "**/JndiValueResolver.java"
55-
}
56-
}
57-
}
58-
59-
compileSdkVersion 33
47+
compileSdkVersion 35
6048

6149
compileOptions {
6250
sourceCompatibility JavaVersion.VERSION_11
@@ -65,13 +53,13 @@ android {
6553

6654
buildTypes {
6755
debug {
68-
testCoverageEnabled true
56+
testCoverageEnabled = true
6957
}
7058
}
7159

7260
defaultConfig {
7361
minSdkVersion 26
74-
targetSdkVersion 33
62+
targetSdkVersion 35
7563
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
7664
testInstrumentationRunnerArgument("runnerBuilder", "de.mannodermaus.junit5.AndroidJUnit5Builder")
7765
}
@@ -82,11 +70,15 @@ android {
8270
}
8371
}
8472

73+
checkstyle {
74+
toolVersion = "10.23.0"
75+
}
76+
8577
spotbugs {
8678
excludeFilter = file("../configuration/spotbugs-filters.xml")
8779
}
8880

89-
task checkstyle(type: Checkstyle) {
81+
tasks.register("checkstyle", Checkstyle) {
9082
configFile file("../configuration/checkstyle-rules.xml")
9183
configProperties["workspace_loc"] = file("..").path
9284
source "src"
File renamed without changes.
42.7 KB
Binary file not shown.

tinylog-android-tests/gradle/wrapper/gradle-wrapper.properties renamed to android-tests/gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
3+
distributionSha256Sum=20f1b1176237254a6fc204d8434196fa11a4cfb387567519c61556e8710aed78
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

tinylog-android-tests/gradlew renamed to android-tests/gradlew

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,7 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
8890

8991
# Use the maximum available, or set MAX_FD != -1 to use that value.
9092
MAX_FD=maximum
@@ -203,7 +205,7 @@ fi
203205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204206

205207
# Collect all arguments for the java command:
206-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207209
# and any embedded shellness will be escaped.
208210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209211
# treated as '${Hostname}' itself on the command line.

0 commit comments

Comments
 (0)