@@ -96,7 +96,6 @@ object RNSourceSets {
9696 }
9797
9898 private fun configureTasks () {
99- val projectName = project.name
10099 val appProjectName = appProject.name
101100
102101 project.tasks.register(" copyAutolinkingSources" , Copy ::class .java) {
@@ -108,32 +107,13 @@ object RNSourceSets {
108107 patchRNEntryPoint(it, path)
109108 }
110109
111- androidExtension.buildTypes.forEach { buildType ->
112- val capitalisedBuildType = buildType.name.replaceFirstChar { it.titlecase() }
113- val codegenTaskName = " generateCodegenSchemaFromJavaScript"
114- val strippedNativeLibsPath = " $appBuildDir /intermediates/stripped_native_libs"
115- val strippedDebugSymbolsPath = " strip${capitalisedBuildType} DebugSymbols/out/lib"
116-
117- val copyLibTask =
118- project.tasks.register(" copy${capitalisedBuildType} LibSources" , Copy ::class .java) {
119- it.dependsOn(" :$appProjectName :$codegenTaskName " )
120- it.dependsOn(" :$appProjectName :strip${capitalisedBuildType} DebugSymbols" )
121- it.dependsOn(" :$projectName :$codegenTaskName " )
122-
123- it.from(
124- " $strippedNativeLibsPath /${buildType.name} /$strippedDebugSymbolsPath " ,
125- )
126- it.into(project.rootProject.file(" $projectName /libs$capitalisedBuildType " ))
127- it.include(" **/libappmodules.so" , " **/libreact_codegen_*.so" )
128- }
129-
130- project.tasks.named(" preBuild" ).configure {
131- it.dependsOn(" copyAutolinkingSources" )
132- it.dependsOn(copyLibTask)
133- if (capitalisedBuildType == " Release" ) {
134- it.dependsOn(" :${appProject.name} :createBundleReleaseJsAndAssets" )
135- }
136- }
110+ project.tasks.named(" preBuild" ).configure {
111+ /* *
112+ * As part of the build task, we need to make sure the auto-gen files are present.
113+ * This makes sure that AutoLinking and ReactNativeEntryPoint are generated.
114+ */
115+ it.dependsOn(" copyAutolinkingSources" )
116+ it.dependsOn(" :${appProject.name} :createBundleReleaseJsAndAssets" )
137117 }
138118 }
139119}
0 commit comments