(buildFile)
| 62 | } |
| 63 | |
| 64 | function updateKotlinVersion(buildFile) { |
| 65 | let version = currentNpmVersion; |
| 66 | if (process.argv.length === 4) { |
| 67 | // node update-version.js alpha 37 |
| 68 | // -> version = "1.3.1-SNAPSHOT" |
| 69 | version = `${version}-SNAPSHOT`; |
| 70 | } else if (process.argv.length === 3) { |
| 71 | // node update-version.js 37 |
| 72 | // -> version = "1.3.1" |
| 73 | } else { |
| 74 | // node update-version.js |
| 75 | // -> version = "1.3.1-SNAPSHOT" |
| 76 | version = `${version}-SNAPSHOT`; |
| 77 | } |
| 78 | |
| 79 | console.log(`Kotlin Path: ${buildFile}`); |
| 80 | console.log(` Updating Version to ${version}`); |
| 81 | |
| 82 | let propsSource = fs.readFileSync(buildFile, 'utf-8'); |
| 83 | propsSource = propsSource.replace(/libVersion\s*= \".*/g, `libVersion = "${version}"`); |
| 84 | fs.writeFileSync(buildFile, propsSource); |
| 85 | } |
| 86 | |
| 87 | updateNpmVersion(path.resolve(__dirname, '../package.json')); |
| 88 | for (const entry of fs.readdirSync(path.resolve(__dirname, '../packages/'), { withFileTypes: true })) { |
no test coverage detected