Skip to content

Instantly share code, notes, and snippets.

@plateaukao
Created March 2, 2021 08:39
Show Gist options
  • Save plateaukao/3c4cf4ca18d2e5a81dd7642ac602d0a7 to your computer and use it in GitHub Desktop.
Save plateaukao/3c4cf4ca18d2e5a81dd7642ac602d0a7 to your computer and use it in GitHub Desktop.
apply plugin: 'com.android.library'
...
apply plugin: 'maven-publish'
apply plugin: 'signing'
group = "com.linecorp.linesdk"
version = "5.6.1"
android {
...
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
groupId group
artifactId 'linesdk'
version version
from(components["release"])
artifact sourcesJar
artifact javadocJar
pom {
name = 'linesdk'
description = 'The LINE SDK for Android provides a modern way of implementing LINE APIs.'
url = 'https://github.com/line/line-sdk-android'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
name = 'LINE Corporation'
email = 'dl_oss_dev@linecorp.com'
url = 'https://engineering.linecorp.com/en/'
}
}
scm {
connection = 'scm:git@github.com:line/line-sdk-android.git'
developerConnection = 'scm:git:ssh://github.com:line/line-sdk-android.git'
url = 'https://github.com/line/line-sdk-android'
}
}
}
}
repositories {
maven {
name = "sonatype"
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
def name = findProperty('repositoryUsername') ?: ''
def pw = findProperty('repositoryPassword') ?: ''
credentials {
username name
password pw
}
}
}
}
signing {
def key = findProperty('signingKey')
def pw = findProperty('signingPassword')
required { signingKey != null && signingPassword != null }
useInMemoryPgpKeys(key, pw)
sign publishing.publications
}
}
nexusStaging {
packageGroup = 'com.linecorp'
def name = findProperty('nexusUsername') ?: ''
def pw = findProperty('nexusPassword') ?: ''
username = name
password = pw
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment