2016-05-20 11:52:08 +00:00
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
const manifest = fs.readFileSync(path.join(__dirname, './files/AndroidManifest.xml'));
|
|
|
|
const mainJavaClass = fs.readFileSync(path.join(__dirname, './files/Main.java'));
|
|
|
|
|
2017-06-29 08:08:47 +00:00
|
|
|
function generateValidFileStructure(classFileName) {
|
|
|
|
return {
|
|
|
|
src: {
|
|
|
|
'AndroidManifest.xml': manifest,
|
|
|
|
main: {
|
|
|
|
com: {
|
|
|
|
some: {
|
|
|
|
example: {
|
|
|
|
'Main.java': mainJavaClass,
|
|
|
|
[classFileName]: fs.readFileSync(path.join(__dirname, `./files/${classFileName}`)),
|
|
|
|
},
|
2016-05-20 11:52:08 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2017-06-29 08:08:47 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.valid = generateValidFileStructure('ReactPackage.java');
|
|
|
|
|
|
|
|
exports.validKotlin = generateValidFileStructure('ReactPackage.kt');
|
2016-05-20 11:52:08 +00:00
|
|
|
|
2017-06-06 21:11:54 +00:00
|
|
|
exports.userConfigManifest = {
|
|
|
|
src: {
|
|
|
|
main: {
|
|
|
|
'AndroidManifest.xml': manifest,
|
|
|
|
com: {
|
|
|
|
some: {
|
|
|
|
example: {
|
|
|
|
'Main.java': mainJavaClass,
|
|
|
|
'ReactPackage.java': fs.readFileSync(path.join(__dirname, './files/ReactPackage.java')),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
debug: {
|
|
|
|
'AndroidManifest.xml': fs.readFileSync(path.join(__dirname, './files/AndroidManifest-debug.xml')),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2016-05-20 11:52:08 +00:00
|
|
|
exports.corrupted = {
|
|
|
|
src: {
|
|
|
|
'AndroidManifest.xml': manifest,
|
|
|
|
main: {
|
|
|
|
com: {
|
|
|
|
some: {
|
|
|
|
example: {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.noPackage = {
|
|
|
|
src: {
|
|
|
|
'AndroidManifest.xml': manifest,
|
|
|
|
main: {
|
|
|
|
com: {
|
|
|
|
some: {
|
|
|
|
example: {
|
|
|
|
'Main.java': mainJavaClass,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|