Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing sources jar into published android artifacts #32982

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ task installArchives {
dependsOn("publishReleasePublicationToNpmRepository")
}

// Creating sources with comments
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}

android {
compileSdkVersion 31

Expand Down Expand Up @@ -414,6 +420,9 @@ afterEvaluate {
// Applies the component for the release build variant.
from components.release

// Add additional sourcesJar to artifacts
artifact(androidSourcesJar)

// You can then customize attributes of the publication as shown below.
artifactId = POM_ARTIFACT_ID
groupId = GROUP
Expand Down