Skip to content

Commit d59cfd9

Browse files
tjleingThomas Leing
andauthored
Fix Javadocs jar file publishing using buildspec file. (#2971)
Co-authored-by: Thomas Leing <[email protected]>
1 parent 5a792d9 commit d59cfd9

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

publishing.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,17 @@ afterEvaluate { project ->
156156
}
157157

158158
task androidJavadocs(type: Javadoc) {
159+
failOnError false
159160
source = android.sourceSets.main.java.source
160161
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
161162
}
162163

164+
afterEvaluate {
165+
androidJavadocs.classpath += files(android.libraryVariants.collect { variant ->
166+
variant.javaCompileProvider.get().classpath.files
167+
})
168+
}
169+
163170
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
164171
classifier = 'javadoc'
165172
from androidJavadocs.destinationDir
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: 0.2
2+
env:
3+
shell: /bin/sh
4+
secrets-manager:
5+
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: awsmobilesdk/android/sonatype:username
6+
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_PASSWORD: awsmobilesdk/android/sonatype:password
7+
ORG_GRADLE_PROJECT_signingPassword: awsmobilesdk/android/signing:password
8+
ORG_GRADLE_PROJECT_signingKeyId: awsmobilesdk/android/signing:keyId
9+
ORG_GRADLE_PROJECT_signingInMemoryKey: awsmobilesdk/android/signing:inMemoryKey
10+
phases:
11+
build:
12+
commands:
13+
- echo 'Build phase starting.'
14+
- |
15+
JAVA_HOME=$JDK_8_HOME ./gradlew clean build
16+
./gradlew androidJavadocsJar
17+
for task_name in $(./gradlew tasks --all | grep uploadArchives | cut -d " " -f 1); do
18+
echo "Gradle task $task_name"
19+
JAVA_HOME=$JDK_8_HOME ./gradlew $task_name;
20+
done
21+
finally:
22+
- echo 'Build phase completed.'
23+
post_build:
24+
commands:
25+
- echo 'Post-build phase starting'
26+
finally:
27+
- echo 'Post-build phase completed.'

0 commit comments

Comments
 (0)