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

[Android] Cherry-pick Gradle changes #4710

Merged
merged 3 commits into from
Aug 31, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions source/android/adaptivecards/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
NexusUserName=
NexusPassword=
azureArtifactsGradleAccessToken=
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
2 changes: 1 addition & 1 deletion source/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip