-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix gradle publish config to match Google docs. (#279)
- Loading branch information
1 parent
a0c65d0
commit 1e2e3c2
Showing
1 changed file
with
37 additions
and
41 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,57 @@ | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
|
||
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID') ?: '' | ||
ext["signing.password"] = System.getenv('SIGNING_KEY_PASSWORD') ?: '' | ||
ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_KEY_FILE') ?: '' | ||
|
||
afterEvaluate { | ||
android { | ||
publishing { | ||
publications { | ||
release(MavenPublication) { | ||
groupId group | ||
version project.ext.version | ||
artifactId project.ext.name | ||
singleVariant('release') { | ||
withSourcesJar() | ||
} | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
release(MavenPublication) { | ||
groupId group | ||
version project.ext.version | ||
artifactId project.ext.name | ||
|
||
afterEvaluate { | ||
from components.release | ||
artifact androidSourcesJar //TODO: add javadocs | ||
} | ||
|
||
pom { | ||
name = project.ext.pom_name ?: '' | ||
packaging = POM_PACKAGING | ||
description = project.ext.pom_desc ?: '' | ||
url = POM_URL | ||
licenses { | ||
license { | ||
name = POM_LICENCE_NAME | ||
url = POM_LICENCE_URL | ||
} | ||
pom { | ||
name = project.ext.pom_name ?: '' | ||
packaging = POM_PACKAGING | ||
description = project.ext.pom_desc ?: '' | ||
url = POM_URL | ||
licenses { | ||
license { | ||
name = POM_LICENCE_NAME | ||
url = POM_LICENCE_URL | ||
} | ||
developers { | ||
developer { | ||
id = POM_DEVELOPER_ID | ||
name = POM_DEVELOPER_NAME | ||
email = POM_DEVELOPER_EMAIL | ||
} | ||
} | ||
scm { | ||
connection = POM_SCM_CONNECTION | ||
developerConnection = POM_SCM_DEV_CONNECTION | ||
url = POM_SCM_URL | ||
} | ||
developers { | ||
developer { | ||
id = POM_DEVELOPER_ID | ||
name = POM_DEVELOPER_NAME | ||
email = POM_DEVELOPER_EMAIL | ||
} | ||
} | ||
scm { | ||
connection = POM_SCM_CONNECTION | ||
developerConnection = POM_SCM_DEV_CONNECTION | ||
url = POM_SCM_URL | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
sign publishing.publications | ||
sign configurations.archives | ||
sign publishing.publications.release | ||
} | ||
} | ||
|
||
task androidSourcesJar(type: Jar) { | ||
archiveClassifier.set('sources') | ||
from android.sourceSets.main.java.srcDirs | ||
from android.sourceSets.main.kotlin.srcDirs | ||
} | ||
|
||
artifacts { | ||
archives androidSourcesJar | ||
} |