File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
packages/react-native-gesture-handler/android Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,31 @@ android {
130
130
131
131
sourceSets[" main" ].java.srcDirs(buildListOfJavaSrcDirs())
132
132
133
- // TODO: Bring back clangd
133
+ if (isGHExampleApp()) {
134
+ tasks.withType< com.android.build.gradle.tasks.ExternalNativeBuildJsonTask > ().configureEach {
135
+ doLast {
136
+ val hashRegex = """ /Debug/([^/]+)/logs""" .toRegex()
137
+ val archRegex = """ /logs/([^/]+)$""" .toRegex()
138
+
139
+ val path = outputs.files.singleFile.path
140
+
141
+ val hashResults = hashRegex.find(path)
142
+ val hash = hashResults?.groups?.get(1 )?.value
143
+
144
+ val archResults = archRegex.find(path)
145
+ val arch = archResults?.groups?.get(1 )?.value
146
+
147
+ val rootDir = File (project.projectDir, " ../../.." )
148
+ val generated = File (project.projectDir, " .cxx/Debug/$hash /$arch /compile_commands.json" )
149
+
150
+ if (generated != null ) {
151
+ val output = File (rootDir, " compile_commands.json" )
152
+ output.writeText(generated.readText())
153
+ println (" Generated clangd metadata." )
154
+ }
155
+ }
156
+ }
157
+ }
134
158
}
135
159
136
160
dependencies {
You can’t perform that action at this time.
0 commit comments