This repository has been archived by the owner on Sep 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 520
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There are now three Maven artifacts: * bolts-android - Android, No sources, dependencies on bolts-tasks and bolts-applinks for backwards compatibility * bolts-tasks - Java, contains TPL * bolts-applinks - Android, contains AppLinks
- Loading branch information
Showing
4 changed files
with
183 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import com.android.builder.core.BuilderConstants | ||
|
||
apply plugin: 'com.android.library' | ||
|
||
group = GROUP_NAME | ||
version = VERSION_NAME | ||
|
||
android { | ||
compileSdkVersion rootProject.ext.compileSdkVersion | ||
buildToolsVersion rootProject.ext.buildToolsVersion | ||
|
@@ -25,3 +30,107 @@ dependencies { | |
|
||
androidTestCompile 'com.android.support:support-v4:23.0.1' | ||
} | ||
|
||
android.libraryVariants.all { variant -> | ||
def name = variant.buildType.name | ||
def task = project.tasks.create(name: "jar${name.capitalize()}", type: Jar) { | ||
dependsOn variant.javaCompile | ||
from variant.javaCompile.destinationDir | ||
|
||
manifest { | ||
attributes( | ||
"Bundle-Name": 'bolts-applinks', | ||
"Bundle-Version": project.version | ||
) | ||
} | ||
|
||
exclude '**/R.class' | ||
exclude '**/R\$*.class' | ||
exclude '**/Manifest.class' | ||
exclude '**/Manifest\$*.class' | ||
exclude '**/BuildConfig.class' | ||
} | ||
|
||
if (name.equals(BuilderConstants.RELEASE)) { | ||
artifacts.add('archives', task); | ||
} | ||
} | ||
|
||
//region Maven | ||
|
||
apply plugin: 'maven' | ||
apply plugin: 'signing' | ||
|
||
def isSnapshot = version.endsWith('-SNAPSHOT') | ||
def ossrhUsername = hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : System.getenv('CI_NEXUS_USERNAME') | ||
def ossrhPassword = hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : System.getenv('CI_NEXUS_PASSWORD') | ||
|
||
uploadArchives { | ||
repositories.mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
|
||
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
|
||
pom.project { | ||
name 'Bolts-AppLinks' | ||
artifactId = 'bolts-applinks' | ||
packaging 'jar' | ||
description 'Bolts is a collection of low-level libraries designed to make developing mobile apps easier.' | ||
url 'https://github.com/BoltsFramework/Bolts-Android' | ||
|
||
scm { | ||
connection 'scm:[email protected]:BoltsFramework/Bolts-Android.git' | ||
developerConnection 'scm:[email protected]:BoltsFramework/Bolts-Android.git' | ||
url 'https://github.com/BoltsFramework/Bolts-Android' | ||
} | ||
|
||
licenses { | ||
license { | ||
name 'BSD 2-Clause License' | ||
url 'https://github.com/BoltsFramework/Bolts-Android/blob/master/LICENSE' | ||
distribution 'repo' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id 'parse' | ||
name 'Parse' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
required { !isSnapshot && gradle.taskGraph.hasTask("uploadArchives") } | ||
sign configurations.archives | ||
} | ||
|
||
task androidJavadocs(type: Javadoc) { | ||
source = android.sourceSets.main.java.srcDirs | ||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
} | ||
|
||
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { | ||
classifier = 'javadoc' | ||
from androidJavadocs.destinationDir | ||
} | ||
|
||
task androidSourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from android.sourceSets.main.java.sourceFiles | ||
} | ||
|
||
artifacts { | ||
archives androidSourcesJar | ||
archives androidJavadocsJar | ||
} | ||
|
||
//endregion |
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,5 +1,7 @@ | ||
apply plugin: 'java' | ||
apply plugin: 'jacoco' | ||
|
||
group = GROUP_NAME | ||
version = VERSION_NAME | ||
|
||
configurations { | ||
provided | ||
|
@@ -17,6 +19,69 @@ dependencies { | |
testCompile 'junit:junit:4.12' | ||
} | ||
|
||
//region Maven | ||
|
||
apply plugin: 'maven' | ||
apply plugin: 'signing' | ||
|
||
def isSnapshot = version.endsWith('-SNAPSHOT') | ||
def ossrhUsername = hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : System.getenv('CI_NEXUS_USERNAME') | ||
def ossrhPassword = hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : System.getenv('CI_NEXUS_PASSWORD') | ||
|
||
uploadArchives { | ||
repositories.mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
|
||
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
|
||
pom.project { | ||
name 'Bolts-Tasks' | ||
artifactId = 'bolts-tasks' | ||
packaging 'jar' | ||
description 'Bolts is a collection of low-level libraries designed to make developing mobile apps easier.' | ||
url 'https://github.com/BoltsFramework/Bolts-Android' | ||
|
||
scm { | ||
connection 'scm:[email protected]:BoltsFramework/Bolts-Android.git' | ||
developerConnection 'scm:[email protected]:BoltsFramework/Bolts-Android.git' | ||
url 'https://github.com/BoltsFramework/Bolts-Android' | ||
} | ||
|
||
licenses { | ||
license { | ||
name 'BSD 2-Clause License' | ||
url 'https://github.com/BoltsFramework/Bolts-Android/blob/master/LICENSE' | ||
distribution 'repo' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id 'parse' | ||
name 'Parse' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
required { !isSnapshot && gradle.taskGraph.hasTask("uploadArchives") } | ||
sign configurations.archives | ||
} | ||
|
||
//endregion | ||
|
||
//region Code Coverage | ||
|
||
apply plugin: 'jacoco' | ||
|
||
jacoco { | ||
toolVersion = '0.7.1.201405082137' | ||
} | ||
|
@@ -29,3 +94,5 @@ jacocoTestReport { | |
html.enabled true | ||
} | ||
} | ||
|
||
//endregion |
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,2 @@ | ||
GROUP_NAME=com.parse.bolts | ||
VERSION_NAME=1.2.2-SNAPSHOT | ||
This comment has been minimized.
Sorry, something went wrong. |
nit, newline