This repository has been archived by the owner on May 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202 from andriydruk/feature/migrate-to-maven-central
Migrate to Maven Central
- Loading branch information
Showing
11 changed files
with
169 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
|
||
buildscript { | ||
repositories { | ||
jcenter() | ||
google() | ||
maven { | ||
url "https://plugins.gradle.org/m2/" | ||
} | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:4.1.1' | ||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' | ||
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' | ||
classpath 'com.android.tools.build:gradle:4.2.0' | ||
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0' | ||
// NOTE: Do not place your application dependencies here; they belong | ||
// in the individual module build.gradle files | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
jcenter() | ||
google() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
|
@@ -37,25 +37,5 @@ task clean(type: Delete) { | |
delete rootProject.buildDir | ||
} | ||
|
||
ext { | ||
bintrayRepo = 'maven' | ||
bintrayPackaging = 'aar' | ||
bintrayConfigurations = ['archives'] | ||
|
||
bintrayGroup = 'com.github.andriydruk' | ||
bintrayVersion = '0.9.14' | ||
|
||
bintrayLibraryDescription = 'Android version of Apple DNSSD Java API' | ||
|
||
bintrayDeveloperId = 'andriydruk' | ||
bintrayDeveloperName = 'Andriy Druk' | ||
bintrayDeveloperEmail = '[email protected]' | ||
|
||
bintrayLicenseName = 'The Apache Software License, Version 2.0' | ||
bintrayLicenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
bintrayAllLicenses = ["Apache-2.0"] | ||
|
||
bintrayWebsiteUrl = "https://github.com/andriydruk/RxDNSSD" | ||
bintrayIssueTrackerUrl = "https://github.com/andriydruk/RxDNSSD/issues" | ||
binstrayVCSUrl = "https://github.com/andriydruk/RxDNSSD.git" | ||
} | ||
apply plugin: 'io.github.gradle-nexus.publish-plugin' | ||
apply from: "${rootDir}/publish-root.gradle" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
task androidSourcesJar(type: Jar) { | ||
archiveClassifier.set('sources') | ||
if (project.plugins.findPlugin("com.android.library")) { | ||
// For Android libraries | ||
from android.sourceSets.main.java.srcDirs | ||
} | ||
} | ||
|
||
artifacts { | ||
archives androidSourcesJar | ||
} | ||
|
||
group = PUBLISH_GROUP_ID | ||
version = mavenCentralVersion | ||
|
||
afterEvaluate { | ||
publishing { | ||
publications { | ||
release(MavenPublication) { | ||
// The coordinates of the library, being set from variables that | ||
// we'll set up later | ||
groupId PUBLISH_GROUP_ID | ||
artifactId PUBLISH_ARTIFACT_ID | ||
version mavenCentralVersion | ||
|
||
// Two artifacts, the `aar` (or `jar`) and the sources | ||
if (project.plugins.findPlugin("com.android.library")) { | ||
from components.release | ||
} else { | ||
artifact("$buildDir/libs/${project.getName()}-${version}.jar") | ||
} | ||
|
||
artifact androidSourcesJar | ||
|
||
// Mostly self-explanatory metadata | ||
pom { | ||
name = PUBLISH_ARTIFACT_ID | ||
description = 'Android version of Apple DNSSD Java API' | ||
url = 'https://github.com/andriydruk/RxDNSSD' | ||
licenses { | ||
license { | ||
name = 'The Apache Software License, Version 2.0' | ||
url = 'https://github.com/andriydruk/RxDNSSD/blob/master/LICENSE' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'andriydruk' | ||
name = 'Andrew Druk' | ||
email = '[email protected]' | ||
} | ||
} | ||
|
||
// Version control info - if you're using GitHub, follow the | ||
// format as seen here | ||
scm { | ||
connection = 'scm:git:github.com/andriydruk/RxDNSSD.git' | ||
developerConnection = 'scm:git:ssh://github.com/andriydruk/RxDNSSD.git' | ||
url = 'https://github.com/andriydruk/RxDNSSD/tree/master' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
ext["signing.keyId"] = rootProject.ext["signing.keyId"] | ||
ext["signing.password"] = rootProject.ext["signing.password"] | ||
ext["signing.secretKeyRingFile"] = rootProject.ext["signing.secretKeyRingFile"] | ||
|
||
signing { | ||
sign publishing.publications | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Create variables with empty default values | ||
ext["signing.keyId"] = '' | ||
ext["signing.password"] = '' | ||
ext["signing.secretKeyRingFile"] = '' | ||
ext["ossrhUsername"] = '' | ||
ext["ossrhPassword"] = '' | ||
ext["sonatypeStagingProfileId"] = '' | ||
ext["mavenCentralVersion"] = '' | ||
|
||
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 } | ||
} else { | ||
// Use system environment variables | ||
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME') | ||
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD') | ||
ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID') | ||
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID') | ||
ext["signing.password"] = System.getenv('SIGNING_PASSWORD') | ||
ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_SECRET_KEY_RING_FILE') | ||
ext["mavenCentralVersion"] = System.getenv('PUBLISH_VERSION') | ||
} | ||
|
||
// Set up Sonatype repository | ||
nexusPublishing { | ||
repositories { | ||
sonatype { | ||
stagingProfileId = sonatypeStagingProfileId | ||
username = ossrhUsername | ||
password = ossrhPassword | ||
//nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) | ||
//snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) | ||
} | ||
} | ||
} |
Oops, something went wrong.