Created
May 13, 2018 17:34
-
-
Save distante/c7552ac53659fd5efeb12e83141c3034 to your computer and use it in GitHub Desktop.
Folder fixes for Cordova 8 (Android 7.0.0)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs-extra'); | |
console.log("\n\nBefore Run Script\n\n"); | |
function copyDirs(fromPath, toPath, dirsToCopy) { | |
for (let i = 0; i < dirsToCopy.length; i++) { | |
let fromDir = fromPath + dirsToCopy[i]; | |
let toDir = toPath + dirsToCopy[i]; | |
let dirExist = fs.existsSync(toDir); | |
console.log(toDir + " exist? " + dirExist); | |
if (!dirExist) { | |
console.log("Copying folder " + fromDir); | |
fs.copySync(fromDir, toDir); | |
} | |
} | |
} | |
//Fix admob for Cordova 8 / Android 7.0 | |
console.log("\n\nFixing Admob Free Paths\n\n"); | |
let fromPath = __dirname + '/../platforms/android/src/name/ratson/cordova/admob/'; | |
let toPath = __dirname + '/../platforms/android/app/src/main/java/name/ratson/cordova/admob/'; | |
let dirsToCopy = ['banner', 'interstitial', 'rewardvideo']; | |
copyDirs(fromPath, toPath, dirsToCopy); | |
// In-App-Purchase | |
console.log("\n\nFixing in-app purchase paths\n\n"); | |
fromPath = __dirname + '/../platforms/android/src/com/android/vending/'; | |
toPath = __dirname + '/../platforms/android/app/src/main/aidl/com/android/vending/'; | |
dirsToCopy = ['billing']; | |
copyDirs(fromPath, toPath, dirsToCopy); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment