Skip to content
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
29 changes: 29 additions & 0 deletions .github/workflows/deploy-to-nexus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy to Nexus
on:
workflow_dispatch:
jobs:
deployAarsToNexus:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'
- shell: bash
env:
# The following env variables are used by gradle/publish-module.gradle
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
# The following env variables are used by gradle/publish-root.gradle
OSSR_USERNAME: ${{ secrets.OSSR_USERNAME }}
OSSR_PASSWORD: ${{ secrets.OSSR_PASSWORD }}
SONATYPE_STATING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
# The script generates sec.gpg file that is required by gradle/publish-module.gradle
# and starts :deployNexus lane using fastlane.
run: |
echo "${{ secrets.GPG_FILE }}" > sec.gpg.asc
gpg -d --passphrase "${{ secrets.GPG_FILE_PSWD }}" --batch sec.gpg.asc > sec.gpg
fastlane deployNexus
16 changes: 11 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
classpath 'com.android.tools.build:gradle:8.6.0'
// https://plugins.gradle.org/plugin/io.github.gradle-nexus.publish-plugin
classpath "io.github.gradle-nexus:publish-plugin:1.3.0"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -17,6 +19,10 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
}

// Maven Central publishing
apply plugin: 'io.github.gradle-nexus.publish-plugin'
apply from: rootProject.file('gradle/publish-root.gradle')
2 changes: 0 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.useAndroidX=true
android.enableJetifier=true

VERSION_NAME=2.3.0
GROUP=no.nordicsemi.android

POM_DESCRIPTION=nRF Logger API Library
Expand Down
27 changes: 27 additions & 0 deletions gradle/git-tag-version.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ext.getVersionCodeFromTags = { ->
try {
def code = new ByteArrayOutputStream()
exec {
commandLine 'git', 'tag', '--list'
standardOutput = code
}
return 14 + code.toString().split("\n").size()
}
catch (ignored) {
return -1
}
}

ext.getVersionNameFromTags = { ->
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags', '--abbrev=0'
standardOutput = stdout
}
return stdout.toString().trim().split("%")[0]
}
catch (ignored) {
return null
}
}
123 changes: 0 additions & 123 deletions gradle/gradle-bintray-push.gradle

This file was deleted.

62 changes: 62 additions & 0 deletions gradle/publish-module.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply from: rootProject.file("gradle/git-tag-version.gradle")

group = GROUP
version = getVersionNameFromTags()

tasks.register('androidSourcesJar', Jar) {
from android.sourceSets.main.java.srcDirs
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release

artifact androidSourcesJar

groupId = GROUP
artifactId = POM_ARTIFACT_ID
version = getVersionNameFromTags()

pom {
name = POM_NAME
packaging = POM_PACKAGING
description = POM_DESCRIPTION
url = POM_URL

scm {
url = POM_SCM_URL
connection = POM_SCM_CONNECTION
developerConnection = POM_SCM_DEV_CONNECTION
}

licenses {
license {
name = POM_LICENCE_NAME
url = POM_LICENCE_URL
}
}

developers {
developer {
id = POM_DEVELOPER_ID
name = POM_DEVELOPER_NAME
email = POM_DEVELOPER_EMAIL
}
}
}
}
}
}
}

ext["signing.keyId"] = System.env.GPG_SIGNING_KEY
ext["signing.password"] = System.env.GPG_PASSWORD
ext["signing.secretKeyRingFile"] = "../sec.gpg"

signing {
sign publishing.publications
}
22 changes: 22 additions & 0 deletions gradle/publish-root.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Create variables with empty default values
File secretPropsFile = project.rootProject.file('local.properties')
if (secretPropsFile.exists()) {
// Read local.properties file first if it exists
Properties p = new Properties()
new FileInputStream(secretPropsFile).withCloseable { is -> p.load(is) }
p.each { name, value -> ext[name] = value }
}

// Set up Sonatype repository

nexusPublishing {

repositories {
sonatype {
stagingProfileId = System.env.SONATYPE_STATING_PROFILE_ID
username = System.env.OSSR_USERNAME
password = System.env.OSSR_PASSWORD
}
}

}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
4 changes: 2 additions & 2 deletions library/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
The jar files were created before the project was submitted on jcenter repository.
The jar files were created before the project was submitted on Maven Central repository.

Please, use jenter to obtain the newer versions.
Please, use Maven Central to obtain the newer versions.
40 changes: 28 additions & 12 deletions log-timber/build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,48 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 29
namespace 'no.nordicsemi.android.log.timber'
compileSdk 34

defaultConfig {
minSdkVersion 16
targetSdkVersion 29
versionCode 7
versionName VERSION_NAME
minSdk 16
targetSdk 34
}

buildTypes {
release {
minifyEnabled false
}
}

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

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}

dependencies {
api project(':log')
api 'com.jakewharton.timber:timber:4.7.1'
api 'com.jakewharton.timber:timber:5.0.1'
}

afterEvaluate { project ->
android.libraryVariants.all { variant ->
tasks.androidJavadocs.doFirst {
classpath += configurations.compile
}
// === Maven Central configuration ===
if (rootProject.file('gradle/publish-module.gradle').exists()) {
ext {
POM_ARTIFACT_ID = 'log-timber'
POM_NAME = 'nRF Logger API Library'
POM_PACKAGING = 'aar'
}
apply from: rootProject.file('gradle/publish-module.gradle')
}

apply from: rootProject.file('gradle/gradle-bintray-push.gradle')
afterEvaluate {
generateMetadataFileForReleasePublication.dependsOn androidSourcesJar
}
3 changes: 0 additions & 3 deletions log-timber/gradle.properties

This file was deleted.

2 changes: 1 addition & 1 deletion log-timber/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
~
-->

<manifest package="no.nordicsemi.android.log.timber"/>
<manifest />
Loading