android: prepare SDK build for Hermes
We need to push the Hermes AAR to Maven and have the SDK depend on it.
This commit is contained in:
parent
5a6335207f
commit
306c8ba8c2
|
@ -10,7 +10,7 @@ MVN_HTTP=0
|
||||||
DEFAULT_SDK_VERSION=$(grep sdkVersion ${THIS_DIR}/../gradle.properties | cut -d"=" -f2)
|
DEFAULT_SDK_VERSION=$(grep sdkVersion ${THIS_DIR}/../gradle.properties | cut -d"=" -f2)
|
||||||
SDK_VERSION=${OVERRIDE_SDK_VERSION:-${DEFAULT_SDK_VERSION}}
|
SDK_VERSION=${OVERRIDE_SDK_VERSION:-${DEFAULT_SDK_VERSION}}
|
||||||
RN_VERSION=$(jq -r '.dependencies."react-native"' ${THIS_DIR}/../../package.json)
|
RN_VERSION=$(jq -r '.dependencies."react-native"' ${THIS_DIR}/../../package.json)
|
||||||
JSC_VERSION="r"$(jq -r '.dependencies."jsc-android"' ${THIS_DIR}/../../node_modules/react-native/package.json | cut -d . -f 1 | cut -c 2-)
|
HERMES_VERSION=$(jq -r '.dependencies."hermes-engine"' ${THIS_DIR}/../../node_modules/react-native/package.json | cut -c 2-)
|
||||||
DO_GIT_TAG=${GIT_TAG:-0}
|
DO_GIT_TAG=${GIT_TAG:-0}
|
||||||
|
|
||||||
if [[ $THE_MVN_REPO == http* ]]; then
|
if [[ $THE_MVN_REPO == http* ]]; then
|
||||||
|
@ -38,17 +38,19 @@ if [[ $MVN_HTTP == 1 ]]; then
|
||||||
-DgeneratePom=false \
|
-DgeneratePom=false \
|
||||||
-DpomFile=react-native-${RN_VERSION}.pom || true
|
-DpomFile=react-native-${RN_VERSION}.pom || true
|
||||||
popd
|
popd
|
||||||
# Push JSC
|
# Push Hermes
|
||||||
echo "Pushing JSC ${JSC_VERSION} to the Maven repo"
|
echo "Pushing Hermes ${HERMES_VERSION} to the Maven repo"
|
||||||
pushd ${THIS_DIR}/../../node_modules/jsc-android/dist/org/webkit/android-jsc/${JSC_VERSION}
|
pushd ${THIS_DIR}/../../node_modules/hermes-engine/android/
|
||||||
mvn \
|
mvn \
|
||||||
deploy:deploy-file \
|
deploy:deploy-file \
|
||||||
-Durl=${MVN_REPO} \
|
-Durl=${MVN_REPO} \
|
||||||
-DrepositoryId=${MVN_REPO_ID} \
|
-DrepositoryId=${MVN_REPO_ID} \
|
||||||
-Dfile=android-jsc-${JSC_VERSION}.aar \
|
-Dfile=hermes-release.aar \
|
||||||
-Dpackaging=aar \
|
-Dpackaging=aar \
|
||||||
-DgeneratePom=false \
|
-DgroupId=com.facebook \
|
||||||
-DpomFile=android-jsc-${JSC_VERSION}.pom || true
|
-DartifactId=hermes \
|
||||||
|
-Dversion=${HERMES_VERSION} \
|
||||||
|
-DgeneratePom=true || true
|
||||||
popd
|
popd
|
||||||
else
|
else
|
||||||
# Push React Native, if necessary
|
# Push React Native, if necessary
|
||||||
|
@ -65,17 +67,19 @@ else
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Push JSC, if necessary
|
# Push Hermes, if necessary
|
||||||
if [[ ! -d ${MVN_REPO}/org/webkit/android-jsc/${JSC_VERSION} ]]; then
|
if [[ ! -d ${MVN_REPO}/com/facebook/hermes/${HERMES_VERSION} ]]; then
|
||||||
echo "Pushing JSC ${JSC_VERSION} to the Maven repo"
|
echo "Pushing Hermes ${HERMES_VERSION} to the Maven repo"
|
||||||
pushd ${THIS_DIR}/../../node_modules/jsc-android/dist/org/webkit/android-jsc/${JSC_VERSION}
|
pushd ${THIS_DIR}/../../node_modules/hermes-engine/android/
|
||||||
mvn \
|
mvn \
|
||||||
deploy:deploy-file \
|
deploy:deploy-file \
|
||||||
-Durl=${MVN_REPO} \
|
-Durl=${MVN_REPO} \
|
||||||
-Dfile=android-jsc-${JSC_VERSION}.aar \
|
-Dfile=hermes-release.aar \
|
||||||
-Dpackaging=aar \
|
-Dpackaging=aar \
|
||||||
-DgeneratePom=false \
|
-DgroupId=com.facebook \
|
||||||
-DpomFile=android-jsc-${JSC_VERSION}.pom
|
-DartifactId=hermes \
|
||||||
|
-Dversion=${HERMES_VERSION} \
|
||||||
|
-DgeneratePom=true
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import groovy.json.JsonSlurper
|
||||||
|
|
||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
|
|
||||||
|
@ -31,6 +33,10 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
packagingOptions {
|
||||||
|
pickFirst '**/libc++_shared.so'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -218,6 +224,14 @@ publishing {
|
||||||
dependency.appendNode('artifactId', artifactId)
|
dependency.appendNode('artifactId', artifactId)
|
||||||
dependency.appendNode('version', it.moduleVersion)
|
dependency.appendNode('version', it.moduleVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add Hermes dependency.
|
||||||
|
def hermesPkg = new File("$rootDir/../node_modules/hermes-engine/package.json")
|
||||||
|
def hermesVersion = new JsonSlurper().parseText(hermesPkg.text).version
|
||||||
|
def hermesDependency = dependencies.appendNode('dependency')
|
||||||
|
hermesDependency.appendNode('groupId', "com.facebook")
|
||||||
|
hermesDependency.appendNode('artifactId', "hermes")
|
||||||
|
hermesDependency.appendNode('version', hermesVersion)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue