(config: Config)
| 160 | } |
| 161 | |
| 162 | async function checkBuildGradle(config: Config) { |
| 163 | const fileName = 'build.gradle'; |
| 164 | const filePath = join(config.android.appDirAbs, fileName); |
| 165 | |
| 166 | if (!(await pathExists(filePath))) { |
| 167 | return `${c.strong(fileName)} file is missing in ${c.strong(config.android.appDir)}`; |
| 168 | } |
| 169 | |
| 170 | let fileContent = await readFile(filePath, { encoding: 'utf-8' }); |
| 171 | |
| 172 | fileContent = fileContent.replace(/'|"/g, '').replace(/\s+/g, ' '); |
| 173 | |
| 174 | const searchFor = `applicationId`; |
| 175 | |
| 176 | if (fileContent.indexOf(searchFor) === -1) { |
| 177 | return `${c.strong('build.gradle')} file missing ${c.input(`applicationId`)} config in ${filePath}`; |
| 178 | } |
| 179 | |
| 180 | return null; |
| 181 | } |
| 182 | |
| 183 | async function checkGradlew(config: Config) { |
| 184 | const fileName = 'gradlew'; |
no test coverage detected