Skip to content

Commit

Permalink
fix(android): build with uppercase module JAR on case-sensitive system
Browse files Browse the repository at this point in the history
- TIMOB-27706: App built from case-sensitive volume will fail if referencing a native module JAR having uppercase letters.
  * This has been an issue for several years. Mostly an issue on Linux.
  * We were wrongly doing a toLowerCase() on the JAR file name.
  • Loading branch information
jquick-axway authored and sgtcoolguy committed Jan 9, 2020
1 parent c2d89d4 commit 8a906c7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions android/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2097,7 +2097,7 @@ AndroidBuilder.prototype.generateLibProjectForModule = async function generateLi
await fs.emptyDir(projectLibsDirPath);

// Copy module's main JAR to project's "libs" directory.
const sourceJarFileName = moduleInfo.manifest.name.toLowerCase() + '.jar';
const sourceJarFileName = moduleInfo.manifest.name + '.jar';
const sourceJarFilePath = path.join(moduleInfo.modulePath, sourceJarFileName);
afs.copyFileSync(sourceJarFilePath, path.join(projectLibsDirPath, sourceJarFileName), {
logger: this.logger.debug
Expand Down Expand Up @@ -3124,10 +3124,10 @@ AndroidBuilder.prototype.generateJavaFiles = async function generateJavaFiles()

// Attempt to read the module's Java bindings JSON file.
let javaBindings = null;
const lowerCaseModuleName = module.manifest.name.toLowerCase();
const moduleName = module.manifest.name;
{
// Check if a "<module.name>.json" file exists in the module's root directory.
const jsonFilePath = path.join(module.modulePath, lowerCaseModuleName + '.json');
const jsonFilePath = path.join(module.modulePath, moduleName.toLowerCase() + '.json');
try {
if (await fs.exists(jsonFilePath)) {
const fileContent = await fs.readFile(jsonFilePath);
Expand All @@ -3144,7 +3144,7 @@ AndroidBuilder.prototype.generateJavaFiles = async function generateJavaFiles()
}
if (!javaBindings) {
// Check if a JSON file is embedded within the module's main JAR file.
const jarFilePath = path.join(module.modulePath, lowerCaseModuleName + '.jar');
const jarFilePath = path.join(module.modulePath, moduleName + '.jar');
try {
if (await fs.exists(jarFilePath)) {
javaBindings = this.getNativeModuleBindings(jarFilePath);
Expand Down

0 comments on commit 8a906c7

Please sign in to comment.