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

Prototype - Storing the Hermes iOS tarballs on Maven. #34812

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ project.xcworkspace
/ReactAndroid/gradle/
/ReactAndroid/gradlew
/ReactAndroid/gradlew.bat
/ReactAndroid/external-artifacts/build/
/ReactAndroid/external-artifacts/artifacts/
/ReactAndroid/hermes-engine/build/
/ReactAndroid/hermes-engine/.cxx/
/template/android/app/build/
Expand Down
90 changes: 90 additions & 0 deletions ReactAndroid/external-artifacts/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

plugins {
id("maven-publish")
id("signing")
}

//version = parent.publishing_version
version = "0.0.1" // To avoid to accidentally publish a 1000.0.0-main

def REPO_URL = "file://${projectDir}/../../android"
configurations.maybeCreate("default")

// The artifact should be placed inside the `artifacts/hermes-ios.tar.gz` location.
def hermesiOSArtifactFile = layout.projectDirectory.file('artifacts/hermes-ios.tar.gz')
def hermesiOSArtifact = artifacts.add('default', hermesiOSArtifactFile) {
type 'tgz'
extension 'tar.gz'
classifier 'hermes-ios'
}

publishing {
publications {
artifacts(MavenPublication) {
artifactId = "react-native-artifacts"
groupId = GROUP
artifact hermesiOSArtifact

pom {
name = POM_NAME
description = "Supporting artifacts to for the React Native framework"
url = "https://github.com/facebook/react-native"

developers {
developer {
id = "facebook"
name = "Facebook"
}
}

licenses {
license {
name = "MIT License"
url = "https://github.com/facebook/react-native/blob/HEAD/LICENSE"
distribution = "repo"
}
}

scm {
url = "https://github.com/facebook/react-native.git"
connection = "scm:git:https://github.com/facebook/react-native.git"
developerConnection = "scm:git:git@github.com:facebook/react-native.git"
}
}
}
}

repositories {
maven {
name = "npm"
url = REPO_URL
}
if (project.hasProperty("SONATYPE_USERNAME") && project.hasProperty("SONATYPE_PASSWORD")) {
maven {
name = "mavenCentral"
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = SONATYPE_USERNAME
password = SONATYPE_PASSWORD
}
}
}
}

if (!project.hasProperty("SIGNING_KEY")) {
logger.info("Signing Disable as the PGP key was not found")
} else {
logger.info("PGP Key found - Signing enabled")
signing {
useInMemoryPgpKeys(SIGNING_KEY, SIGNING_PWD)
sign(publishing.publications.artifacts)
}
}
}

6 changes: 5 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ pluginManagement {
}
}

include(":ReactAndroid", ":ReactAndroid:hermes-engine", ":packages:rn-tester:android:app")
include(
":ReactAndroid",
":ReactAndroid:hermes-engine",
":ReactAndroid:external-artifacts",
":packages:rn-tester:android:app")

// Include this to enable codegen Gradle plugin.
includeBuild("packages/react-native-gradle-plugin/")
Expand Down