Skip to content

Commit

Permalink
chore: update compileSdkVersion for RN 0.70 pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
dimninik committed Oct 27, 2023
1 parent 7332af5 commit 1cd4526
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/copyExampleProjectFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,13 @@ const changePackageJsonName = () => {
fs.writeFileSync(packageJsonDestinationPath, JSON.stringify(packageJson, null, 2) + '\n')
}

const setMinSdkVersion = () => {
const setCompileSdkVersion = () => {
const gradlePath = path.join(__dirname, TEST_PROJECT_DIR_NAME, 'android', 'app', 'build.gradle')
const gradleLines = fs.readFileSync(gradlePath, 'utf8').split('\n')
const indexOfManifestTagEndLine = gradleLines.findIndex(line => line.includes('minSdkVersion'))
gradleLines[indexOfManifestTagEndLine] = 'minSdkVersion 23'
const indexOfManifestTagEndLine = gradleLines.findIndex(line => line.includes('compileSdkVersion'))
console.log(indexOfManifestTagEndLine)
console.log(gradleLines[indexOfManifestTagEndLine])
gradleLines[indexOfManifestTagEndLine] = 'compileSdkVersion 32'
fs.writeFileSync(gradlePath, gradleLines.join('\n'))
}

Expand All @@ -136,7 +138,7 @@ const copyExampleProjectFiles = () => {
copyReactNativeConfig()
copyBabelConfig()
changePackageJsonName()
setMinSdkVersion()
setCompileSdkVersion()
}

copyExampleProjectFiles()

0 comments on commit 1cd4526

Please sign in to comment.