Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating publishing tasks #1792

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 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
126 changes: 29 additions & 97 deletions adal/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,14 @@ android {
disable 'PackageManagerGetSignatures'
}

libraryVariants.all { variant ->
variant.outputs.all {
outputFileName = "${archivesBaseName}-${version}.aar"
useLibrary 'android.test.mock'

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

useLibrary 'android.test.mock'
}

// In dev, we want to keep the dependencies(common4j, broker4j, common) to 1.0.+ to be able to be consumed by daily dev pipeline.
Expand Down Expand Up @@ -183,106 +184,42 @@ dependencies {
javadocDeps "androidx.legacy:legacy-support-v4:$rootProject.ext.legacySupportV4Version"
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier 'sources'
destinationDirectory = reporting.file("$project.buildDir/outputs/jar/")
}

task javadoc(type: Javadoc) {
failOnError false
source = android.sourceSets.main.java.srcDirs
configurations.implementation.setCanBeResolved(true)
classpath += configurations.implementation
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.javadocDeps
exclude '**/*.aidl'

if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}

destinationDir = reporting.file("$project.buildDir/outputs/jar/javadoc/")
}

tasks.register('javadocJar', Jar) {
dependsOn javadoc
classifier 'javadoc'
from javadoc.destinationDir
destinationDirectory = reporting.file("$project.buildDir/outputs/jar/")
}

// For publishing to the remote maven repo.
publishing {
publications {
adal(MavenPublication) {
afterEvaluate {
from components.distRelease
}
groupId 'com.microsoft.aad'
artifactId 'adal'
//Edit the 'version' here for VSTS RC build
version = project.version

pom.withXml {
// Custom values

// Name
asNode().appendNode('name', 'adal')

// Description
asNode().appendNode(
'description',
'Azure active directory library for Android gives you the ability to add Windows Azure Active Directory authentication to your application with just a few lines of additional code. Using our ADAL SDKs you can quickly and easily extend your existing application to all the employees that use Windows Azure AD and Active Directory on-premises using Active Directory Federation Services, including Office365 customers.'
)

// URL
asNode().appendNode('url', 'https://github.com/AzureAD/azure-activedirectory-library-for-android')

// Inception Year
asNode().appendNode('inceptionYear', '2014')

// Licenses
asNode().appendNode('licenses').appendNode('license').appendNode('name', 'MIT License')

// Developers
def developerNode = asNode().appendNode('developers').appendNode('developer')
developerNode.appendNode('id', 'microsoft')
developerNode.appendNode('name', 'Microsoft')

// SCM
asNode().appendNode('scm').appendNode('url', 'https://github.com/AzureAD/azure-activedirectory-library-for-android/tree/master')

// Properties
def propertiesNode = asNode().appendNode('properties')
propertiesNode.appendNode('branch', 'master')
propertiesNode.appendNode('version', project.version)

def dependenciesNode = asNode().appendNode('dependencies')

def deps = configurations.implementation.allDependencies.asList()
if (project.version.toString().endsWith("SNAPSHOT")) {
deps.addAll(configurations.snapshotApi.allDependencies.asList())
} else {
deps.addAll(configurations.distApi.allDependencies.asList())
pom {
name = 'adal'
description = 'Azure active directory library for Android gives you the ability to add Windows Azure Active Directory authentication to your application with just a few lines of additional code. Using our ADAL SDKs you can quickly and easily extend your existing application to all the employees that use Windows Azure AD and Active Directory on-premises using Active Directory Federation Services, including Office365 customers.'
url = 'https://github.com/AzureAD/azure-activedirectory-library-for-android'
developers {
developer {
id = 'microsoft'
name = 'Microsoft'
}
}

//Iterate over the implementation dependencies (we don't want the test ones), adding a <dependency> node for each
deps.each {
if (it.group != null && it.name != null) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
licenses {
license {
name = 'MIT License'
}
}

inceptionYear = '2014'
scm {
url = 'https://github.com/AzureAD/azure-activedirectory-library-for-android/tree/master'
}
properties = [
branch : 'master',
version: project.version
]
}

artifact(sourcesJar)
artifact(javadocJar)
artifact("$buildDir/outputs/aar/adal-${project.version}.aar")
}

}
Expand Down Expand Up @@ -317,11 +254,6 @@ def getTimestamp() {
return date.format('yyyyMMdd.HHmm')
}

artifacts {
archives javadocJar
archives sourcesJar
}

pmd {
ignoreFailures = false
reportsDir = file("$project.buildDir/outputs/")
Expand Down
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
V.Next
---------
- [PATCH] Update publishing tasks (#1792)

Version 4.8.9
---------
Expand Down
Loading