Last active
April 11, 2019 14:10
-
-
Save hernandazevedo/838a15b70edbc5878e774b52c56613d9 to your computer and use it in GitHub Desktop.
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
ext { | |
localProp = new Properties() | |
fileName = 'local.properties' | |
if (project.rootProject.file(fileName).exists()) { | |
localProp.load(new FileInputStream(rootProject.file(fileName))) | |
} | |
groupName = "br.com.cetelem.android.components" | |
publishUsername = System.env.PUBLISH_USERNAME != null ? System.env.PUBLISH_USERNAME : localProp["publishUsername"] ?: "" | |
publishPassword = System.env.PUBLISH_PASSWORD != null ? System.env.PUBLISH_PASSWORD : localProp["publishPassword"] ?: "" | |
repoUrl = System.env.REPO_URL != null ? System.env.REPO_URL : localProp["repoUrl"] ?: "" | |
} | |
if (plugins.hasPlugin("com.android.library")) { | |
apply plugin: 'maven-publish' | |
if (!project.ext.properties.containsKey("artifactId")) { | |
ext.artifactId = project.name | |
} | |
publishing { | |
repositories { | |
maven { | |
credentials { | |
username publishUsername | |
password publishPassword | |
} | |
url repoUrl | |
} | |
} | |
publications { | |
projectRelease(MavenPublication) { | |
artifactId project.artifactId | |
groupId groupName | |
artifact "build/outputs/aar/${project.name}-release.aar" | |
version "${project.getVersion()}" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment