Skip to content

Commit 5c87c76

Browse files
authored
Merge pull request #8 from aws-amplify/tjroach/publishing-updates
chore(all) Publishing updates
2 parents ebdb1b7 + 446d001 commit 5c87c76

File tree

2 files changed

+3
-48
lines changed

2 files changed

+3
-48
lines changed

build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,7 @@ subprojects { project ->
131131
}
132132

133133
private void configureAndroidLibrary(Project project) {
134-
project.ext.VERSION_NAME = project.hasProperty('VERSION_NAME') ?
135-
project.findProperty('VERSION_NAME') :
136-
rootProject.findProperty('VERSION_NAME')
137-
134+
project.ext.VERSION_NAME = project.findProperty('VERSION_NAME')
138135
if (project.hasProperty('signingKeyId')) {
139136
System.out.println("Getting signing info from protected source.")
140137
project.ext.'signing.keyId' = findProperty('signingKeyId')
@@ -143,7 +140,6 @@ private void configureAndroidLibrary(Project project) {
143140
}
144141

145142
project.android {
146-
//buildToolsVersion rootProject.ext.buildToolsVersion
147143
compileSdkVersion rootProject.ext.compileSdkVersion
148144

149145
defaultConfig {

configuration/publishing.gradle

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
apply plugin: 'signing'
1818
apply plugin: 'maven-publish'
1919

20-
version = project.ext.VERSION_NAME
21-
2220
def isReleaseBuild() {
2321
return VERSION_NAME.contains("SNAPSHOT") == false
2422
}
@@ -42,25 +40,15 @@ def getRepositoryPassword() {
4240
}
4341

4442
afterEvaluate { project ->
45-
task androidSourcesJar(type: Jar) {
46-
classifier = 'sources'
47-
from android.sourceSets.main.java.source
48-
}
49-
50-
5143
publishing {
5244
publications {
5345
library(MavenPublication) {
5446
groupId POM_GROUP
5547
artifactId POM_ARTIFACT_ID
5648
version VERSION_NAME
5749

58-
artifact("${buildDir}/outputs/aar/${artifactId}-release.aar")
59-
if (project.getPlugins().hasPlugin('com.android.application') ||
60-
project.getPlugins().hasPlugin('com.android.library')) {
61-
artifact(androidSourcesJar)
62-
} else {
63-
artifact(sourcesJar)
50+
afterEvaluate {
51+
from(components["release"])
6452
}
6553

6654
pom {
@@ -90,35 +78,6 @@ afterEvaluate { project ->
9078
roles = ["developer"]
9179
}
9280
}
93-
94-
withXml {
95-
def dependenciesNode = asNode().appendNode('dependencies')
96-
97-
def apiDependencies = configurations.api.allDependencies
98-
99-
// Dependency may exist in both api and implementation block.
100-
// Prioritize as api over implementation.
101-
def implementationDependencies =
102-
configurations.implementation.allDependencies.findAll {
103-
!apiDependencies.contains(it)
104-
}
105-
106-
apiDependencies.each {
107-
def dependencyNode = dependenciesNode.appendNode('dependency')
108-
dependencyNode.appendNode('groupId', it.group)
109-
dependencyNode.appendNode('artifactId', it.name)
110-
dependencyNode.appendNode('version', it.version)
111-
dependencyNode.appendNode('scope', "compile")
112-
}
113-
114-
implementationDependencies.each {
115-
def dependencyNode = dependenciesNode.appendNode('dependency')
116-
dependencyNode.appendNode('groupId', it.group)
117-
dependencyNode.appendNode('artifactId', it.name)
118-
dependencyNode.appendNode('version', it.version)
119-
dependencyNode.appendNode('scope', "runtime")
120-
}
121-
}
12281
}
12382
}
12483
}

0 commit comments

Comments
 (0)