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

[TIMOB-24369] Generate JS wrappers for Android Support Libraries (2_0_X) #144

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
19 changes: 19 additions & 0 deletions android/plugins/hyperloop/hooks/android/hyperloop.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,25 @@ exports.cliVersion = '>=3.2';
jars = [builder.androidTargetSDK.androidJar];

async.series([
/**
* Manually adds the Android Support Libraries beacuse at this point the builder
* hasn't loaded all the jars from our SDK core yet.
*
* @param {Function} next Callback function
*/
function (next) {
var depMap = JSON.parse(fs.readFileSync(path.join(builder.platformPath, 'dependency.json')));
var supportLibraryFilenames = depMap.libraries.appcompat;
async.each(supportLibraryFilenames, function(libraryFilename, cb) {
var libraryPathAndFilename = path.join(builder.platformPath, libraryFilename);
if (afs.exists(libraryPathAndFilename)) {
jars.push(libraryPathAndFilename);
cb();
} else {
cb(new Error('Android Support Library not found at expected path ' + libraryPathAndFilename));
}
}, next);
},
// Find 3rd-party JARs and AARs
function (next) {
if (!afs.exists(platformAndroid)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ private static void enumerate(String filename, Enumeration<? extends ZipEntry> e
}
try {
JavaClass cls = repo.loadClass(classname);
// skip private/package-level classes
// skip anonymous classes.
if ((cls.isPublic() || cls.isProtected()) && !anonymousClass.matcher(classname).matches()) {
// skip private/package-level/anonymous classes but keep abstract classes
// because there may be other public classes extending them
if ((cls.isPublic() || cls.isProtected() || cls.isAbstract()) && !anonymousClass.matcher(classname).matches()) {
writer.key(classname);
writer.object();
asJSON(cls, writer);
Expand Down