Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(6_0_X) [TIMOB-24480] Android: appc run based module builds fail due to double-namespaced classes in KrollGeneratedBindings.gperf #8883

Merged
merged 1 commit into from
Mar 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 21 additions & 7 deletions android/cli/commands/_buildModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -739,9 +739,13 @@ AndroidModuleBuilder.prototype.generateV8Bindings = function (next) {

var namespace = namespaces.join('::');
var className = bindingJson.proxies[proxy]['proxyClassName'];
// If the class name doesn't have the module namespace, prepend it
if (className.indexOf(namespace) !== 0) {
className = namespace + '::' + className;
}
headers += '#include \"'+ proxy +'.h\"\n';
var initFunction = '::'+namespace+'::'+className+'::bindProxy';
var disposeFunction = '::'+namespace+'::'+className+'::dispose';
var initFunction = '::' + className + '::bindProxy';
var disposeFunction = '::' + className + '::dispose';

initTable.unshift([proxy, initFunction, disposeFunction].join(',').toString());

Expand Down Expand Up @@ -1235,9 +1239,17 @@ AndroidModuleBuilder.prototype.compileAllFinal = function (next) {
AndroidModuleBuilder.prototype.verifyBuildArch = function (next) {
this.logger.info(__('Verifying build architectures'));

var buildArchs = fs.readdirSync(this.libsDir),
var buildArchs = [],
manifestArchs = this.manifest['architectures'].split(' '),
buildDiff = manifestArchs.filter(function (i) { return buildArchs.indexOf(i) < 0; });
buildDiff = [];

if (!fs.existsSync(this.libsDir)) {
this.logger.info('No native compiled libraries found, assume architectures are sane');
return next();
}

buildArchs = fs.readdirSync(this.libsDir);
buildDiff = manifestArchs.filter(function (i) { return buildArchs.indexOf(i) < 0; });

if (buildArchs.length != manifestArchs.length || buildDiff.length > 0) {
this.logger.error(__('There is discrepancy between the architectures specified in module manifest and compiled binary.'));
Expand Down Expand Up @@ -1417,9 +1429,11 @@ AndroidModuleBuilder.prototype.packageZip = function (next) {
}
}.bind(this));

this.dirWalker(this.libsDir, function (file) {
dest.append(fs.createReadStream(file), { name: path.join(moduleFolder, 'libs', path.relative(this.libsDir, file)) });
}.bind(this));
if (fs.existsSync(this.libsDir)) {
this.dirWalker(this.libsDir, function (file) {
dest.append(fs.createReadStream(file), { name: path.join(moduleFolder, 'libs', path.relative(this.libsDir, file)) });
}.bind(this));
}

if (fs.existsSync(this.projLibDir)) {
this.dirWalker(this.projLibDir, function (file) {
Expand Down