Skip to content

Commit

Permalink
Configure Maven Central publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
azabost committed Jul 18, 2024
1 parent 427e52b commit a4186d1
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 83 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:

steps:
- uses: actions/checkout@v4.1.1
- name: set up JDK 17
- name: set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '21'
distribution: 'temurin'
cache: gradle

Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
slf4android
===========

A simple implementation of [slf4j api](http://www.slf4j.org/) using android `java.util.logging.*`. This means you can **easily hook in any existing** `java.util.logging.Handler` implementations.
A simple implementation of [SLF4J API](http://www.slf4j.org/) using Android `java.util.logging.*`. This means you can **easily hook in any existing** `java.util.logging.Handler` implementations.

To use this little gem you'll need to add `https://jitpack.io` to your repositories:
To use this little gem, make sure you have Maven Central in your repositories:
```groovy
repositories {
maven {
url "https://jitpack.io"
}
mavenCentral()
}
```
and then declare a dependency inside a module:
```groovy
dependencies {
// just SLF4J binding
implementation("com.github.bright.slf4android:slf4android:$slf4androidVersion")
implementation("dev.bright.slf4android:slf4android:$slf4androidVersion")
// (optional) a handler for file logging
implementation("com.github.bright.slf4android:slf4android-handler-file-log:$slf4androidVersion")
implementation("dev.bright.slf4android:handler-file-log:$slf4androidVersion")
// (optional) a handler for notifying the developer in case of an error
implementation("com.github.bright.slf4android:slf4android-handler-notify-developer:$slf4androidVersion")
implementation("dev.bright.slf4android:handler-notify-developer:$slf4androidVersion")
}
```
As with any slf4j compatible implementation using slf4android looks like this:
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.4.0'
//classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.android.tools.build:gradle:8.5.1'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.29.0'
}
}

Expand Down
22 changes: 1 addition & 21 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'com.android.library'
id 'maven-publish'
id 'com.vanniktech.maven.publish'
}

android {
Expand All @@ -21,12 +21,6 @@ android {
}
}

publishing {
singleVariant('release') {
withSourcesJar()
}
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
Expand All @@ -48,17 +42,3 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

publishing {
publications {
release(MavenPublication) {
groupId = 'com.github.bright.slf4android'
artifactId = 'slf4android'
version = '1.0'

afterEvaluate {
from components.release
}
}
}
}
3 changes: 3 additions & 0 deletions core/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_ARTIFACT_ID=slf4android
POM_NAME=slf4android
POM_DESCRIPTION=A simple implementation of SLF4J API using Android java.util.logging
22 changes: 21 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,24 @@
#Fri Dec 29 13:06:46 CET 2023
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx4g -Xms1g
org.gradle.jvmargs=-Xmx4g -Xms1g

GROUP=dev.bright.slf4android
VERSION_NAME=0.1.8

POM_URL=https://github.com/bright/slf4android/

POM_LICENSE_NAME=MIT License
POM_LICENSE_URL=https://opensource.org/license/mit
POM_LICENSE_DIST=repo

POM_SCM_URL=https://github.com/bright/slf4android/
POM_SCM_CONNECTION=scm:git:git://github.com/bright/slf4android.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://github.com:bright/slf4android.git

POM_DEVELOPER_ID=bright
POM_DEVELOPER_NAME=Bright Inventions
POM_DEVELOPER_URL=https://github.com/bright/

SONATYPE_HOST=S01
RELEASE_SIGNING_ENABLED=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Dec 29 11:11:03 CET 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
22 changes: 1 addition & 21 deletions handler-file-log/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'com.android.library'
id 'maven-publish'
id 'com.vanniktech.maven.publish'
}

android {
Expand All @@ -21,12 +21,6 @@ android {
}
}

publishing {
singleVariant('release') {
withSourcesJar()
}
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
Expand All @@ -48,17 +42,3 @@ dependencies {
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'org.easytesting:fest-util:1.2.5'
}

publishing {
publications {
release(MavenPublication) {
groupId = 'com.github.bright.slf4android'
artifactId = 'slf4android-handler-file-log'
version = '1.0'

afterEvaluate {
from components.release
}
}
}
}
3 changes: 3 additions & 0 deletions handler-file-log/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_ARTIFACT_ID=handler-file-log
POM_NAME=File logging handler
POM_DESCRIPTION=A handler for file logging
34 changes: 9 additions & 25 deletions handler-notify-developer/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'com.android.library'
id 'maven-publish'
id 'com.vanniktech.maven.publish'
}

android {
Expand All @@ -13,17 +13,15 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

publishing {
singleVariant('release') {
withSourcesJar()
}
}

packagingOptions {
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
resources {
excludes += [
'LICENSE.txt',
'META-INF/LICENSE.txt',
'META-INF/LICENSE',
'META-INF/NOTICE'
]
}
}

useLibrary 'android.test.runner'
Expand Down Expand Up @@ -53,17 +51,3 @@ dependencies {
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'org.easytesting:fest-util:1.2.5'
}

publishing {
publications {
release(MavenPublication) {
groupId = 'com.github.bright.slf4android'
artifactId = 'slf4android-handler-notify-developer'
version = '1.0'

afterEvaluate {
from components.release
}
}
}
}
3 changes: 3 additions & 0 deletions handler-notify-developer/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_ARTIFACT_ID=handler-notify-developer
POM_NAME=Notify developer handler
POM_DESCRIPTION=A handler that notifies the app developer about an error when the device is shaked
4 changes: 2 additions & 2 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
before_install:
- sdk install java 17.0.9-tem
- sdk use java 17.0.9-tem
- sdk install java 21.0.3-tem
- sdk use java 21.0.3-tem

0 comments on commit a4186d1

Please sign in to comment.