Selaa lähdekoodia

android: prepare SDK build for Hermes

We need to push the Hermes AAR to Maven and have the SDK depend on it.
master
Saúl Ibarra Corretgé 5 vuotta sitten
vanhempi
commit
306c8ba8c2
2 muutettua tiedostoa jossa 32 lisäystä ja 14 poistoa
  1. 18
    14
      android/scripts/release-sdk.sh
  2. 14
    0
      android/sdk/build.gradle

+ 18
- 14
android/scripts/release-sdk.sh Näytä tiedosto

10
 DEFAULT_SDK_VERSION=$(grep sdkVersion ${THIS_DIR}/../gradle.properties | cut -d"=" -f2)
10
 DEFAULT_SDK_VERSION=$(grep sdkVersion ${THIS_DIR}/../gradle.properties | cut -d"=" -f2)
11
 SDK_VERSION=${OVERRIDE_SDK_VERSION:-${DEFAULT_SDK_VERSION}}
11
 SDK_VERSION=${OVERRIDE_SDK_VERSION:-${DEFAULT_SDK_VERSION}}
12
 RN_VERSION=$(jq -r '.dependencies."react-native"' ${THIS_DIR}/../../package.json)
12
 RN_VERSION=$(jq -r '.dependencies."react-native"' ${THIS_DIR}/../../package.json)
13
-JSC_VERSION="r"$(jq -r '.dependencies."jsc-android"' ${THIS_DIR}/../../node_modules/react-native/package.json | cut -d . -f 1 | cut -c 2-)
13
+HERMES_VERSION=$(jq -r '.dependencies."hermes-engine"' ${THIS_DIR}/../../node_modules/react-native/package.json | cut -c 2-)
14
 DO_GIT_TAG=${GIT_TAG:-0}
14
 DO_GIT_TAG=${GIT_TAG:-0}
15
 
15
 
16
 if [[ $THE_MVN_REPO == http* ]]; then
16
 if [[ $THE_MVN_REPO == http* ]]; then
38
         -DgeneratePom=false \
38
         -DgeneratePom=false \
39
         -DpomFile=react-native-${RN_VERSION}.pom || true
39
         -DpomFile=react-native-${RN_VERSION}.pom || true
40
     popd
40
     popd
41
-    # Push JSC
42
-    echo "Pushing JSC ${JSC_VERSION} to the Maven repo"
43
-    pushd ${THIS_DIR}/../../node_modules/jsc-android/dist/org/webkit/android-jsc/${JSC_VERSION}
41
+    # Push Hermes
42
+    echo "Pushing Hermes ${HERMES_VERSION} to the Maven repo"
43
+    pushd ${THIS_DIR}/../../node_modules/hermes-engine/android/
44
     mvn \
44
     mvn \
45
         deploy:deploy-file \
45
         deploy:deploy-file \
46
         -Durl=${MVN_REPO} \
46
         -Durl=${MVN_REPO} \
47
         -DrepositoryId=${MVN_REPO_ID} \
47
         -DrepositoryId=${MVN_REPO_ID} \
48
-        -Dfile=android-jsc-${JSC_VERSION}.aar \
48
+        -Dfile=hermes-release.aar \
49
         -Dpackaging=aar \
49
         -Dpackaging=aar \
50
-        -DgeneratePom=false \
51
-        -DpomFile=android-jsc-${JSC_VERSION}.pom || true
50
+        -DgroupId=com.facebook \
51
+        -DartifactId=hermes \
52
+        -Dversion=${HERMES_VERSION} \
53
+        -DgeneratePom=true || true
52
     popd
54
     popd
53
 else
55
 else
54
     # Push React Native, if necessary
56
     # Push React Native, if necessary
65
         popd
67
         popd
66
     fi
68
     fi
67
 
69
 
68
-    # Push JSC, if necessary
69
-    if [[ ! -d ${MVN_REPO}/org/webkit/android-jsc/${JSC_VERSION} ]]; then
70
-        echo "Pushing JSC ${JSC_VERSION} to the Maven repo"
71
-        pushd ${THIS_DIR}/../../node_modules/jsc-android/dist/org/webkit/android-jsc/${JSC_VERSION}
70
+    # Push Hermes, if necessary
71
+    if [[ ! -d ${MVN_REPO}/com/facebook/hermes/${HERMES_VERSION} ]]; then
72
+        echo "Pushing Hermes ${HERMES_VERSION} to the Maven repo"
73
+        pushd ${THIS_DIR}/../../node_modules/hermes-engine/android/
72
         mvn \
74
         mvn \
73
             deploy:deploy-file \
75
             deploy:deploy-file \
74
             -Durl=${MVN_REPO} \
76
             -Durl=${MVN_REPO} \
75
-            -Dfile=android-jsc-${JSC_VERSION}.aar \
77
+            -Dfile=hermes-release.aar \
76
             -Dpackaging=aar \
78
             -Dpackaging=aar \
77
-            -DgeneratePom=false \
78
-            -DpomFile=android-jsc-${JSC_VERSION}.pom
79
+            -DgroupId=com.facebook \
80
+            -DartifactId=hermes \
81
+            -Dversion=${HERMES_VERSION} \
82
+            -DgeneratePom=true
79
         popd
83
         popd
80
     fi
84
     fi
81
 
85
 

+ 14
- 0
android/sdk/build.gradle Näytä tiedosto

1
+import groovy.json.JsonSlurper
2
+
1
 apply plugin: 'com.android.library'
3
 apply plugin: 'com.android.library'
2
 apply plugin: 'maven-publish'
4
 apply plugin: 'maven-publish'
3
 
5
 
31
             }
33
             }
32
         }
34
         }
33
     }
35
     }
36
+
37
+    packagingOptions {
38
+        pickFirst '**/libc++_shared.so'
39
+    }
34
 }
40
 }
35
 
41
 
36
 dependencies {
42
 dependencies {
218
                     dependency.appendNode('artifactId', artifactId)
224
                     dependency.appendNode('artifactId', artifactId)
219
                     dependency.appendNode('version', it.moduleVersion)
225
                     dependency.appendNode('version', it.moduleVersion)
220
                 }
226
                 }
227
+
228
+                // Add Hermes dependency.
229
+                def hermesPkg = new File("$rootDir/../node_modules/hermes-engine/package.json")
230
+                def hermesVersion = new JsonSlurper().parseText(hermesPkg.text).version
231
+                def hermesDependency = dependencies.appendNode('dependency')
232
+                hermesDependency.appendNode('groupId', "com.facebook")
233
+                hermesDependency.appendNode('artifactId', "hermes")
234
+                hermesDependency.appendNode('version', hermesVersion)
221
             }
235
             }
222
         }
236
         }
223
 
237
 

Loading…
Peruuta
Tallenna