Skip to content

Commit

Permalink
cleanup release.gradle (facebook#30468)
Browse files Browse the repository at this point in the history
Summary:
Cleanup release.gradle and remove code used to upload RN to maven repository, which is not longer used. Also removed configuration to include Javadoc, Sources in maven repo, thus reduce NPM package size.

## Changelog

[Internal] [Changed] - cleanup and remove maven upload from release.gradle

Pull Request resolved: facebook#30468

Test Plan: you will no longer see *uploadArchives* in ./gradlew tasks. Also you can run **./gradlew :ReactAndroid:installArchives**

Reviewed By: mdvacca

Differential Revision: D25408128

Pulled By: fkgozali

fbshipit-source-id: b3ced1b466b9f11e3970136a116af4e29dbd33a1
  • Loading branch information
dulmandakh authored and hsource committed Apr 15, 2022
1 parent eb2fa0e commit b78866b
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions ReactAndroid/release.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@ def isReleaseBuild() {
return VERSION_NAME.contains("SNAPSHOT") == false
}

def getRepositoryUrl() {
return project.findProperty("repositoryUrl") ?: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
}

def getRepositoryUsername() {
return project.findProperty("repositoryUsername") ?: ""
}

def getRepositoryPassword() {
return project.findProperty("repositoryPassword") ?: ""
}

def configureReactNativePom(def pom) {
pom.project {
name(POM_NAME)
Expand Down Expand Up @@ -72,39 +60,13 @@ if (JavaVersion.current().isJava8Compatible()) {
}

afterEvaluate { project ->

task androidJavadoc(type: Javadoc, dependsOn: generateReleaseBuildConfig) {
source = android.sourceSets.main.java.srcDirs
classpath += files(android.bootClasspath)
classpath += files("$buildDir/generated/source/buildConfig/release")
// Note: this doesn't handle .aar files, only .jar.
classpath += configurations.javadocDeps
include("**/*.java")
}

task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
classifier = "javadoc"
from(androidJavadoc.destinationDir)
}

task androidSourcesJar(type: Jar) {
classifier = "sources"
from(android.sourceSets.main.java.srcDirs)
include("**/*.java")
}

android.libraryVariants.all { variant ->
def name = variant.name.capitalize()
task "jar${name}"(type: Jar, dependsOn: variant.javaCompileProvider.get()) {
from(variant.javaCompileProvider.get().destinationDir)
}
}

artifacts {
archives(androidSourcesJar)
archives(androidJavadocJar)
}

version = VERSION_NAME
group = GROUP

Expand All @@ -113,24 +75,6 @@ afterEvaluate { project ->
sign(configurations.archives)
}

uploadArchives {
configuration = configurations.archives
repositories.mavenDeployer {
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}

repository(url: getRepositoryUrl()) {
authentication(
userName: getRepositoryUsername(),
password: getRepositoryPassword())

}

configureReactNativePom(pom)
}
}

task installArchives(type: Upload) {
configuration = configurations.archives
repositories.mavenDeployer {
Expand Down

0 comments on commit b78866b

Please sign in to comment.