Skip to content

Commit

Permalink
Fix Javadocs jar file publishing using buildspec file. (#2971)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Leing <[email protected]>
  • Loading branch information
tjleing and Thomas Leing authored Aug 11, 2022
1 parent 5a792d9 commit d59cfd9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
7 changes: 7 additions & 0 deletions publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,17 @@ afterEvaluate { project ->
}

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

afterEvaluate {
androidJavadocs.classpath += files(android.libraryVariants.collect { variant ->
variant.javaCompileProvider.get().classpath.files
})
}

task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
Expand Down
27 changes: 27 additions & 0 deletions scripts/maven-release-publisher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: 0.2
env:
shell: /bin/sh
secrets-manager:
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: awsmobilesdk/android/sonatype:username
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_PASSWORD: awsmobilesdk/android/sonatype:password
ORG_GRADLE_PROJECT_signingPassword: awsmobilesdk/android/signing:password
ORG_GRADLE_PROJECT_signingKeyId: awsmobilesdk/android/signing:keyId
ORG_GRADLE_PROJECT_signingInMemoryKey: awsmobilesdk/android/signing:inMemoryKey
phases:
build:
commands:
- echo 'Build phase starting.'
- |
JAVA_HOME=$JDK_8_HOME ./gradlew clean build
./gradlew androidJavadocsJar
for task_name in $(./gradlew tasks --all | grep uploadArchives | cut -d " " -f 1); do
echo "Gradle task $task_name"
JAVA_HOME=$JDK_8_HOME ./gradlew $task_name;
done
finally:
- echo 'Build phase completed.'
post_build:
commands:
- echo 'Post-build phase starting'
finally:
- echo 'Post-build phase completed.'

0 comments on commit d59cfd9

Please sign in to comment.