Skip to content

Commit 5246d0e

Browse files
committed
Android Studio 4, Bintray script updated
1 parent fde204c commit 5246d0e

File tree

8 files changed

+170
-172
lines changed

8 files changed

+170
-172
lines changed

build.gradle

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@ buildscript {
66
jcenter()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.2.1'
10-
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
11-
// The following dependency has been replaced with newer version according to https://github.com/dcendents/android-maven-plugin
12-
// classpath 'com.github.dcendents:android-maven-plugin:1.2'
13-
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
9+
classpath 'com.android.tools.build:gradle:4.0.0'
10+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
1411

1512
// NOTE: Do not place your application dependencies here; they belong
1613
// in the individual module build.gradle files

gradle.properties

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Project-wide Gradle settings.
2+
3+
# IDE (e.g. Android Studio) users:
4+
# Gradle settings configured through the IDE *will override*
5+
# any settings specified in this file.
6+
7+
# For more details on how to configure your build environment visit
8+
# http://www.gradle.org/docs/current/userguide/build_environment.html
9+
10+
# Specifies the JVM arguments used for the daemon process.
11+
# The setting is particularly useful for tweaking memory settings.
12+
13+
# When configured, Gradle will run in incubating parallel mode.
14+
# This option should only be used with decoupled projects. More details, visit
15+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
16+
# org.gradle.parallel=true
17+
android.useAndroidX=true
18+
19+
VERSION_NAME=2.2.0
20+
GROUP=no.nordicsemi.android
21+
22+
POM_DESCRIPTION=nRF Logger API Library
23+
POM_URL=https://github.com/NordicSemiconductor/nRF-Logger-API
24+
POM_SCM_URL=https://github.com/NordicSemiconductor/nRF-Logger-API
25+
POM_SCM_CONNECTION=scm:git@ggithub.com/NordicSemiconductor/nRF-Logger-API.git
26+
POM_SCM_DEV_CONNECTION=scm:git@github.com/NordicSemiconductor/nRF-Logger-API.git
27+
POM_LICENCE=BSD-3-Clause
28+
POM_LICENCE_NAME=The BSD 3-Clause License
29+
POM_LICENCE_URL=http://opensource.org/licenses/BSD-3-Clause
30+
POM_DEVELOPER_ID=nordic
31+
POM_DEVELOPER_NAME=Nordic Semiconductor ASA
32+
POM_DEVELOPER_EMAIL=mag@nordicsemi.no

gradle/gradle-bintray-push.gradle

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
apply plugin: 'maven-publish'
2+
apply plugin: 'com.jfrog.bintray'
3+
4+
version = VERSION_NAME
5+
group = GROUP
6+
7+
task androidJavadocs(type: Javadoc) {
8+
source = android.sourceSets.main.java.srcDirs
9+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
10+
android.libraryVariants.all { variant ->
11+
if (variant.name == 'release') {
12+
owner.classpath += variant.javaCompileProvider.get().classpath
13+
}
14+
}
15+
exclude '**/R.html', '**/R.*.html', '**/index.html'
16+
}
17+
18+
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
19+
archiveClassifier.set('javadoc')
20+
from androidJavadocs.destinationDir
21+
}
22+
23+
task androidSourcesJar(type: Jar) {
24+
archiveClassifier.set('sources')
25+
from android.sourceSets.main.java.srcDirs
26+
}
27+
28+
afterEvaluate { project ->
29+
publishing {
30+
publications {
31+
release(MavenPublication) {
32+
from components.release
33+
34+
artifact androidSourcesJar
35+
artifact androidJavadocsJar
36+
37+
groupId = GROUP
38+
artifactId = POM_ARTIFACT_ID
39+
version = VERSION_NAME
40+
41+
pom {
42+
name = POM_NAME
43+
packaging = POM_PACKAGING
44+
description = POM_DESCRIPTION
45+
url = POM_URL
46+
47+
scm {
48+
url = POM_SCM_URL
49+
connection = POM_SCM_CONNECTION
50+
developerConnection = POM_SCM_DEV_CONNECTION
51+
}
52+
53+
licenses {
54+
license {
55+
name = POM_LICENCE_NAME
56+
url = POM_LICENCE_URL
57+
}
58+
}
59+
60+
developers {
61+
developer {
62+
id = POM_DEVELOPER_ID
63+
name = POM_DEVELOPER_NAME
64+
email = POM_DEVELOPER_EMAIL
65+
}
66+
}
67+
}
68+
}
69+
}
70+
}
71+
72+
if (JavaVersion.current().isJava8Compatible()) {
73+
allprojects {
74+
tasks.withType(Javadoc) {
75+
options.addStringOption('Xdoclint:none', '-quiet')
76+
}
77+
}
78+
}
79+
}
80+
81+
// Bintray
82+
Properties properties = new Properties()
83+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
84+
85+
bintray {
86+
user = properties.getProperty("BINTRAY_USER")
87+
key = properties.getProperty("BINTRAY_APIKEY")
88+
89+
publications = ['release']
90+
91+
pkg {
92+
name = GROUP + ":" + POM_ARTIFACT_ID
93+
desc = POM_DESCRIPTION
94+
95+
userOrg = properties.getProperty("BINTRAY_USER_ORG")
96+
repo = properties.getProperty("BINTRAY_REPO")
97+
98+
websiteUrl = POM_URL
99+
issueTrackerUrl = POM_URL + "/issues"
100+
vcsUrl = POM_URL + ".git"
101+
102+
licenses = [POM_LICENCE]
103+
104+
publish = true
105+
publicDownloadNumbers = true
106+
107+
version {
108+
desc = POM_DESCRIPTION
109+
vcsTag = "v" + VERSION_NAME
110+
gpg {
111+
sign = true // Determines whether to GPG sign the files. The default is false
112+
passphrase = properties.getProperty("BINTRAY_GPG_PASSWORD") // Optional. The passphrase for GPG signing'
113+
}
114+
// Optional configuration for Maven Central sync of the version
115+
mavenCentralSync {
116+
sync = true //[Default: true] Determines whether to sync the version to Maven Central.
117+
user = properties.getProperty("SONATYPE_NEXUS_USERNAME") //OSS user token: mandatory
118+
password = properties.getProperty("SONATYPE_NEXUS_PASSWORD") //OSS user password: mandatory
119+
close = '1' //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually.
120+
}
121+
}
122+
}
123+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Jan 13 13:58:02 CET 2017
1+
#Tue Jun 09 10:23:33 CEST 2020
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

log-timber/build.gradle

Lines changed: 3 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,5 @@
11
apply plugin: 'com.android.library'
22

3-
/*
4-
* I followed this:
5-
* http://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-maven-central-as-dependency/en
6-
* tutorial to publish the library on jcenter and Maven Central repositories.
7-
* Some changes needed to be done. See below for details.
8-
*
9-
* A newer then described version of maven plugin dependency is required (see project's gradle.build).
10-
*/
11-
12-
apply plugin: 'com.github.dcendents.android-maven'
13-
apply plugin: 'com.jfrog.bintray'
14-
15-
ext {
16-
PUBLISH_GROUP_ID = 'no.nordicsemi.android'
17-
PUBLISH_ARTIFACT_ID = 'log-timber'
18-
PUBLISH_VERSION = '2.2.0'
19-
20-
bintrayRepo = 'android'
21-
bintrayName = 'nrf-logger-timber'
22-
23-
publishedGroupId = PUBLISH_GROUP_ID
24-
artifact = PUBLISH_ARTIFACT_ID
25-
libraryVersion = PUBLISH_VERSION
26-
libraryName = 'nRF Logger Timber Tree'
27-
libraryDescription = 'nRF Logger Timber Tree'
28-
29-
issuesUrl = 'https://github.com/NordicSemiconductor/nRF-Logger-API/issues'
30-
siteUrl = 'https://github.com/NordicSemiconductor/nRF-Logger-API'
31-
gitUrl = 'https://github.com/NordicSemiconductor/nRF-Logger-API.git'
32-
33-
developerId = 'philips77'
34-
developerName = 'Aleksander Nowakowski'
35-
developerEmail = 'aleksander.nowakowski@nordicsemi.no'
36-
37-
licenseName = 'The BSD 3-Clause License'
38-
licenseUrl = 'http://opensource.org/licenses/BSD-3-Clause'
39-
allLicenses = ["BSD 3-Clause"]
40-
}
41-
423
android {
434
compileSdkVersion 28
445
buildToolsVersion '28.0.3'
@@ -47,7 +8,7 @@ android {
478
minSdkVersion 16
489
targetSdkVersion 28
4910
versionCode 7
50-
versionName "2.2.0"
11+
versionName VERSION_NAME
5112
}
5213
buildTypes {
5314
release {
@@ -57,7 +18,7 @@ android {
5718
}
5819

5920
dependencies {
60-
api 'no.nordicsemi.android:log:2.2.0'
21+
api project(':log')
6122
api 'com.jakewharton.timber:timber:4.7.1'
6223
}
6324

@@ -69,45 +30,4 @@ afterEvaluate { project ->
6930
}
7031
}
7132

72-
// The following script creates a POM file required to publish on Maven Central
73-
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
74-
75-
// This script creates sources and javadocs. Both are required to publish a library on jcenter and MC.
76-
apply from: 'https://raw.githubusercontent.com/ArthurHub/release-android-library/master/android-release-aar.gradle'
77-
78-
// The following link publishes the library to jcenter. It does not handle the userOrg, so it has been copied and modified below.
79-
//apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
80-
81-
// Copied from https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle
82-
version = libraryVersion
83-
84-
// Bintray
85-
Properties properties = new Properties()
86-
properties.load(project.rootProject.file('local.properties').newDataInputStream())
87-
88-
bintray {
89-
user = properties.getProperty("bintray.user")
90-
key = properties.getProperty("bintray.apikey")
91-
92-
configurations = ['archives']
93-
pkg {
94-
repo = bintrayRepo
95-
name = bintrayName
96-
userOrg = properties.getProperty("bintray.userOrg")
97-
desc = libraryDescription
98-
websiteUrl = siteUrl
99-
issueTrackerUrl = issuesUrl
100-
vcsUrl = gitUrl
101-
licenses = allLicenses
102-
publish = true
103-
publicDownloadNumbers = true
104-
version {
105-
desc = libraryDescription
106-
gpg {
107-
sign = true //Determines whether to GPG sign the files. The default is false
108-
passphrase = properties.getProperty("bintray.gpg.password")
109-
//Optional. The passphrase for GPG signing'
110-
}
111-
}
112-
}
113-
}
33+
apply from: rootProject.file('gradle/gradle-bintray-push.gradle')

log-timber/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
POM_ARTIFACT_ID=log-timber
2+
POM_NAME=Timber extension for nRF Logger Library
3+
POM_PACKAGING=aar

log/build.gradle

Lines changed: 2 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,5 @@
11
apply plugin: 'com.android.library'
22

3-
/*
4-
* I followed this:
5-
* http://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-maven-central-as-dependency/en
6-
* tutorial to publish the library on jcenter and Maven Central repositories.
7-
* Some changes needed to be done. See below for details.
8-
*
9-
* A newer then described version of maven plugin dependency is required (see project's gradle.build).
10-
*/
11-
12-
apply plugin: 'com.github.dcendents.android-maven'
13-
apply plugin: 'com.jfrog.bintray'
14-
15-
ext {
16-
PUBLISH_GROUP_ID = 'no.nordicsemi.android'
17-
PUBLISH_ARTIFACT_ID = 'log'
18-
PUBLISH_VERSION = '2.2.0'
19-
20-
bintrayRepo = 'android'
21-
bintrayName = 'nrf-logger-api'
22-
23-
publishedGroupId = PUBLISH_GROUP_ID
24-
artifact = PUBLISH_ARTIFACT_ID
25-
libraryVersion = PUBLISH_VERSION
26-
libraryName = 'nRF Logger API'
27-
libraryDescription = 'nRF Logger API Library'
28-
29-
issuesUrl = 'https://github.com/NordicSemiconductor/nRF-Logger-API/issues'
30-
siteUrl = 'https://github.com/NordicSemiconductor/nRF-Logger-API'
31-
gitUrl = 'https://github.com/NordicSemiconductor/nRF-Logger-API.git'
32-
33-
developerId = 'philips77'
34-
developerName = 'Aleksander Nowakowski'
35-
developerEmail = 'aleksander.nowakowski@nordicsemi.no'
36-
37-
licenseName = 'The BSD 3-Clause License'
38-
licenseUrl = 'http://opensource.org/licenses/BSD-3-Clause'
39-
allLicenses = ["BSD 3-Clause"]
40-
}
41-
423
android {
434
compileSdkVersion 28
445
buildToolsVersion '28.0.3'
@@ -47,7 +8,7 @@ android {
478
minSdkVersion 16
489
targetSdkVersion 28
4910
versionCode 7
50-
versionName "2.2.0"
11+
versionName VERSION_NAME
5112
}
5213
buildTypes {
5314
release {
@@ -70,45 +31,4 @@ afterEvaluate { project ->
7031
}
7132
}
7233

73-
// The following script creates a POM file required to publish on Maven Central
74-
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
75-
76-
// This script creates sources and javadocs. Both are required to publish a library on jcenter and MC.
77-
apply from: 'https://raw.githubusercontent.com/ArthurHub/release-android-library/master/android-release-aar.gradle'
78-
79-
// The following link publishes the library to jcenter. It does not handle the userOrg, so it has been copied and modified below.
80-
//apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
81-
82-
// Copied from https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle
83-
version = libraryVersion
84-
85-
// Bintray
86-
Properties properties = new Properties()
87-
properties.load(project.rootProject.file('local.properties').newDataInputStream())
88-
89-
bintray {
90-
user = properties.getProperty("bintray.user")
91-
key = properties.getProperty("bintray.apikey")
92-
93-
configurations = ['archives']
94-
pkg {
95-
repo = bintrayRepo
96-
name = bintrayName
97-
userOrg = properties.getProperty("bintray.userOrg")
98-
desc = libraryDescription
99-
websiteUrl = siteUrl
100-
issueTrackerUrl = issuesUrl
101-
vcsUrl = gitUrl
102-
licenses = allLicenses
103-
publish = true
104-
publicDownloadNumbers = true
105-
version {
106-
desc = libraryDescription
107-
gpg {
108-
sign = true //Determines whether to GPG sign the files. The default is false
109-
passphrase = properties.getProperty("bintray.gpg.password")
110-
//Optional. The passphrase for GPG signing'
111-
}
112-
}
113-
}
114-
}
34+
apply from: rootProject.file('gradle/gradle-bintray-push.gradle')

0 commit comments

Comments
 (0)