Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
121 changes: 42 additions & 79 deletions source/android/adaptivecards/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,102 +42,65 @@ task sourceJar(type: Jar) {
classifier "sources"
}

task createPom {
doLast {
pom {
project {
groupId 'io.adaptivecards'
artifactId 'adaptivecards-android'
version System.getenv('XES_PACKAGEVERSIONNUMBER') ?: '0.0.0'
name 'Android Adaptive Cards Library'
description 'Android Adaptive Cards Lib'
url 'https://github.com/Microsoft/AdaptiveCards'
packaging 'aar'
scm {
url 'https://github.com/Microsoft/AdaptiveCards'
}

licenses {
license {
name 'MIT'
url 'https://github.com/Microsoft/AdaptiveCards/blob/master/LICENSE'
distribution 'repo'
}
}
def projectInfo = {
name = 'Android Adaptive Cards Library'
description 'Android Adaptive Cards Lib'
url = 'https://github.com/Microsoft/AdaptiveCards'

developers {
developer {
id 'microsoft'
name 'adaptivecards'
}
}
}
}.writeTo("pom.xml")
scm {
url = 'https://github.com/Microsoft/AdaptiveCards'
}
}

publishing {
publications {
adaptivecards(MavenPublication) {
groupId 'io.adaptivecards'
version System.getenv('XES_SEMANTICVERSION') + '-20' + System.getenv('TFS_VersionNumber')
artifact(sourceJar)
artifact("$buildDir/outputs/aar/adaptivecards-release.aar")
licenses {
license {
name = 'MIT'
url = 'https://github.com/Microsoft/AdaptiveCards/blob/main/LICENSE'
distribution = 'repo'
}
}
repositories {
maven {
url 'https://microsoft.pkgs.visualstudio.com/_packaging/AdaptiveCards-Android/maven/v1'
credentials {
username "VSTS"
password System.getenv("VSTS_ENV_ACCESS_TOKEN") ?: System.getenv("AdaptiveCardsAuthoTokens")
}
}

organization {
name = 'Microsoft'
url = 'https://microsoft.com/'
}
}

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
pom.artifactId ="adaptivecards-android"
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
authentication(userName: NexusUserName, password: NexusPassword)
}
pom {
setGroupId "io.adaptivecards"
setVersion System.getenv("XES_PACKAGEVERSIONNUMBER") ?:"0.0.0"
}
groupId = 'io.adaptivecards'
artifactId = 'adaptivecards-android'

pom.project {
name 'Android Adaptive Cards Library'
description 'Android Adaptive Cards Lib'
url 'https://github.com/Microsoft/AdaptiveCards'
// Get version from PackageES, or fallback to Azure Pipeline build number
version = System.getenv('XES_PACKAGEVERSIONNUMBER') ?: System.getenv('BUILD_BUILDNUMBER') ?: '0.0.0'

scm {
url 'https://github.com/Microsoft/AdaptiveCards'
}
pom projectInfo
}

licenses {
license {
name 'MIT'
url 'https://github.com/Microsoft/AdaptiveCards/blob/master/LICENSE'
distribution 'repo'
}
}
}

developers {
developer {
id 'microsoft'
name 'adaptivecards'
}
}
repositories {
// Publish to Azure Artifacts feed
maven {
name = 'azuredevops'
url = 'https://microsoft.pkgs.visualstudio.com/_packaging/AdaptiveCards/maven/v1'
credentials {
username "AZURE_ARTIFACTS"
password System.getenv("AZURE_ARTIFACTS_ENV_ACCESS_TOKEN") ?: "${azureArtifactsGradleAccessToken}"
}

}
// Save to local directory "artifact"
maven {
name = 'localArtifact'
url = "artifact"
}
// TODO: Add SonaType OSS repository to publish directly
}
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
Expand Down
2 changes: 1 addition & 1 deletion source/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.android.tools.build:gradle:4.0.1'

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