You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: nix/mobile/android/maven-and-npm-deps/default.nix
+37-29Lines changed: 37 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ let
25
25
deps=
26
26
let
27
27
# Place build target directories in NIX_BUILD_TOP (normally represents /build)
28
-
projectDir="$NIX_BUILD_TOP/project";
28
+
projectBuildDir="$NIX_BUILD_TOP/project";
29
29
mavenRepoDir="$NIX_BUILD_TOP/.m2/repository";
30
30
reactNativeMavenPackageDir="${mavenRepoDir}/com/facebook/react/react-native";# This is directory where the react-native Maven package will be generated in
31
31
reactNativeDepsDir="$NIX_BUILD_TOP/deps";# Use local writable deps, otherwise (probably due to some interaction between Nix sandboxing and Java) gradle will fail copying directly from the nix store
@@ -57,10 +57,10 @@ let
57
57
runHook preUnpack
58
58
59
59
# Copy project directory
60
-
mkdir -p ${projectDir}
61
-
cp -a $src/. ${projectDir}
62
-
chmod u+w ${projectDir}
63
-
cd ${projectDir}
60
+
mkdir -p ${projectBuildDir}
61
+
cp -a $src/. ${projectBuildDir}
62
+
chmod u+w ${projectBuildDir}
63
+
cd ${projectBuildDir}
64
64
65
65
# Copy RN maven dependencies and make them writable, otherwise Gradle copy fails (since the top-level directory is read-only, Java isn't smart enough to copy the child files/folders into that target directory)
66
66
mkdir -p ${mavenRepoDir}
@@ -73,21 +73,21 @@ let
73
73
done
74
74
75
75
# Copy node_modules from Nix store
76
-
rm -rf ${projectDir}/node_modules
77
-
mkdir -p ${projectDir}/node_modules
78
-
cp -a ${projectNodePackage}/node_modules/. ${projectDir}/node_modules/
76
+
rm -rf ${projectBuildDir}/node_modules
77
+
mkdir -p ${projectBuildDir}/node_modules
78
+
cp -a ${projectNodePackage}/node_modules/. ${projectBuildDir}/node_modules/
test -d ${projectDir}/node_modules/react-native/ReactAndroid/build/intermediates/javac/release/compileReleaseJavaWithJavac/classes/com/facebook || \
177
+
test -d ${projectBuildDir}/node_modules/react-native/ReactAndroid/build/intermediates/javac/release/compileReleaseJavaWithJavac/classes/com/facebook || \
172
178
exit 1
173
-
test -d ${projectDir}/node_modules/react-native/ReactAndroid/build/react-ndk/exported || \
179
+
test -d ${projectBuildDir}/node_modules/react-native/ReactAndroid/build/react-ndk/exported || \
174
180
exit 2
175
181
runHook postCheck
176
182
'';
177
183
installPhase=''
178
184
rm -rf $out
179
-
mkdir -p $out/project $out/.m2/repository
185
+
mkdir -p $out/{project,.m2/repository}
180
186
181
187
# TODO: maybe node_modules/react-native/ReactAndroid/build/{tmp,generated} can be discarded?
0 commit comments